How to turn off all indentation in transformation output?

Oxygen general issues.
Anton
Posts: 1
Joined: Wed Jan 18, 2006 7:19 pm

How to turn off all indentation in transformation output?

Post by Anton »

Hi,
How do I solve such a problem:
I have a simple xsl transformation. When I apply it from command line like this

Code: Select all


xsltproc -o out.xml tidy.xsl doc.xml
I get no indentation in out.xml, exactly what is needed and it looks like this

Code: Select all


<guide>
<title>Title</title>
<subtitile>Subtitle</subtitle>
</guide>
See, each tag starts at the begining of the line.

And if I try to apply a similar transformation scenario with oXygen output document contains annoing indentation before each new level tag, like this

Code: Select all


<guide>
<title>Title</title>
<subtitile>Subtitle</subtitle>
</guide>
Do someone know how this behaviour can be turned off?

Thank you.
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi Anton,

What XSLT engine do you use in your transformation scenario in oXygen? Note that you can use also XSLTProc there and probably you should get similar results with what you get from command line.

I tried a simple stylesheet like

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:copy-of select="."/>
</xsl:template>
</xsl:stylesheet>
and gives me no indentation when applied on a document like yours:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<guide>
<title>Title</title>
<subtitle>Subtitle</subtitle>
</guide>
Now if you get different results that may be due to how the XSLT processor that you used in the transformation scenario works with your stylesheet - it may be that the correct result according with the spec.

Best Regards,
George
Post Reply