xsl-list
[Top] [All Lists]

[xsl] Simple Transform Breaking

2014-12-02 10:43:52
Greetings Transformative Ones,

I have so simple a transform, that I am running under Eclipse (uses
JAXPSAXProcessorInvoker under Java 7). For some reason, I need to
include a copy-of element for the other for-each elements to output
anything. It seems this must be an issue with the processor, could
there be any other reason?

Where I work, Eclipse is the development platform, but I'm checking
against some other environments now.

Cheers,
Hank

The transform:
====================
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<!-- <xsl:output method="xml" indent="yes" /> -->

<xsl:variable name="crlf"><xsl:text>
</xsl:text></xsl:variable>

<xsl:template match="/">

<!--  remove this test only line and the whole thing breaks. -->
<xsl:copy-of select="."/>

<xsl:for-each select="RESULTS/ROW">
<xsl:text>blah </xsl:text>
</xsl:for-each>

<xsl:for-each select="RESULTS/ROW">
<xsl:value-of select="COLUMN"/>
<xsl:value-of select="$crlf"/>
</xsl:for-each>
</xsl:template>
<xsl:template match="/RESULTS/ROW">
<xsl:value-of select="$crlf"/>
<xsl:value-of select="substring-before(name(.),'W')"/>
</xsl:template>

</xsl:stylesheet>


The source xml:
=======================
<RESULTS>
<ROW>
<COLUMN NAME="NAME"><![CDATA[TOS_PEER_REVIEWER_0]]></COLUMN>
<COLUMN NAME="ROLE_ID"><![CDATA[50000000153]]></COLUMN>
</ROW>
<ROW>
<COLUMN NAME="NAME"><![CDATA[TOS_VIEWERS_0]]></COLUMN>
<COLUMN NAME="ROLE_ID"><![CDATA[50000000158]]></COLUMN>
</ROW>
<ROW>
<COLUMN NAME="NAME"><![CDATA[TOS_PEER_REVIEWER_1]]></COLUMN>
<COLUMN NAME="ROLE_ID"><![CDATA[50000000164]]></COLUMN>
</ROW>
<ROW>
<COLUMN NAME="NAME"><![CDATA[TOS_TIME_KEEPER_1]]></COLUMN>
<COLUMN NAME="ROLE_ID"><![CDATA[50000000171]]></COLUMN>
</ROW>
</RESULTS>
=====================



-- 
Hank Ratzesberger
XMLWerks.com
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>
  • [xsl] Simple Transform Breaking, Hank Ratzesberger xml(_at_)xmlwerks(_dot_)com <=