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

RE: Function to accept node and name of subnode in p

Subject: RE: Function to accept node and name of subnode in parameter string
From: "Houghton,Andrew" <houghtoa@xxxxxxxx>
Date: Wed, 20 Aug 2008 15:50:03 -0400
RE:  Function to accept node and name of subnode in   p
> From: G. Ken Holman [mailto:gkholman@xxxxxxxxxxxxxxxxxxxx]
> Sent: Wednesday, August 20, 2008 3:40 PM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  Function to accept node and name of subnode in
> parameter string
>
> At 2008-08-20 14:29 -0500, Bordeman, Chris wrote:
> >Hi all.  I need to create a 2.0 function that will accept an
> element()?
> >and a xs:string.  The string will contain the name of a subnode of the
> >first parameter.
> >
> >But it always seems to return just the second string I pass in, not
> the
> >value of the subnode.
>
> ... but the above assumes that your $childname contains the same
> prefix-qualified name as your input tree.  If you only want to check
> on the name portion without the prefix, then you will need
> local-name(.) instead of name(.).
>
> If you need a complete namespace-safe solution then pass in a third
> argument:
>
>    <xsl:param name="childns" as="xs:string"/>
>
> ... and the following test will work indpendent of any prefix chosen
> by the author of the document:
>
>    <xsl:when test="$node and $node/*[local-name(.)=$childname and
>                                      namespace-uri(.)=$childns] != ''">
>      <xsl:value-of select="$node/*[local-name(.)=$childname and

Or he could just change the last parameter to be a QName which packages the
name and namespace URI together...


Andy.

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-2011 All Rights Reserved.