|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Displaying only first Text node
Hi All,
I am trying to capture/display only the first text node (product name) in
a paragraph tag ("<para>") which has the product name separated by line
break ("<br>") tags. I got as far as identifying the location but I can't
get only the product name before the first line break tag to display.
Please see my XML and XSL snippets below and I hope someone will be able
to give me some pointers on what I am doing wrong.
Thanks in advance for your help, I really appreciate it.
Regards,
Horace Burke
<===XML===>
<!--In this instance for example I only want to display the text
"T8-FITC/NKH-1-RD1"-->
<ProdName>
<title>Product Name</title>
<para>T8-FITC/NKH-1-RD1<br/>T4-FITC/4B4-RD1<br/>T4-FITC/2H4-RD1<br/>T11-RD1/B4-FITC...</para>
</ProdName>
<===END XML===>
<===XSL-FO===>
<!--This is displaying all the product names, so I know that I am really
missing something here -->
<xsl:template match="para" mode="ProdName_BR">
<xsl:choose>
<xsl:when test="parent::ProdName and child::br">
<xsl:if test="position()=1">
<xsl:apply-templates select="node()"/>
</xsl:if>
</xsl:when>
</xsl:choose>
</xsl:template>
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








