HELP: Using Xerces DOM to parse XHTML

C

CTowers

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top