[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] XTRE1160: The fragment identifier {62;n} is not a valid NCName


Subject: RE: [xsl] XTRE1160: The fragment identifier {62;n} is not a valid NCName
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 19 Nov 2008 16:50:35 -0000

Saxon isn't 100% conformant in its handling of fragment identifiers, though
it's a pretty fuzzy area and I'm not sure it really affects the outcome in
this case. The reality is that when URIs are processed using the JAXP
URIResolver concept, Saxon has no knowledge of a media type, so it cannot
interpret a fragment identifier in a way that depends on the media type, and
it therefore treats it as an NCName irrespective of the actual media type.

But the root cause of the problem is that the "#" in the URI, if it is to be
interpreted as an ordinary character, should have been escaped as %23.
Except that in this case, the error is deeper, in that "&amp;#62;" should
have been "&#62;".

Michael Kay 
http://www.saxonica.com/

> -----Original Message-----
> From: Andrew Welch [mailto:andrew.j.welch@xxxxxxxxx] 
> Sent: 19 November 2008 11:54
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] XTRE1160: The fragment identifier {62;n} is 
> not a valid NCName
> 
> Possibly Saxon specific issue here, or maybe something related to the
> data: scheme:
> 
> I'm calling doc() passing in content from an RSS feed which 
> attempts to be tidied using tagsoup, but this particular value:
> 
> <xsl:value-of select="doc('data:,More Th&amp;#62;n')"/>
> 
> causes this exception:
> 
> Error at xsl:value-of on line 30 of rss-to-xhtml-text-plus-image.xsl:
>   XTRE1160: The fragment identifier {62;n} is not a valid NCName
> 
> net.sf.saxon.trans.XPathException: The fragment identifier 
> {62;n} is not a valid NCName
>         at net.sf.saxon.functions.Document.makeDoc(Document.java:257)
>         at net.sf.saxon.functions.Doc.doc(Doc.java:155)
>         at net.sf.saxon.functions.Doc.evaluateItem(Doc.java:129)
> 
> it doesn't even make it to the URIResolver
> 
> The value is "More Th>n" double escaped - are there any 
> restrictions on the "data" scheme, or should this be fine?  
> Shouldn't it at least make it to the custom URIResolver?
> 
> A correct, single-escaped value works fine:
> 
> <xsl:value-of select="doc('data:,More Th&#62;n')"/>
> 
> Running that my debug output shows what goes in and out of tagsoup:
> 
> ** in uri resolver: data:,More Th>n
> More Th&gt;n
> 
> 
> 
> Any ideas?
> 
> 
> --
> Andrew Welch
> http://andrewjwelch.com
> Kernow: http://kernowforsaxon.sf.net/


Current Thread