[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] Can I use attributes with namespaces?


Subject: RE: [xsl] Can I use attributes with namespaces?
From: <Jarno.Elovirta@xxxxxxxxx>
Date: Mon, 14 Nov 2005 10:04:20 +0200

Hi,

>I would like to add new attributes to existing XHTML elements.
>For example <a myns:reference="...">. Is this possible and how

By just creating that attribute into the result tree. You can do it e.g. by
declaring the myns namespace in the xsl:stylesheet element and then adding the
myns:reference attribute using xsl:attribute.

>can I use xpath to access this attribute?.

With XSLT 1.0, not while you're creating the attribute, unless you use
node-set extension to cast the Result Tree Fragment that contains the
attribute into a node set.

Jarno


Current Thread
Keywords