Subject: Re: [xsl] How to specify document order location path for identical elements with different parents? From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Fri, 02 Apr 2004 14:53:34 -0500 |
1) What is the number of reports which are coded with either an "a" or "b" where the last "a" or "b" code of the report (in document order) is an "a"?
(correct number is 3. Yes, this has been double checked.)
count(/reportlist/report [codelist/code/@type='a' or codelist/code/@type='b'] [descendant::code[@type='a' or @type='b'][last()]/@type='a'])
2) What is the number of reports which are coded with either an "a" or "b" where the last "a" or "b" code of the report (in document order) is a "b".
In my previous posting I recevied several helpful responses.
Unfortunate that I couldn't apply them to my application because my example was too simplified. Specifically, codes in the same report may have different codelist parents, and this seems to be what's at the root of my problem formulating an xpath statement.
count(/child::reportlist/child::report [child::codelist/child::code/attribute::type='a' or child::codelist/child::code/attribute::type='b'] [descendant::code[attribute::type='a' or attribute::type='b'] [position() = last()]/attribute::type='a'])
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] How to specify document order, Alan Stein | Thread | RE: [xsl] How to specify document o, Andreas L. Delmelle |
RE: [xsl] XHTML to XHTML transform, Andreas L. Delmelle | Date | RE: [xsl] multiple or statements in, Andreas L. Delmelle |
Month |