The attribute name 'xmlns' is not allowed
notconfusing opened this issue · 6 comments
I get
compilation error: file jats-to-mediawiki.xsl line 40 element attribute
xsl:attribute: The attribute name 'xmlns' is not allowed.
regardless of what the target file is.
My version information is
(env)notconfusing@eigenzorg:~/workspace/JATS-to-Mediawiki$ xsltproc -V
Using libxml 20901, libxslt 10128 and libexslt 817
xsltproc was compiled against libxml 20901, libxslt 10128 and libexslt 817
libxslt 10128 was compiled against libxml 20901
libexslt 817 was compiled against libxml 20901
@wrought any ideas?
I fixed that before. It looks like it was broken by this commit. The message on that commit says "Fixed bug which added extra, empty xmlns attribute to child elements when transforming with xsltproc." So maybe xsltproc behaves incorrectly with the "namespace" attribute on the xsl:element tag.
The problem is that "xmlns" is not an attribute, in XML. It looks like an attribute, but it is not -- it defines a namespace node.
so it was fixed, and then re-broken? ...OK, i'll remove the line
Well, you need the namespace, so removing the line without putting it back the way it was is no good. @jgmorse, do you know what the problem was with xsltproc? I think the way I had it should have worked.
Okay, after a bit of research, it seems we can explicitly declare the namespace in the xsl stylesheet, rather than in the mediawiki element. When the namespace is declared as an attribute for a particular element, the child elements are expected to have specific declarations as well.
So for our purposes specifying the default xmlns
seems to be the appropriate option.
The other way to accomplish a similar goal is with an xmlns:auto
declaration, but this is overkill for our purposes since it seems we want to specify a default namespace at the root element that applies to the rest of the document implicitly, rather than in any other unspecified child elements (such as the erroneous break tags mentioned in #10).
See the branch / commit listed above for a patch.
None at all!