L. H. Silli wrote:
> Have installed Xerces Java via MacPorts. But I don't know how to run it 
> ... But should I really expect that it behaves different from XMLmind 
> XML editor?
> 

I'm sorry but I don't know. XMLmind XML Editor uses the Xerces XML
parser bundled with our product through the standard Java XML APIs (JAXP).



> * For 'utf8_BOM.xml', then I can tell you that XMLmind XML editor, on 
> my Mac OS X Snow Leopard (Intel) *does* delete that BOM.

That's right, it deletes it when you save the file to disk, but this
cannot be considered to be a flaw.



> And therefore one must take care: To check whether Xerces Java 
> *ignores* the UTF-8 BOM, you should add
> 
>   <?xml version="1.0" encoding="ISO-8859-1"?>
> 
> at the beginning of the file 'utf8_BOM.xml'. If it ignores the BOM, 
> then there will be no error. If it sees the BOM, then it will emit 
> 'fatal error.'

You are 100% right. We forgot to test this.

Yes, Xerces Java 2.9.1 ignores the UTF-8 BOM! The XML declaration has
priority over the UTF-8 BOM.

The attached XML file, which corresponds to the test you have described,
opens fine in XMLmind XML Editor.



> But note: I am not sur that Xerces Java should be changed to adhere to 
> XML 1.0. I think that, possibly, the UTF-8 BOM should make that the XML 
> encoding declaration is ignored.

"The UTF-8 BOM should make that the XML encoding declaration is ignored"
is not something clearly stated in the XML 1.0 spec.


<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- initially, the default namespace is "books" -->
<book xml:lang="fr" xmlns="urn:loc.gov:books" xmlns:ns="urn:w3-org-ns:HTML"
      xmlns:isbn="urn:ISBN:0-395-36341-6" xmlns:foo="foo"
      xmlns:bk="urn:loc.gov:books">
  <title>Cheaper by the Dozen - Oh le bel été que voilà! </title>

  <isbn:number>1568491379</isbn:number>

  <foo:number>1568491379</foo:number>

  <notes bk:type="comment">
    <!-- make HTML the default namespace for some commentary -->

    <ns:p>This is a <ns:i>funny</ns:i> book! <footnote xmlns="">1.<text
    xmlns="urn:loc.gov:books">xxx</text></footnote> </ns:p>
  </notes>

  <isbn:type>bar</isbn:type>
</book>

 
--
XMLmind XML Editor Support List
xmleditor-support@xmlmind.com
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to