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

RE: self axis and attributes

Subject: RE: self axis and attributes
From: "Kevin Jones" <kjouk@xxxxxxxxxxx>
Date: Fri, 17 Nov 2000 22:12:51 -0000
self axis

>
> but no! The self:: axis's principal node type is element, and since
> the attribute is not a dem:count element, it still gets included! The
> best I can do whilst retaining independence between the stylesheet and
> source is:
>
>   @*[not(local-name() = 'count' and
>          namespace-uri() = document('')/*/namespace::dem)]
>                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>                         or hand-code, or variable, or entity
>
> [Please don't tell me to swap the xsl:attribute for the xsl:copy-of to
>  override the dem:count - I'm looking for a general solution.]
>
> Am I missing something? Is there any way of testing the identity of
> namespaced attributes while retaining independence between the source
> and stylesheet and without testing the namespace-uri()?

It's a bit ugly but I think this works,

<xsl:template match="vote">
   <xsl:copy>
      <xsl:attribute name="dem:count">
         <xsl:value-of select="@rep:count - 432" />
      </xsl:attribute>
	<xsl:variable name="dem" select="generate-id(@dem:count)"/>
      <xsl:copy-of select="@*[generate-id()!=$dem]" />
   </xsl:copy>
</xsl:template>

Of course its not so easy if you are dealing with more than one attribute...

Kev.


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


 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.