HELP: Using Xerces DOM to parse XHTML

Discussion in 'Java' started by CTowers, Apr 4, 2004.

  1. CTowers

    CTowers Guest

    Hello,

    I am trying to use DOM to parse through the following special file. It
    is an XHTML file, but has some tags. The aim is to output the normal
    html tags and namespaces, as is, but when a <student> tag is found,
    call a function.
    ----------------------------------------------------------------------------------------
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <h1><center>Welcome to our Student list!</center></h1>

    </head>

    <body>

    <studentrole>
    <student>Jane Lee</student>
    <student>Tom Keept</student>
    </studentrole>
    </body>
    </html>
    ---------------------------------------------------------------

    My problem is that I don't know how to deal with the DOCTYPE
    declaration and the normal HTML tags... can these be parsed through
    and outputted... because they aren't really nodes.

    Is it possible to do what I am trying to do??

    Any suggestions are welcome.

    Thank you.
     
    CTowers, Apr 4, 2004
    #1
    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. Watsh
    Replies:
    2
    Views:
    962
    Keith M. Corbett
    Nov 2, 2004
  2. cvissy
    Replies:
    0
    Views:
    609
    cvissy
    Nov 16, 2004
  3. Anthony Mak
    Replies:
    1
    Views:
    625
    Johannes Koch
    Feb 10, 2005
  4. Replies:
    7
    Views:
    901
  5. Nobody
    Replies:
    3
    Views:
    967
    Joseph Kesselman
    May 9, 2006
Loading...

Share This Page