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

Re: parent node ??

Subject: Re: parent node ??
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 27 Nov 2003 11:40:28 GMT
xsl count parent node
  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

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.