[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Using unparsed-text() to test prolog
>>>>> "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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|