• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Xerces question  RSS feed

 
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am parsing an XML document using Xerces parser.
Basicly, I am just following the instructions from the book <b>Java and XML</b> by McLaughlin. When I ran my program, it didn't give me the PIs and DTDs.
COuld anybody give an answer to it? By the way, I was using DOM...
[This message has been edited by Edy Yu (edited April 13, 2001).]
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is your XML?? Can you post it here??
 
Edy Yu
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following is my XML.
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="addressbook.xsl"?>
<!DOCTYPE addressbook [
<!ELEMENT addressbook (address)+>
<!ELEMENT address (name, street, city, state, zip)>
<!ELEMENT name (firstname, lastname)>
<!ELEMENT firstname (#PCDATA)>
<!ELEMENT lastname (#PCDATA)>
<!ELEMENT street (#PCDATA)>
<!ELEMENT city (#PCDATA)>
<!ELEMENT state (#PCDATA)>
<!ELEMENT zip (#PCDATA)>
]>
<addressbook>
<address>
<name>
<firstname>Xiang</firstname>
<lastname>Yu</lastname>
</name>
<street>125 Detzel Place</street>
<city>Cincinnati</city>
<state>OH</state>
<zip>45219</zip>
</address>

<address>
<name>
<firstname>Xiaoming</firstname>
<lastname>Zou</lastname>
</name>
<street>125 Detzel Place</street>
<city>Cincinnati</city>
<state>OH</state>
<zip>45219</zip>
</address>
</addressbook>
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm..I think you're doing something wrong.
I used the SAXWriter ( sample program that comes with Apache's Xerces ) to parse your XML file and it did print out everything as expected -

Perhaps your implementation of ContentHandler is bugged. Check again.


------------------
Ajith Kallambella M.
Sun Certified Programmer for the Java�2 Platform.
IBM Certified Developer - XML and Related Technologies, V1.
 
Get me the mayor's office! I need to tell her about this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!