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
|
> <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 |
|
cknell - Tue, 4 Feb 2003 13:48:14 -0500 (EST)
|
|