ASP Error: 70
Description: Permission denied
Source: Microsoft VBScript runtime error

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

RE: need help with XSL statement (location path parent

Subject: RE: need help with XSL statement (location path parenthesis problem)
From: "Andrew Welch" <AWelch@xxxxxxxxxxxxxxx>
Date: Mon, 29 Mar 2004 14:17:09 +0100
xsl statements
I'm not sure your '*correct number is x*' statements match the example
xml you have provided, but 2 xpaths that meet your description are:

<xsl:value-of select="count(report[code/@type = 'a' or code/@type =
'b'][code[last()]/@type = 'a'])"/>
 
and
 
<xsl:value-of select="count(report[code/@type = 'a' or code/@type =
'b'][code[last()]/@type = 'b'])"/>

Respectively (when the template is processing <reportlist>).

Are you sure about the xml you've posted?

Andrew



> Hi,
> I have small XSL example which is posing rather large 
> difficulty... I think due to the use of parenthesis needed 
> for document order location path.  Is there an XML guru that 
> can help me with the correct statement 
> for the example below?  Thanks in advance.
>   --Alan
> 
> 
> In the following XML document, I need to be able to query the 
> following:
> 
> 1)  The number of reports which are coded with either an "a" 
> or "b" where the last code (in document order) which is 
> either an "a" or "b" is an "a".
> 
> *correct number is 3 *
> 
> 
> 2)  The number of reports which are coded with either an "a" 
> or "b" where the last code (in document order) which is 
> either an "a" or "b" is a "b".
> 
> *correct number is 1*
> 
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <reportlist>
>     <report>
>         <code type="a"/>
>         <code type="b"/>
>         <code type="c"/>
>     </report>
>     <report>
>         <code type="a"/>
>         <code type="b"/>
>         <code type="a"/>
>     </report>
>     <report>
>         <code type="z"/>
>         <code type="a"/>
>         <code type="d"/>
>     </report>
>     <report>
>         <code type="a"/>
>         <code type="e"/>
>         <code type="f"/>
>     </report>
>     <report>
>         <code type="e"/>
>     </report>
> </reportlist>

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.