Parsing of an entity if it appears as an attribute value.

Discussion in 'XML' started by Vineeth, Nov 2, 2004.

  1. Vineeth

    Vineeth Guest

    Hi,

    I am developing an application using the SAX interface provided by
    "xerces-j 2.6.0". My application does not need a DTD for execution as
    it is not supposed to perform any validation. I have to provide
    customized entity processing for which I have implemented the
    startEntity function of the LexicalHandler interface. The problem that
    I am facing is with respect to any entity other than the 5 builtin
    ones. If any entity for example &abcd; which is not a built-in entity
    is specified in the content of any element then it gets successfully
    processed using the customized entity resolution provided in the
    startEntity function, but if the same entity occurs in the value of an
    attribute then it is not getting processed. In such cases the
    startEntity function is also not getting called. On looking up the
    value of the attribute in the startElement callback, I found that the
    entity is not being passed on instead it is being consumed. Only the
    five built-in entites if they are present are returned back in the
    call-back.

    I would be grateful if anybody can suggest a solution for this
    peculiar problem.

    Thankx,
    Vineeth
     
    Vineeth, Nov 2, 2004
    #1
    1. Advertising

  2. In article <>,
    Vineeth <> wrote:

    >My application does not need a DTD for execution as
    >it is not supposed to perform any validation.


    But then you say:

    >The problem that
    >I am facing is with respect to any entity other than the 5 builtin
    >ones.


    So you *do* need a DTD. DTD's aren't just for validation. If you want to
    use non-built-in entities, you need a DTD. Even if you managed to hack
    around it, you would not be using XML, but a proprietary variant.

    Why not use a DTD?

    -- Richard
     
    Richard Tobin, Nov 2, 2004
    #2
    1. Advertising

  3. Hi Richard,

    I have written my own entity resolver and I will be using it to resolve
    the entities. I donot have any dependency on the DTD. What I need is a
    way to get at the non normalized value of the attribute. Moreover I have
    a large number of DTD's due to which I donot want to keep dependency of
    the conversion process on the DTD.

    Thanks
    Vineeth



    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    Vineeth Narayanan, Nov 3, 2004
    #3
  4. Vineeth

    Vineeth Guest

    (Richard Tobin) wrote in message news:<cm7r31$123f$>...
    > In article <>,
    > Vineeth <> wrote:
    >
    > >My application does not need a DTD for execution as
    > >it is not supposed to perform any validation.

    >
    > But then you say:
    >
    > >The problem that
    > >I am facing is with respect to any entity other than the 5 builtin
    > >ones.

    >
    > So you *do* need a DTD. DTD's aren't just for validation. If you want to
    > use non-built-in entities, you need a DTD. Even if you managed to hack
    > around it, you would not be using XML, but a proprietary variant.
    >
    > Why not use a DTD?
    >
    > -- Richard



    Hi Richard,

    The problem with DTD is that my application does not have access to
    the DTD. The basic functionality of my application is to convert the
    XML document into a text based format document. I have written an
    entityResolver implementing the Lexicalhandler interface, this
    Resolver is called if the entity occurs in the content but it does not
    get called up if the entity occur as an attribute value.

    I somehow need access to the NonNormalized value of the attribute.

    Any suggestions are welcome.

    --Vineeth
     
    Vineeth, Nov 3, 2004
    #4
    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. Mateusz Loskot
    Replies:
    5
    Views:
    1,299
    Mateusz Loskot
    Oct 23, 2005
  2. Replies:
    1
    Views:
    4,287
    Joe Kesselman
    Aug 2, 2006
  3. Replies:
    8
    Views:
    523
  4. Max
    Replies:
    9
    Views:
    525
  5. markla
    Replies:
    1
    Views:
    549
    Steven Cheng
    Oct 6, 2008
Loading...

Share This Page