xsl-list
[Top] [All Lists]

Re: Unparse-text() string contains ascii chars 29, 30 and 31

2005-10-19 09:18:26
On 19 Oct 2005 17:13:24 +0100, Colin Paul Adams
<colin(_at_)colina(_dot_)demon(_dot_)co(_dot_)uk> wrote:
"andrew" == andrew welch 
<andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com> writes:

    andrew> I'm trying to process some data that's one long string
    andrew> delimited using ascii characters 29, 30 and 31 (which are
    andrew> apparently group, record and unit 'separator characters').

    andrew> I can get access to the string using unparsed-text(), but
    andrew> when I attempt to process the string using any of the
    andrew> function eg:

    andrew> tokenize($str, '&#29;')

    andrew> or

    andrew> substring-before($str, '&#31;')

    andrew> ...the XML parser complains that these aren't legal XML
    andrew> characters (when the stylesheet itself is parsed).

Well, they aren't in XML 1.0 but they are in 1.1.
So if you edit the XML declaration, to specify 1.1, and if your parser
supports XML 1.1, your home and dry.

Ha! Almost..... (would've been a great workaround)

I now get the error:

  XTDE1180: The unparsed-text file contains a character illegal in XML
(line=1 column=15 value=hex 1f)
Transformation failed: Run-time errors were reported

Which makes me think Saxon (851b) is checking the string....

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--