xsl-list
[Top] [All Lists]

RE: Counting in several levels

2004-11-26 03:47:56
Instead of "parameter", which is short for "child::parameter", you need
"descendant::parameter", or ".//parameter" (which in this case returns the
same as "descendant::parameter").

Michael Kay
http://www.saxonica.com/ 

-----Original Message-----
From: Sven Waibel [mailto:sven(_dot_)waibel(_at_)imbus(_dot_)de] 
Sent: 26 November 2004 10:37
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Counting in several levels

Hi,

a new problem:

XML:
-------------------------------------------
<case>
      <parameter>
              <status value="performed"/>
              <verdict value="fail"/>
      </parameter>
      <parameter>
              status value="performed"/>
              <verdict value="pass"/>
      </parameter>
      <parameter>
              status value="performed"/>
              <verdict value="pass"/>
      </parameter>
      <case>
              <parameter>
                      <status value="performed"/>
                      <verdict value="fail"/>
              </parameter>
              <parameter>
                      status value="performed"/>
                      <verdict value="pass"/>
              </parameter>
              <parameter>
                      status value="performed"/>
                      <verdict value="pass"/>
              </parameter>
      </case>
</case>


If the current node "case" is the inner node then this is working:
      <xsl:value-of 
select="count(parameter[status/@value='performed' and 
verdict/@value='pass'])" />
But if my current node is the outer node, it's not working 
for known reasons.

I wanna get all parameters that "performed" and "pass".

To make it more complex: I don't know how many nodes "case" 
are in the node "case": //case/case*/parameter

Thanks again and best regards
Sven


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>