[xsl] Displaying only first Text node

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.

Horace Burke


<!--In this instance for example I only want to display the text
  <title>Product Name</title>

<===END XML===>

<!--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:when test="parent::ProdName and child::br">
	 <xsl:if test="position()=1">
	    <xsl:apply-templates select="node()"/>

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 

Current Thread