Comments (6)
Hmm, this one is a bit tricky, if I turn on "Preserve Whitespace" in the XML Document then you will see this:
I assume you do not want to see whitespace like this, or do you? In order to have full control over whitespace in the document (and see it in the XSLT transform) you kind of need this, but it's pretty tedious...?
The alternative (1) is I hide all these nodes in the XML notepad UI, but I load the whitespace nodes into the document so XSLT transforms can see the whitespace.
Alternative (2) which saves memory, would be to not load any whitespace into the document, but before I run the XSLT transform I save the document with pretty printing turned on (which xml notepad save is doing already) and then I feed that saved document with whitespace to the XSLT transform. The downside of this is that for very large documents this could add a lot of time before you see the XSLT output due to having to save and reload that doc into the transform.
What is your preference?
from xmlnotepad.
I ended up adding a new Option under formatting called "Preserve Whitepsace" so you can play with that (in the main branch) and see what you think, after turning it on you will need to reload your XML doc and you will see the above #whitespace
nodes.
from xmlnotepad.
Hi Chris
I'm not sure we are talking about the same topic.
I have this XML in UTF-8:
<?xml version="1.0" encoding="utf-8"?>
<DSS_2015_LV95.Siedlungsentwaesserung.Einzugsgebiet TID="12684">
<OBJ_ID>12684</OBJ_ID>
<Metaattribute>
<SIA405_Base_LV95.Metaattribute>
<Letzte_Aenderung>20211124</Letzte_Aenderung>
</SIA405_Base_LV95.Metaattribute>
</Metaattribute>
</DSS_2015_LV95.Siedlungsentwaesserung.Einzugsgebiet>
This XSLT (ident copy):
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="@*|node()">
<xsl:copy >
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
With your xsl.exe 1.0 from your XMLTools 2023-01-27 I use this command:
xsl -s ident_kopie.xslt mini.xml
and get this result:
<?xml version="1.0" encoding="utf-8"?><DSS_2015_LV95.Siedlungsentwaesserung.Einzugsgebiet TID="12684">
<OBJ_ID>12684</OBJ_ID>
<Metaattribute>
<SIA405_Base_LV95.Metaattribute>
<Letzte_Aenderung>20211124</Letzte_Aenderung>
</SIA405_Base_LV95.Metaattribute>
</Metaattribute>
</DSS_2015_LV95.Siedlungsentwaesserung.Einzugsgebiet>
Using the same in XMLNotepad I get this result - with missing line-breaks:
<?xml version="1.0" encoding="utf-8"?><DSS_2015_LV95.Siedlungsentwaesserung.Einzugsgebiet TID="12684"><OBJ_ID>12684</OBJ_ID><Metaattribute><SIA405_Base_LV95.Metaattribute><Letzte_Aenderung>20211124</Letzte_Aenderung></SIA405_Base_LV95.Metaattribute></Metaattribute></DSS_2015_LV95.Siedlungsentwaesserung.Einzugsgebiet>
from xmlnotepad.
Please re-read my answers, this is about "preserving whitespace" in the XML Document, which XML notepad does not do by default. But xsl.exe does preserve the whitespace by default. Try my new Preserve Whitespace setting and you will get the XSL output you are looking for.
from xmlnotepad.
New Preserve Whitespace formatting option is available in https://github.com/microsoft/XmlNotepad/releases/tag/2.9.0.9
from xmlnotepad.
Related Issues (20)
- Schema Import Error HOT 12
- Editing the name of a new root node that you added attributes loses the attributes HOT 2
- Enhancement - copy all parents of a child node in either slash or dot format HOT 9
- Copy XPath of selected node HOT 2
- Bulk Selection/Removal? HOT 1
- Crash upon launching HOT 8
- Just trying HOT 1
- Options Dialog Box Sizing and Size Persistence Issues; Resetting of Settings Files HOT 2
- Location of Schema used for current xml file unclear HOT 1
- Function to print files HOT 1
- Error Message after SEARCHING and drag&drop of a new file HOT 1
- Unhandled exception on XML file load of XML document known to accepted by target entity HOT 5
- electronic invoice in UBL format takes long time to open (several minutes) HOT 1
- Setup: used folders on Win 10 HOT 3
- File - New: Keeps the current file HOT 3
- Multiple instances resets the settings HOT 4
- Sugg: Clear message for long XSLT-Transform HOT 3
- Reload of a "not loaded" file HOT 2
- 'Newtonsoft' could not be found for \Application.csproj HOT 6
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 xmlnotepad.