i have to parse strings with escaped markup, contained in the @body attribute of an ownedComment Element. An example woud be @body='<p>test</p>'
In order to deal with parser errors, which could be caused by typos in the string above, i'd like to use the new try/catch mechanism of XSLT 3.
So i wrote something along these lines:
Code: Select all
<xsl:variable name="doc" as="document-node()" select="parse-xml-fragment(db:escapeEntities($string))"/>
<xsl:apply-templates select="$doc/*" mode="db-ns"/>
Everything works fine as long as the input can be parsed without errors. But if it is not well-formed, or if it contains references to undeclared entities, the runtime error is not catched. I would like to get the DocBook para Element with error as content, but instead the transformation fails with an error message from saxon which tells me, why the string cannot be parsed.
This is a bug, isn't it?
Oxygen 17.0, build 2015051321 on Windows 7 64 bit with Saxon EE 22.214.171.124. Stylesheet Version is 3.0.