xsl-list
[Top] [All Lists]

Re: Using unparsed-text() to test prolog

2006-02-17 00:06:02
"Jesper" == Jesper Tverskov <jesper(_at_)tverskov(_dot_)dk> writes:

    Jesper> Hi list

    Jesper> A week ago Colin Adams reminded us: "in XSLT 2.0 you can
    Jesper> call unparsed-text on the document and read the DOCTYPE".

    Jesper> It has inspired me to make a sort of
    Jesper> "prolog-identity-template".  I have just published an
    Jesper> article about it: "Using unparsed-text() in XSLT 2.0 to
    Jesper> test prolog".

Interesting.
A few comments:

The four variables input-file etc. is not exactly robust. They assume
people are sticking to semi-conventional usages for file names.
Probably the O/S name should be obtained via system-property (not
available as standard, but can probably be obtained by my proposed
exslt extension)

Perhaps an xsl:function library for parsing filenames and URIs would
be a useful project.

What is this nonsense in footnote [3] about / being wrong? It is the
correct separator. \ is invalid in URIs so cannot occur in a
conformant system, unless you first decode the URI.

Your assumption that the encoding must be UTF-8 if not present is not
justified. It might be UTF-16 <horror/>.
Unparsed-text() won't give you the value of the BOM, if present, so
this had better be a configuration parameter (which still isn't
perfect - there might be a mixed set).

I'll also take the opportunity to mention that my gexslt/gestalt
processor also allows writing a DTD internal subset, although not in
such a sophisticated way as Saxon (you just provide it with a single
text string for the whole internal subset).
-- 
Colin Adams
Preston Lancashire

--~------------------------------------------------------------------
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>
--~--



<Prev in Thread] Current Thread [Next in Thread>