[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: XSL nested tag (new question)

Subject: RE: XSL nested tag (new question)
From: "Richard Lander" <rlander@xxxxxxxxxxxxx>
Date: Tue, 8 Oct 2002 12:35:42 -0700
xsl nested match
Try:

<xsl:template match="SNIPPET">
	<xsl:apply-templates/><br/>
</xsl:template> 

<xsl:template match="Hit | p | snippet">
	<xsl:apply-templates/>
</xsl:template>
 
-----Original Message-----
From: Mani Malarvannan [mailto:mani@xxxxxxxxxxxx] 
Sent: Tuesday, October 08, 2002 12:16 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx

Hi Michael,
But I'm using the XSL templates as shown in my mail below. For this 
XSL templates how can I add this for loop?

Thanks

-Mani
 
At Tuesday, 8 October 2002, you wrote:

>This is very easy:
>
><xsl:for-each select="//SNIPPET">
><xsl:value-of select="."/><br/>
></xsl:for-each>
>
>Michael Kay
>Software AG
>home: Michael.H.Kay@xxxxxxxxxxxx
>work: Michael.Kay@xxxxxxxxxxxxxx 
>
>> -----Original Message-----
>> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
>> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
>> Mani Malarvannan
>> Sent: 08 October 2002 15:38
>> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>> Subject:  XSL nested tag (new question)
>> 
>> 
>> Hi,
>> Thanks for helping me in my nested-tag question yesterday. Now I 
>> need to make simple adjustment 
>> in my output.
>> 
>> I've following XML
>> <snippet>
>> <p>
>> <SNIPPET>This is test 1 snip.</SNIPPET>
>> </p>
>> <p>
>> <SNIPPET> <Hit>Auto</Hit> Test 2 snip </SNIPPET>
>> </p>
>> <p>
>> <SNIPPET>test 3 snip/SNIPPET>
>> </p>
>> <p>
>> <SNIPPET>test 4 snip <Hit>Auto</Hit> test 5 snip </SNIPPET> 
>> </p> <p> <SNIPPET>test 6 snip <Hit>Auto</Hit> test 7 snip 
>> <Hit>Auto</Hit> 
>> test 8 snip </SNIPPET>
>> </p>
>> 
>> </snippet>
>> 
>> For the above XML I need the output to be
>> This is test 1 snip.
>> Auto Test 2 snip
>> test 3 snip
>> test 4 snip Auto test 5 snip
>> test 6 snip Auto test 7 snip Auto test 8 snip
>> 
>> Basically the text under each SNIPPET tag must come in a new line.
>> 
>> As per XSL-List members advise I'm using following XSL to put the 
>> text under SNIPPET and Hit in a line.
>> But the XSL puts everything in one line instead of putting it in 
>> a new line. I think I need a way to
>> check the beginning and end of SNIPPET tag in the followig XSL.
>> 
>> <xsl:template name="snippet" match="snippet/p/SNIPPET/text()" >
>>        <xsl:if test="//parameter[@name='SNIPPET']">
>>          <xsl:if test="position() &lt; $numsnippets">
>>           <xsl:value-of select="." />
>>          </xsl:if>
>>        </xsl:if>
>> </xsl:template>
>> 
>> <xsl:template name="hit" match="snippet/p/SNIPPET/Hit">
>>      <xsl:if test="//parameter[@name='SNIPPET']">
>>        <xsl:if test="position() &lt; $numsnippets">
>>          <span name="SearchTerm" class="SearchTerm"> <xsl:value-of 
>> select="." />  </span>
>>        </xsl:if>
>>      </xsl:if>
>> 
>> Thanks for all the help
>> 
>> -Mani
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>> 
>
> XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>








 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.