xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James McCarthy" <jam...@webxi.com>
Subject Xerces Namespace problem
Date Fri, 28 Jan 2000 15:42:10 GMT
I have discovered what I believe is a bug in the Xerces parser. When you try
to use a default namespace declaration in the root tag it will fail. Even
worse, it tries to resolve the entity which I don't believe it should be
doing according to the namespace spec.

I have reproduced this problem and can provide three very similar examples,
two that work and one that fails. These examples came directly from the
namespace spec.

First Case: Qualified namespace declaration - Works As Expected

<?xml version="1.0"?>
<!-- all elements here are explicitly in the HTML namespace -->
<html xmlns:html='http://www.w3.org/TR/REC-html40'>
  <html:body><html:p>Moved to
    <html:a href='http://frob.com'>here.</html:a></html:p></html:body>

Second Case: Default namespace declaration - Does not work and it tries to
resolve the entity (with a long delay if you are not able to contact the
entity or a file not found if it is not a URL).

<?xml version="1.0"?>
<!-- elements are in the HTML namespace, in this case by default -->
<html xmlns='http://www.w3.org/TR/REC-html40'>
  <body><p>Moved to
    <a href='http://frob.com'>here</a>.</p></body>

Third Case: Same as above except that another attribute is declared before
the namespace declaration - Strangely, this example works as expected.

<?xml version="1.0"?>
<!-- elements are in the HTML namespace, in this case by default -->
<html anyAttribute="Attribute" xmlns='http://www.w3.org/TR/REC-html40'>
  <body><p>Moved to
    <a href='http://frob.com'>here</a>.</p></body>

If I am doing something wrong in any of these examples please let me know.
If not I hope that the very re-creatable examples help resolve the problem.

I am using the 1.0.1 version of Xerces-J.


Jim McCarthy
WebXi, Inc.

P.S. Keep up the great work. I persued this problem because I refuse to use
any other parser.

View raw message