I would like to output some code in XSLT in the format:
<div class="addthis_toolbox addthis_default_style" addthis:url="http://example.com" addthis:title="An Example Title">
But XSLT tries to define addthis as a Namespace whereas I just want it output as it is. It results in a "Namespace prefix is not defined" error. Is there anyway around this?
Generating prefixed elements (and attributes) requires that the prefix be bound to a Namespace URI - you can just define the prefix in your top-level <xsl:stylesheet> along with all the others:
It's an error to generate prefixed elements/attributes without defining the Namespace URI for them, so the processor will output the namespace declaration in the top-most element in your frontend (usually <html> or <body> but your mileage may vary...)
Prefix not defined
Hi,
I would like to output some code in XSLT in the format:
But XSLT tries to define addthis as a Namespace whereas I just want it output as it is. It results in a "Namespace prefix is not defined" error. Is there anyway around this?
Thanks
Hi Paul,
Generating prefixed elements (and attributes) requires that the prefix be bound to a Namespace URI - you can just define the prefix in your top-level <xsl:stylesheet> along with all the others:
Then you're allowed to generate those attributes.
It's an error to generate prefixed elements/attributes without defining the Namespace URI for them, so the processor will output the namespace declaration in the top-most element in your frontend (usually <html> or <body> but your mileage may vary...)
/Chriztian
Thanks Chriztian
is working on a reply...