Menu

#181 xsl-transformation lacks

open
nobody
5
2012-12-07
2011-06-28
Anonymous
No

xsl-transformation of xml copyeditor lacks omit-xml-declaration and strip-space element

xml document

<test>
<item/>
<item/>
<item/>
</test>

xslt script

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<test>
<xsl:apply-templates/>
</test>
</xsl:template>
<xsl:template match="item">
<no>
<go>
<xsl:value-of select="position()"/>
</go>
</no>
</xsl:template>
</xsl:stylesheet>

xmlcopyeditor outputs

<?xml version="1.0" encoding="UTF-8"?>
<test>
<no>
<go>1</go>
</no>
<no>
<go>2</go>
</no>
<no>
<go>3</go>
</no>
</test>

xsltproc outputs:

<test><no><go>1</go></no><no><go>2</go></no><no><go>3</go></no></test>

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.