[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
> <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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|