Comments (2)
It looks like the above text was formatted by QuickXML. Browsing the code (which I can't debug because of issues with the Nuget packages), I see that ::writeEOL
and ::writeIndentation
are guarded by a condition that is false
when text is encountered right before a closing tag:
This means QuickXML will not insert a newline between text and a closing tag. In the sample text above, text is adjacent to a closing tag inside the innermost span:
closing tag
...........
v
<span>t</span>
^...
text
Using one of the other formatters, the result is the same or even worse:
![xmltools-formatters-compared](https://private-user-images.githubusercontent.com/59004801/254767942-02b31c6d-0889-4899-a80b-96fde5fd42b2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIxNDQyNTEsIm5iZiI6MTcyMjE0Mzk1MSwicGF0aCI6Ii81OTAwNDgwMS8yNTQ3Njc5NDItMDJiMzFjNmQtMDg4OS00ODk5LWE4MGItOTZmZGU1ZmQ0MmIyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI4VDA1MTkxMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTIxZThkNjFiYjc0NDQ4YmYwYmE5N2NiNzMzNTNkODc2OTA0OWIyMzU2MjFiOWNiMGUwZTdmZDU5NjU0MDJkYTUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.REjYY8Ppzm9qJ8ysuFVoaAauC82Als7bSWVz0T1LErk)
All the above were formatted with the same options:
Auto-close tags True
Ensure conformity False
Apply xml:space="preserve" False
Go to Plugins > XMLTools > Options
to find them:
![xmltools-format-options](https://private-user-images.githubusercontent.com/59004801/254768588-ce902195-23fa-4b4c-b3ed-102b036c1409.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjIxNDQyNTEsIm5iZiI6MTcyMjE0Mzk1MSwicGF0aCI6Ii81OTAwNDgwMS8yNTQ3Njg1ODgtY2U5MDIxOTUtMjNmYS00YjRjLWIzZWQtMTAyYjAzNmMxNDA5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI4VDA1MTkxMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBjY2Q4ZTQzYTY4NDZlZjM3ODA3MWI3Y2JiMWM2ZTYzZDk0NDJlMDg1Zjk0NzRiMjIxNGE5YThjMmUxNDE5NjcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.YR1KJvDU7vEG6pWb44oVAK3n_NUFRnMXgRq56z_f82E)
from xmltools.
@rdipardo Did you mean to say "SimpleXML"? Your screenshots match what I'm seeing. QuickXML actually produces correct indentation, SimpleXML produces the incorrect indentation that I initially encountered, and StringXML produces even worse indentation.
Im not sure why my installation was defaulting to SimpleXML, since on other machines a fresh install defaulted to QuickXML, but switching to QuickXML is a work-around for this specific issue.
from xmltools.
Related Issues (20)
- Request: add support for ends-with
- DTD is prohibited
- Request/Question: xml-tool "pretty print - indent attributes" via commandline or in batch HOT 1
- Validation of XML against Schema fails with no DTD/Schema declaration was found
- how to make the "mark done" disappear depending on a condition in Odoo14
- Evaluate XPath expression, XPath copying through `Current XML path` gives no result and dialog gives no hint HOT 2
- Can't click or copy an URL displayed in Plugins -> XML Tools -> Options...
- Unable to PrettyPrint an Xml File with the given shortcut
- NPP XML plug-in locks most recently used folder HOT 3
- "Pretty print ALT+SHIFT+B" command drops BOM on UTF-8 BOM files
- Annotation error mode does not respect word wrap enabled
- Pretty Print does not auto change language to XML HOT 1
- Does not handle html5 style void tags such as source, img and picture
- `noNamespaceSchemaLocation` not found in case of domain redirection
- Security Review for End User Use
- Validation using xsd file doesn't work.
- choose XSLT processor / transformer engine?
- The latest version of xmltools is not compatible with the latest version of Notepad++
- [Feature request] make XML Tools translatable HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xmltools.