Subject: [xsl] Displaying only first Text node From: Horace Burke <xmlmarkup@xxxxxxxxx> Date: Wed, 12 Dec 2007 09:52:58 -0800 (PST) |
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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Double muenchian grouping, Martin Honnen | Thread | Re: [xsl] Displaying only first Tex, Florent Georges |
Re: [xsl] Escaped characters being , Anderson, Paul | Date | Re: [xsl] Displaying only first Tex, Florent Georges |
Month |