Discussion:
[Exist-open] xsl:copy-of with attribute : exerr:ERROR Exception while transforming node: An attribute node (attr) cannot be created after a child of the containing element
Rémi Koutchérawy
2017-06-24 09:44:42 UTC
Permalink
Hi,

I am found a strange bug.
A short test, uses xql to call xsl witch reads xml :

copy-of.xql :
let $xml := <ouvrage/>
let $xslSheet := doc('copy-of.xsl')
let $xmlout := transform:transform($xml, $xslSheet, ())
return $xmlout

copy-of.xsl :
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0">
<xsl:template match="/">
<xsl:copy-of select="doc('insert.xml')"/>
</xsl:template>
</xsl:stylesheet>

insert.xml :
<ouvrage>
<alinea>test</alinea>
</ouvrage>

This works perfectly and returns as expected the content of insert.xml

Now change insert.xml adding an attribute.
insert.xml :
<ouvrage>
<alinea attr='foo'>test</alinea>
</ouvrage>

eXist returns :
exerr:ERROR Exception while transforming node: An attribute node (attr)
cannot be created after a child of the containing element [at line 3,
column 16]

I suspect there is something related to doc() in xsl with relative path.

Does it makes sense to open a bug with that description ?

Remi
Dannes Wessels
2017-06-24 15:47:44 UTC
Permalink
Hi,
Post by Rémi Koutchérawy
Does it makes sense to open a bug with that description ?
did you verify with Saxon outside eXist-db? e.g. in Oxygen?

In additional, which version of eXist-db are you using? at a point we had some changes regarding this
.

cheers

Dannes

Loading...