Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > HELP: Using Xerces DOM to parse XHTML

Reply
Thread Tools

HELP: Using Xerces DOM to parse XHTML

 
 
CTowers
Guest
Posts: n/a
 
      04-04-2004
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Xerces SAX to parse just part of an input stream? Nobody XML 3 05-09-2006 09:56 PM
parse URL (href) from xhtml, xhtml -> text, for data hawat.thufir@gmail.com XML 7 02-08-2006 07:39 PM
How to get an xml subtree using DOM using xerces? Anthony Mak XML 1 02-10-2005 09:11 AM
Upgrade of Xalan 1.2.2 and Xerces 1.4.4 to Xalan 2.6 and Xerces 2.6.2 cvissy XML 0 11-16-2004 07:06 AM
Using xerces to parse a string of xml does not seem to work Watsh XML 2 11-02-2004 10:48 PM



Advertisments