Altova Mailing List Archives


RE: [xsl] Cannot Access Attribute with colon

From: "Clifford, Karen" <Karen.Clifford@------------>
To:
Date: 10/16/2002 6:57:00 AM
Thanks for the suggestion......

I added it to the stylesheet and also found that to access it I had to use,
for example, 

 <xsl:when test="./link/@show='new'"> as opposed to xlink:@show

Thanks again for all your help.

Karen

-----Original Message-----
From: Jeni Tennison [mailto:jeni@xxxxxxxxxxxxxxxx]
Sent: Wednesday, October 16, 2002 3:10 PM
To: Clifford, Karen
Cc: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
Subject: Re: [xsl] Cannot Access Attribute with colon


Hi Karen,

> I need to access the values of the xlink:show and xlink:href
> attributes, unfortunately using '@xlink:show' does not work, (ie
> <xsl:value-of select="@xlink:show"/>) it doesnt seem to like the
> colon ' :'

My guess would be that you haven't declared the 'xlink' prefix within
your stylesheet. A name like xlink:show is a qualified name, with a
prefix ('xlink') and a local part ('show'). In order to resolve the
qualified name, the XSLT processor needs to be able to tell what
namespace the prefix 'xlink' is referring to, so it needs to have a
namespace declaration in scope.

Try adding a namespace declaration for the 'xlink' prefix to the
<xsl:stylesheet> element, as follows:

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xlink="http://www.w3.org/1999/xlink">
...
</xsl:stylesheet>

and the processor should stop complaining about the ':'.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.