Hi,
I am building a javascript menu tree based on some XML and using XSLT with SAXON 8.8.
My XML is as follows:
Code:
</ACM:SEC1>
<ACM:TITLE>DE-ICING PROGRAM <FARREF>121.689</FARREF></ACM:TITLE>
</ACM:SEC1>
By XSLT is:
Code:
<xsl:for-each select="/ACM:ROOT/ACM:CHAPTER/ACM:SEC1">
<xsl:variable name="section1">
<xsl:value-of select="ACM:TITLE/text()"/>
</xsl:variable>
<xsl:text>d3 = CreateTreeItem( d2, "img/project.gif", "img/folder_open.gif", "</xsl:text>
<xsl:value-of select="$section1"/>
<xsl:text>", "</xsl:text>
<xsl:value-of select="$section1"/>
<xsl:text>.xml", "main" )</xsl:text>;
</xsl:for-each>
</xsl:for-each>
Desired output =
Code:
d3 = CreateTreeItem( d2, "img/project.gif", "img/folder_open.gif", "DE-ICING PROGRAM", "DE-ICING PROGRAM.xml", "main" );
Current Output:
Code:
d3 = CreateTreeItem( d2, "img/project.gif", "img/folder_open.gif", "DE-ICING PROGRAM
", "DE-ICING PROGRAM
.xml", "main" );
The problem is if there is an element child of <ACM:TITLE>, the text output places a line return. How can I avoid this?