This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Newbie: See if a node exists!
- From: "Américo Albuquerque \(E-mail\)" <aalbuquerque at viseu dot ipiaget dot pt>
- To: "XSL-List \(E-mail\)" <XSL-List at lists dot mulberrytech dot com>
- Date: Fri, 7 Jun 2002 11:51:10 +0100
- Subject: [xsl] Newbie: See if a node exists!
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi!
I have two xml file
the first has this format
<Display>
<Path/>
<Title/>
<Book>
<Author/>
<Author/>
...
</Book>
<Book>
<Author/>
<Author/>
...
</Book>
...
</Display>
the second has a <Block> tag separating the <Book> tags like this
<Display>
...
<BLOCK>
<Book>
...
</Book>
...
</BLOCK>
...
</Display>
What i what is a way to see if a <Block> tag exists and, in that case, just
work with the <Book> inside the <Block>
if not then work with the <Book>
I use this xsl to do that but it doesn't do the Block Part
<xsl:choose>
<xsl:when test="./BLOCK">
<xsl:call-template name="Title"/>
<xsl:apply-templates select="BOOK"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="BookHeader"/>
<xsl:apply-templates select="BOOK[not (@destaque=-1)]"/>
</xsl:otherwise>
</xsl:choose>
What am I doing wrong?
Thanks in advance!
____________________________________________________________________________
____
() Chain Sword VROOOOMMMMM
___||_______________________ VROOOMMMM
(0___||______________________/ VROOOOMMMM
||~~~~~~~~~~~~~~~~~~~~~~
() "It cuts every thing
with a roar" www.geocities.com/Area51/6986
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list