#60 Error with xmlns:prefix=""

closed-fixed
None
6
2003-01-28
2003-01-24
No

When processing a document in namespace mode, the
following document should be in error (according to XML
Namespaces 1.0 Section 2):

<?xml version='1.0'?>
<docelem xmlns:pre=""/>

However, it is being processed just fine.

With the attached patch, this error is properly reported (only
when namespace processing is enabled).

I hope this can get in before the 1.95.6 release.

Thanks,
Jeremy Kloth

Discussion

1 2 > >> (Page 1 of 2)
  • Jeremy Kloth

    Jeremy Kloth - 2003-01-24
    • summary: Error with xmlns:prefix="" --> Error with xmlns:prefix=""
     
  • Jeremy Kloth

    Jeremy Kloth - 2003-01-24

    Patch for xmlparse.c revision 1.104

     
  • Karl Waclawek

    Karl Waclawek - 2003-01-24

    Logged In: YES
    user_id=290026

    Yes, it seems the NS specs do not allow a prefix name with
    an empty URI. This patch looks OK to me - if Fred agrees, I
    can commit it.

     
  • Karl Waclawek

    Karl Waclawek - 2003-01-24
    • summary: Error with xmlns:prefix="" --> Error with xmlns:prefix=""
     
  • Fred L. Drake, Jr.

    Logged In: YES
    user_id=3066

    I think you're right. I haven't looked at the patch yet,
    but the spec is (almost) clear about this.

    I will note that I consider this more a bug in the namespace
    spec than a desirable feature or constraint to test: It
    makes more sense (to me) to allow the use of xmlns:prefix=''
    to "un-declare" the prefix (possibly making it an error of
    some sort to un-declare a prefix that doesn't have an active
    declaration). But that's my opinion, not the letter of the
    spec.

    I'll mark this as accepted (for concept), and work up a test
    case before committing anything.

     
  • Fred L. Drake, Jr.

    • summary: Error with xmlns:prefix="" --> Error with xmlns:prefix=""
    • priority: 5 --> 6
    • assigned_to: nobody --> fdrake
    • status: open --> open-accepted
     
  • Karl Waclawek

    Karl Waclawek - 2003-01-24
    • summary: Error with xmlns:prefix="" --> Error with xmlns:prefix=""
     
  • Karl Waclawek

    Karl Waclawek - 2003-01-24

    Logged In: YES
    user_id=290026

    Sorry, Fred.

    I jumped the gun - wanted to finish it before going to bed.
    It really looks OK, so I don't feel I risked too much.

     
  • Fred L. Drake, Jr.

    • summary: Error with xmlns:prefix="" --> Error with xmlns:prefix=""
     
  • Fred L. Drake, Jr.

    Logged In: YES
    user_id=3066

    What Karl didn't say was that he checked in the patch as
    lib/xmlparse.c revision 1.105. ;-) I'll just avoid doing a
    "cvs up" until the test is done -- should be soon.

     
  • Jeremy Kloth

    Jeremy Kloth - 2003-01-24
    • summary: Error with xmlns:prefix="" --> Error with xmlns:prefix=""
     
  • Jeremy Kloth

    Jeremy Kloth - 2003-01-24

    Logged In: YES
    user_id=38980

    As far as the bug in the namespace spec goes, they addressed just
    his particular issue with XML NS 1.1. However that would required XML
    1.1 processing which I'm not sure is something that is needed right
    now (although it is in canidate rec).

     
  • Fred L. Drake, Jr.

    • summary: Error with xmlns:prefix="" --> Error with xmlns:prefix=""
    • priority: 6 --> 7
     
  • Fred L. Drake, Jr.

    Logged In: YES
    user_id=3066

    Ok, *now* I'm not happy. I've done my "cvs up", and the
    patch doesn't appear to have fixed the problem. Perhaps I
    don't have proper tests yet? I've attached them to this
    issue report. I expected these tests to pass with current
    CVS since Karl checked in Jeremy's patch.

    I'll have to deal with this tomorrow; I'm too tired to go
    trawling through this just yet. The patched looked fine on
    the surface; did it work for you?

     
  • Fred L. Drake, Jr.

    Logged In: YES
    user_id=3066

    Jeremy: Thanks for the update with regard to XML NS 1.1. I
    agree we don't need to worry about that yet; it's more
    important to fix bugs with regard to XML 1.0 and the first
    version of the namespaces spec. See my previous note.

     
  • Fred L. Drake, Jr.

    • summary: Error with xmlns:prefix="" --> Error with xmlns:prefix=""
     
  • Karl Waclawek

    Karl Waclawek - 2003-01-25
    • summary: Error with xmlns:prefix="" --> Error with xmlns:prefix=""
     
  • Karl Waclawek

    Karl Waclawek - 2003-01-25

    Logged In: YES
    user_id=290026

    This patch does not work when no startElementHandler
    is set, since then namespace declaration will not be
    processed - a recently documented limitation in Expat.

    I have attached a new patch (on top of Jeremy's) which
    should fix this, so that namespace declaration will
    be processed and checked all the time.

    Two files are attached:
    - elmHandlers.txt: a brief overview/explanation
    - elmHandlers.diff: the patch (against xmlparse.c rev. 1.105)

     
  • Karl Waclawek

    Karl Waclawek - 2003-01-25

    Fix for Jeremy's patch

     
  • Karl Waclawek

    Karl Waclawek - 2003-01-25

    Explanation for elmHandlers.diff

     
  • Karl Waclawek

    Karl Waclawek - 2003-01-25
    • summary: Error with xmlns:prefix="" --> Error with xmlns:prefix=""
     
  • Karl Waclawek

    Karl Waclawek - 2003-01-25
    • summary: Error with xmlns:prefix="" --> Error with xmlns:prefix=""
     
  • Karl Waclawek

    Karl Waclawek - 2003-01-25

    Logged In: YES
    user_id=290026

    I tested this against the OASIS test-suite and a few large
    files with no problems. Hope it passes our suite of regression
    tests as well.

     
  • Karl Waclawek

    Karl Waclawek - 2003-01-25
    • summary: Error with xmlns:prefix="" --> Error with xmlns:prefix=""
     
1 2 > >> (Page 1 of 2)

Log in to post a comment.