Disclaimer: The following is against sin against XML. This is why I am trying to change it using XSLT :)
Now my XML looks like this:
<root> <object name="blarg" property1="shablarg" property2="werg".../> <object name="yetanotherobject" .../> </root>
Yes, I put all the text data in the attributes. I hope XSLT can save me; I want to move to something like this:
<root> <object> <name>blarg</name> <property1>shablarg</name> ... </object> <object> ... </object> </root>
It actually works for me, except that my sins against XML were more ... exceptional. Some tags look like this:
<object description = "This is the first line This is the third line. That second line full of whitespace is meaningful"/>
I use xsltproc under linux, but it has no options for saving spaces. I tried using xsl: preserve-space and xml: space = "save" to no avail. It seems that every parameter found is used to store spaces inside the elements themselves, but not for attributes. Each time the above changes:
This is the first line This is the third line. That second line full of whitespace is meaningful
So the question is, can I keep the attribute space?
xml xslt whitespace
Atiaxi Nov 04 '08 at 0:22 2008-11-04 00:22
source share