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

Re: Determining the type of attribute within the match

Subject: Re: Determining the type of attribute within the matching template
From: David Carlisle <davidc@xxxxxxxxx>
Date: Sat, 8 Feb 2003 15:07:40 GMT
Re:  Determining the type of attribute within the match

>         <when test="self::text()[normalize-space(.) != '']">
this branch will never test true as you are matching element and
attribute nodes only, and this is testing if the current node
is a text node.
perhaps you wanted to test if it had no element children
which would be not(*)


>         <when test="self::@rdf:resource">
@ is attribute:: so this is self::attribute:: which is two axis
specifications back to back which is a syntax error.

> Is there any way of picking up all attributes in a template and then
> determining their type, without a comparison of name() and namespace-uri(),
> which feels wrong?

Not in general (but use local-name and namespace-uri rather than name()
to be prefix neutral) but here you could move the test to the match
pattern

ie have 
<xsl:template match="@rdf:resource">,,,</xsl:template>
<xsl:template match="@rdf:datatype">,,,</xsl:template>
etc rather than having a catch-all template containing a choose.


David

 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.