xsl-list
[Top] [All Lists]

Re: Determining the type of attribute within the matching template

2003-02-08 08:07:40


        <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



<Prev in Thread] Current Thread [Next in Thread>