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

Comparing node for identity using union

Subject: Comparing node for identity using union
From: António Mota <amsmota@xxxxxxxxx>
Date: Thu, 13 Jan 2005 21:32:22 +0000
xsl menu example
I don't know what's happenend in here, but i was using the union
operator for comparing nodes, following M. Kay sugestion some weeks
ago. It was working OK then, but now it simple stop working. I don't
believe in witches, but as the Spaniards says "que las hay, hay"...

What i was doing was something like this:

	<xsl:param name="pos" select="0"/>
	<xsl:variable name="snode" select="(//Menu)[$pos]"/>
(...)

							<xsl:when test="(count(parent::Menu|$snode)=1)">
								<xsl:text>1</xsl:text>
							</xsl:when>

aplyed to something like

<Menus>
    <Menu>
        <Menu_K>X00043</Menu_K>
        <Titulo>Processos</Titulo>
        <Menu>
            <Menu_K>X00047</Menu_K>
            <Titulo>Caracterizagco</Titulo>
        </Menu>
    </Menu>
    <Menu>
        <Menu_K>X00047</Menu_K>
        <Titulo>Caracterizagco</Titulo>
    </Menu>
    <Menu>
        <Menu_K>X00110</Menu_K>
        <Titulo>Setting's</Titulo>
        <Menu>
            <Menu_K>X00110</Menu_K>
            <Titulo>Setting's</Titulo>
        </Menu>
    </Menu>
</Menus>

In this example when the context node is /Menus/Menu/Menu and $pos=1 i
want the value 1, otherwise something else.

When $pos = 0 i never want that condition true, and everithing was
working OK. But now i only changed the tag names and it's not working
anymore. I run to the debuger i see that

(count(parent::Menu|$snode)=1) is allways true, even when $snode no
node, and even when there is no parent::Menu .

For example, when in  /Menus/Menu/Menu and (//Menu)[0] that condition is true.

I'm completly lost in here, its late and i don't know what to think...

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.