Rémi Koutchérawy
2017-06-24 09:44:42 UTC
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
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