parse-xml-fragment() Fails in Saxon 9.5 but not in 9.8

Eliot Kimber <ekimber-xb9TSTQ6enFWk0Htik3J/[email protected]> Fri, 15 Jan 2021 11:03:35 -0600
Newsgroups gmane.text.xml.saxon.help
Message-ID <[email protected]>
I realize this is another "help me with a version you never want to think about again question" but I have to ask it.

Per my recent post on the XSLT list, I'm using saxon:parse-pseudo-attribute() function to get the value of an Oxygen delete PI @content attribute, which contains escaped XML markup.

Using this code:

<xsl:variable name="rawMarkup" as="xs:string" select="saxon:parse-pseudo-attribute('content')"/>
<xsl:variable name="deletedMarkup" as="element">
  <deletedMarkup xmlns="">
   <xsl:sequence select="parse-xml-fragment($rawMarkup)"/>
  </deletedMarkup>
</xsl:variable>

<xsl:apply-templates select="$deletedMarkup" mode="handle-deleted-markup"/>

it works perfectly with Saxon 9.8.

However, with Saxon 9.5 I get these errors:

Error reported by XML parser processing
file:/home/kimberw/workspace/nbs/src/xslt/gaonb-pe/preProcessPhase.xsl: Scanner State 24
not Recognized
Error on line 109 of preProcessPhase.xsl:
FODC0006: First argument to parse-xml-fragment() is not a well-formed and
namespace-well-formed XML fragment. XML parser reported: Error reported by XML parser

With Saxon 9.5 I can write the value of $rawMarkup to a file and see that it is in fact well-formed XML, but of course there's no way that Oxygen would not put well-formed XML here.

Given that Saxon 9.5 is required for this application, any idea if there's any workaround for this particular error?

The requirement is to take the value of the @content attribute and process it as XML in the context of the current transform. Because this transform is run inside a larger system, doing some kind of file-level preprocessing is not really an option, at least not one that could be easily applied.

Thanks,

Eliot
--
Eliot Kimber
http://contrext.com
 




_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[email protected]
https://lists.sourceforge.net/lists/listinfo/saxon-help