sax and special entities

Discussion in 'XML' started by john bailo, Aug 8, 2003.

  1. john bailo

    john bailo Guest

    A javabean that uses sax is having trouble importing
    an xml file that has   in the fields.

    Is there anyway to configure sax to interpret this as a
    special entity reference?
     
    john bailo, Aug 8, 2003
    #1
    1. Advertising

  2. john bailo

    Mike Brown Guest

    > A javabean that uses sax is having trouble importing
    > an xml file that has   in the fields.


    Nothing wrong with your parser... the XML that contains a reference to an
    entity other than one of the predefined ones (amp, lt, gt, quot, apos) must
    reference a DTD containing a declaration of that entity. (DTDs are checked
    for entity declarations and attribute value defaults even if the parser is
    not validating.)

    First ensure that the nbsp entity is declared. For example, this will always
    work:

    <!DOCTYPE foo [ <!ENTITY nbsp " "> ]>

    ....and this will work if your XML parser is configured to read external DTDs
    (they have the option not to read any external files at all):

    <!DOCTYPE foo SYSTEM "xhtml-lat1.ent">

    If you go with the latter example, get xhtml-lat1.ent from
    http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent and put it in the same
    directory as the XML; don't refer to the w3.org copy directly. See the XHTML
    spec for references to the other .ent files for all the HTML/XHTML entities.
     
    Mike Brown, Aug 9, 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. Usman Syed
    Replies:
    0
    Views:
    421
    Usman Syed
    Aug 13, 2003
  2. Uche Ogbuji
    Replies:
    0
    Views:
    436
    Uche Ogbuji
    Aug 22, 2003
  3. Ralf Schmitt

    registering entities with sax parser

    Ralf Schmitt, Jun 8, 2004, in forum: Python
    Replies:
    0
    Views:
    280
    Ralf Schmitt
    Jun 8, 2004
  4. Replies:
    2
    Views:
    2,632
    Daniel Pitts
    Feb 2, 2008
  5. Jim Higson
    Replies:
    3
    Views:
    245
    Eric Amick
    Jul 25, 2004
Loading...

Share This Page