1

I need to decode escaped XML using xquery, i.e. I have a string like &amp;lt; and I need to read it as <.

I'm using Saxon 9.6.

I read this question and tried to use saxon:parse(), but it didn't work (see below).

Is there a HE version of Saxon supporting saxon:parse() or saxon:parse-xml()?

Are there other alternatives to decode the escaped XML?

My query:

declare namespace saxon = "http://saxon.sf.net/";

saxon:parse("&lt;")

the result:

Error on line 11 of query.xq: XPST0017: Cannot find a matching 1-argument function named {http://saxon.sf.net/}parse(). Saxon extension functions are not available under Saxon-HE

Community
  • 1
  • 1
cdarwin
  • 4,141
  • 9
  • 42
  • 66

1 Answers1

2

There are standard XPath 3.0 functions parse-xml() and parse-xml-fragment() which supersede saxon:parse(). They should work in Saxon-HE, but try 9.7 rather than 9.6.

Mads Hansen
  • 63,927
  • 12
  • 112
  • 147
Michael Kay
  • 156,231
  • 11
  • 92
  • 164