Re: [xsl] parent node ??

Subject: Re: [xsl] parent node ??
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 27 Nov 2003 11:40:28 GMT
  if it is not possible to select all valid inputs that have the same string
  value of their parent

It is possible to do that (the test .=..) it's just that there clearly
will be no such elements except in very degenerate cases.

The number of such elements in any doc will be zero unless there is an
element all of whose siblings (including text nodes) have empty string value so 
<x><z/><y>a</y><x>
x and y have the value "a" so in this case you get a count of 1.
but even something like

<x>
<z/>
<y>a</y>
<x>

you get a count of 0 as x now has string value "

a
"
which is not "a"

The only way to get a count greater than 1 is to have an element all of
whose children have empty string value

<x><z/><z/><z/><z/><z/><z/></x>

all the z's have an empty string, the same as x so you get 6.



The fact that you ask makes me suspect that you mean something different
by "string value" than is meant in Xpath. If you gave some examples of
input and desired output, it would help.

  My problem is to count how many valid_inputs have the same string value as
  the solution tag.

Note that "tag" has a definite meaning in XMl (and it does not mean
element) XSLT does not have access to the tags in the document at all,
so tags don't have any value. The string value of the solution element
that you posted is "Inhalt" as the string value does not depend on
the attributes of an element. 
You can count the number of valid_inputs with taht value as
count(valid_input[.='Inhalt']
but that does not seem to address your question
> is it possible to select the solution tag with a few attribute?


David
-- 
http://www.dcarlisle.demon.co.uk/matthew

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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


Current Thread