[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Using unparsed-text() to test prolog

Subject: Re: Using unparsed-text() to test prolog
From: Colin Paul Adams <colin@xxxxxxxxxxxxxxxxxx>
Date: 17 Feb 2006 07:06:02 +0000
unparsed text
>>>>> "Jesper" == Jesper Tverskov <jesper@xxxxxxxxxxx> 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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.