IE Error: Reference to undeclared namespace prefix

Discussion in 'XML' started by Romeo Disca, Aug 21, 2003.

  1. Romeo Disca

    Romeo Disca Guest

    Hello newsgroup,

    i'm new to xml - what's wrong with this piece code here?

    i have these two files:

    test.xml
    ----
    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE a SYSTEM "test.ent" [
    <!ELEMENT a (ANY)>
    <!ATTLIST a
    xmlns:xxx CDATA #FIXED "hello"
    >

    ]>
    <a xmlns:xxx="hello">
    &hello;
    </a>
    ====
    test.ent
    ----
    <?xml version="1.0" encoding="utf-8"?>
    <!ENTITY % prefix "xxx:">
    <!ENTITY hello "<%prefix;hello/>">
    ====

    The IE6 throws the error 'Reference to undeclared namespace prefix'.

    If i change the the prefix to '<!ENTITY % prefix "">' the output is
    ----
    <a xmlns:xxx="hello">
    <hello/>
    </a>
    ====

    What am I missing?

    Thanks. romeo

    --
    Romeo Disca
    Email:
     
    Romeo Disca, Aug 21, 2003
    #1
    1. Advertising

  2. Try this simpler example:

    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE xxx:a [
    <!ELEMENT xxx:a (#PCDATA)>
    <!ATTLIST xxx:a xmlns:xxx CDATA #FIXED "hello">
    ] >
    <xxx:a> Here are the goodies </xxx:a>

    where it is easier to see that the XML is valid. See what IE gives you.

    The XML Plug-in in jEdit has no problem with this.

    The IE failure appears to be a bug in the way one of the Microsoft libraries
    handles namespaces in conjunction with default attributes #FIXED by the DTD.
    (I suspect a library because CookTop makes the same error when an xmlns
    attribute is defaulted.)

    I ran into this last week. I checked the namespace specification. It is
    clear that it is necessary to deal with default attributes properly in a
    validating XML processor that is namespace aware.

    (Note that a namespace-unaware but validating processor will also accept the
    document as I have defined it.)

    The W3C Schema Validator at http://www.w3.org/2001/03/webdata/xsv processes
    the above example and complains about not being able to find a schema at URI
    "hello" but then it does lax validation and accepts the document.

    -- orcmid

    PS: Your use of ANY as a way to allow <hello> (or <xxx:hello>) elements is
    incorrect. All elements in the document must be defined by <!ELEMENT >
    definitions in a valid XML document. ANY does not extend to elements that
    have no markup declaration in the DTD. -- dh

    "Romeo Disca" <> wrote in message
    news:bi2dk5$mjv$00$-online.com...
    > Hello newsgroup,
    >
    > i'm new to xml - what's wrong with this piece code here?
    >
    > i have these two files:
    >
    > test.xml
    > ----
    > <?xml version="1.0" encoding="utf-8"?>
    > <!DOCTYPE a SYSTEM "test.ent" [
    > <!ELEMENT a (ANY)>
    > <!ATTLIST a
    > xmlns:xxx CDATA #FIXED "hello"
    > >

    > ]>
    > <a xmlns:xxx="hello">
    > &hello;
    > </a>
    > ====
    > test.ent
    > ----
    > <?xml version="1.0" encoding="utf-8"?>
    > <!ENTITY % prefix "xxx:">
    > <!ENTITY hello "<%prefix;hello/>">
    > ====
    >
    > The IE6 throws the error 'Reference to undeclared namespace prefix'.
    >
    > If i change the the prefix to '<!ENTITY % prefix "">' the output is
    > ----
    > <a xmlns:xxx="hello">
    > <hello/>
    > </a>
    > ====
    >
    > What am I missing?
    >
    > Thanks. romeo
    >
    > --
    > Romeo Disca
    > Email:
     
    Dennis E. Hamilton, Aug 31, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. heidi

    Tag prefix and namespace

    heidi, Nov 2, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    378
    heidi
    Nov 2, 2003
  2. Tim Tyler
    Replies:
    36
    Views:
    1,526
    Darryl L. Pierce
    Dec 10, 2004
  3. makwak
    Replies:
    4
    Views:
    3,470
    Rolf Magnus
    Mar 9, 2005
  4. Chris  Chiasson
    Replies:
    6
    Views:
    652
    Richard Tobin
    Nov 14, 2006
  5. Xeno Campanoli
    Replies:
    2
    Views:
    276
    Brian Candler
    Jun 3, 2009
Loading...

Share This Page