Project

Profile

Help

Byte error when trying to open Ptree

Added by David Rudel over 10 years ago

Sorry for posting here after sending to the email list. I realized it might help if I could post an example file I'm having problems opening.

The attached file was created using xsl:result-document with "saxon:ptree" as the value of @method.

When I try to open the file (e.g., <xsl:value-of select="count(document($file))"/> I get a byte error: System ID: E:\Schema_Test\copy\139468--STAFFORD_ELEMENTARY_SCHOOL\139468--STAFFORD_ELEMENTARY_SCHOOL_fact_03_30_14\Grade_2\EESPINOZA_1669732.ptree Scenario: Schema_Testing XSL file: C:\Users\David\Desktop\XSL_Scripts\XSLT_2014\Schema_Testing.xsl XML file: E:\Schema_Test\Nodes.xml Engine name: Saxon-EE 9.5.1.3 Severity: fatal Description: Invalid byte 1 of 1-byte UTF-8 sequence. - Invalid byte 1 of 1-byte UTF-8 sequence. Start location: 1:1 URL: http://www.saxonica.com/html/documentation/javadoc/net/sf/saxon/trans/SaxonErrorCode.html#SXXP0003


Replies (3)

Please register to reply

RE: Byte error when trying to open Ptree - Added by Michael Kay over 10 years ago

The symptoms suggest that it's trying to open the file as a regular XML file and not as a PTree.

The standard URI resolver recognizes a PTree file only if (a) the -p:on option is set on the command line (or the equivalent in the API), and (b) the file extension is .ptree.

RE: Byte error when trying to open Ptree - Added by David Rudel over 10 years ago

Is there any way to work this magic through a config file? Either by setting recognizeUriQueryParameters="true" and then modifying the URI query or through some other flag?

RE: Byte error when trying to open Ptree - Added by Michael Kay over 10 years ago

Yes, setting <global recognizeUriQueryParameters="true" in the config file should have the same effect as setting the -p option: that is, provided you use the standard URI resolver and a URI ending in .ptree, it should work.

    (1-3/3)

    Please register to reply