How do I retrieve attributes in correct order from a DOM

Discussion in 'Java' started by Prashant Parashar, Apr 13, 2006.

  1. Hi,
    How do I retrieve attributes in correct order from a DOM?

    the NamedNodeMap does not maintain the order and the
    Node.getChildNodes() is not returning the attributes. Is there a way to
    get attributes in correct order.

    Thanks,
    Prashant Parashar
    Prashant Parashar, Apr 13, 2006
    #1
    1. Advertising

  2. is this related to Xerces or particular implementation?
    Prashant Parashar, Apr 13, 2006
    #2
    1. Advertising

  3. Prashant Parashar

    Oliver Wong Guest

    "Prashant Parashar" <> wrote in message
    news:...
    > Hi,
    > How do I retrieve attributes in correct order from a DOM?
    >
    > the NamedNodeMap does not maintain the order and the
    > Node.getChildNodes() is not returning the attributes. Is there a way to
    > get attributes in correct order.
    >
    > Thanks,
    > Prashant Parashar


    According to the XML standard, the order of attributes in an XML DOM is
    not significant. If order is significant, then the document should use
    children elements rather than attributes.

    - Oliver
    Oliver Wong, Apr 13, 2006
    #3
  4. Prashant Parashar

    Oliver Wong Guest

    "Prashant Parashar" <> wrote in message
    news:...
    > is this related to Xerces or particular implementation?
    >


    In a sense. The XML specification states that order of attributes are
    not siginificant, so implementations are free to return the attributes in
    any order they wish. You might want to seek out an implementation which
    guarantees a certain ordering.

    - Oliver
    Oliver Wong, Apr 13, 2006
    #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. joon
    Replies:
    1
    Views:
    515
    Roedy Green
    Jul 8, 2003
  2. Prashant Parashar
    Replies:
    1
    Views:
    424
    Steve W. Jackson
    Apr 13, 2006
  3. Dan

    correct or not correct?

    Dan, Oct 2, 2003, in forum: HTML
    Replies:
    7
    Views:
    441
  4. J.Ram
    Replies:
    7
    Views:
    650
  5. Pierre
    Replies:
    0
    Views:
    114
    Pierre
    Mar 2, 2005
Loading...

Share This Page