Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XSLT Illegal attribute 'separator'

Aloha,

while writing an XSLT stylesheet, I encountered a problem, I could not solve. My basic XML structure is the following

<nonUniqueConstraint name = "...">
  <column name = "..."/>
  <column name = "..."/>
</nonUniqueConstraint>

I want to print the names of all columns. Therefore I used the following statement (I'm iterating over all nonUniqueConstraints):

    <xsl:value-of select="./column/@name" separator=", "/>

However when I run my Ant build file, it outputs the following:

Error! [ERR 0510][ERR XTSE0090] The illegal atttribute 'separator' is specified

I looked for the error and found the following description:

[ERR XTSE0090] It is a static error for an element from the XSLT namespace to have an attribute whose namespace is either null (that is, an attribute with an unprefixed name) or the XSLT namespace, other than attributes defined for the element in this document.

Nevertheless I have seen many examples using the separator attribute, e.g. here.

How can I fix that problem?

Cheers

like image 582
productioncoder Avatar asked Sep 20 '26 03:09

productioncoder


2 Answers

Look at stylesheet element on version attribute - it should be 2.0 to enable attribute "separator" at xsl:value-of

<xsl:stylesheet version="2.0"...
like image 164
Jirka Š. Avatar answered Sep 23 '26 14:09

Jirka Š.


I think you should check which XSLT processor you are running.

The error is a little odd, because the error code XTSE0090 is defined only in XSLT 2.0, yet XSLT 2.0 permits the separator attribute. Jirka's reply is only partially correct. If you are running an XSLT 1.0 processor, it will always reject the separator attribute, but it is unlikely to use the XSLT 2.0 error code XTSE0090. If you are running a 2.0 processor, it should accept the separator attribute whether the stylesheet specifies version="1.0" or version="2.0". So there's something a bit strange going on.

To check what XSLT processor you are using, use the XSLT system-property() function to write a message.

like image 40
Michael Kay Avatar answered Sep 23 '26 16:09

Michael Kay



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!