getElementById

Discussion in 'XML' started by Marc Dzaebel, Jun 1, 2006.

  1. Marc Dzaebel

    Marc Dzaebel Guest

    Hi,

    using JDK1.6, is there a way to tell a Document (DOM Level 3) that a certain
    Attribute (usually "id") is always of type ID without defining a grammar
    file? Currently I have to traverse the full DOM tree and
    setIdAttribute("id", true). Otherwise getElementById returns null. If I need
    a schema, is it possible to create it programmatically.

    Thanks, Marc
     
    Marc Dzaebel, Jun 1, 2006
    #1
    1. Advertising

  2. Marc Dzaebel wrote:


    > using JDK1.6, is there a way to tell a Document (DOM Level 3) that a certain
    > Attribute (usually "id") is always of type ID without defining a grammar
    > file? Currently I have to traverse the full DOM tree and
    > setIdAttribute("id", true). Otherwise getElementById returns null.


    I don't know whether the parser you use supports that but xml:id could
    help, see
    <http://www.w3.org/TR/xml-id/>
    That way you do not need a DTD or schema (but you need to use the
    attribute name xml:id).

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Jun 2, 2006
    #2
    1. Advertising

  3. Marc Dzaebel

    Marc Dzaebel Guest

    "Martin Honnen" <> schrieb im Newsbeitrag
    news:44802b98$0$11070$-online.net...
    > I don't know whether the parser you use supports that but xml:id could
    > help, see
    > <http://www.w3.org/TR/xml-id/>
    > That way you do not need a DTD or schema (but you need to use the
    > attribute name xml:id).


    Hi Martin,

    I already tried this but obviously the use of attribute name xml:id does not
    work, even if the parser (Xerces) is set to be namespace aware. May be
    Xerces does not implement this newer recommendation yet?

    Thanks, Marc
     
    Marc Dzaebel, Jun 2, 2006
    #3
  4. Marc Dzaebel wrote:
    > May be Xerces does not implement this newer recommendation yet?


    Sounds likely. Xerces has its own mailing list; ask there? (Or check
    their website; they *should* list the specifications they support
    somewhere, though that may not have been updated recently.)


    --
    () ASCII Ribbon Campaign | Joe Kesselman
    /\ Stamp out HTML e-mail! | System architexture and kinetic poetry
     
    Joe Kesselman, Jun 3, 2006
    #4
  5. Marc Dzaebel

    Marc Dzaebel Guest

    I just verified that Xerces does *not* support http://www.w3.org/TR/xml-id/.

    Marc

    "Joe Kesselman" <> schrieb im Newsbeitrag
    news:...
    > Marc Dzaebel wrote:
    >> May be Xerces does not implement this newer recommendation yet?

    >
    > Sounds likely. Xerces has its own mailing list; ask there? (Or check their
    > website; they *should* list the specifications they support somewhere,
    > though that may not have been updated recently.)
     
    Marc Dzaebel, Jun 5, 2006
    #5
    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. Gilles T.
    Replies:
    8
    Views:
    2,090
    Alessandro Zifiglio
    Jan 5, 2004
  2. jm
    Replies:
    1
    Views:
    837
  3. Paul
    Replies:
    8
    Views:
    3,300
  4. Franck
    Replies:
    3
    Views:
    2,401
    Eliyahu Goldin
    Aug 25, 2005
  5. Ferret Face
    Replies:
    3
    Views:
    30,061
    Ferret Face
    Oct 4, 2005
Loading...

Share This Page