Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: XPath data model and the XML Declaration

From: Bjoern Hoehrmann <bjoern@---------.-->
To: NULL
Date: 12/2/2004 4:25:00 PM
* Richard Tobin wrote in comp.text.xml:
>>The XML declaration does not contain information that
>>would make sense to be available in the data model.
>
>But this is an exaggeration.  The encoding is a useful hint when
>serializing the data model, and the XML version number affects what
>assumptions you can make about the data (e.g. whether it might have
>C0 control characters in it).

The problem is however that the value of the encoding pseudo-attribute
might not be the actual character encoding of the document, for example
if the document is delivered via HTTP the acutal encoding might be 
specified in the HTTP header which would then override the value in the
XML declaration (if any). So it would make more sense to use other means
to get that information, for example using DOM Level 3 Core methods. 

Regarding C0 control characters, I do not think these may appear in the
XPath 1.0 data model which is only defined for XML 1.0 (they are not
allowed to appear in expressions either, strings are restricted to chars
as defined in XML 1.0 which excludes C0 controls)... and if they are in
the data model, you can infer that the XML version is 1.1 so this is of
limited use, too.

Other uses would be possible too, for example, if you want to write an
XSLT document that discovers meta-data from XML documents like

  XML Declaration: yes
  Encoding Declaration: ISO-8859-1
  Standalone: no

  Elements:

    1 <html>
    1 <head>
    1 <body>
   32 <div>
  ...

or whatever, so maybe I should rephrase to, the value such functionality
would add is not considered worth the additional complication and such
functionality might contribute to making false assumptions such as that
the encoding in the XML declaration is the actual document encoding.
-- 
Björn Höhrmann · mailto:bjoern@h... · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent