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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

RemiKoutcherawy
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

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|

Re: 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

Dannes Wessels-3
Hi,

On 24 Jun 2017, at 11:44 , Rémi Koutchérawy <[hidden email]> wrote:

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


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open