You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Robert Houben <rh...@telus.net> on 2003/04/01 08:30:34 UTC

RE: building DOM tree using DTD

I'm doing the same thing but with schema (xsd).  What you need to look
at is the psvi package.  Do a search on psvi and you'll find a few
references to it.  You can parse the DTD without needing an instance
document, then you can walk the metadata and start building.  DTD will
undoubtedly be different than xsd is.

A few warnings...

First, the documentation is very sparse.  You may need some help from
this group to figure your way around.  If you search archives for "psvi"
you will find some good suggestions.

Secondly, you will encounter some problems when you run into a model
group with an xsd:choice definition in it. Which choice do you use to
build your sample?  When you get an enum, which one of the values do you
use for your example?  If you have an element that can exist 0 to 20
times, how many times do you include it, or do you include it at all?

Using an object designed to validate multiple choice will lead to some
issues, when you try to use it to create an example.

Good luck!

Robert Houben
mailto:rhouben@telus.net
http://www.RobertHouben.com/
 


-----Original Message-----
From: Anthony Saucet [mailto:anthony.saucet@freesbee.fr] 
Sent: Monday, March 31, 2003 3:24 AM
To: xerces-j-user@xml.apache.org
Subject: building DOM tree using DTD


I'm student, new in Dom using.
I'd like to create an xml file using a DTD, but don't know how to start 
with dom api.
How can parse a dtd, get the info I need (elements, attributes, values 
(required, default)) ?
do I have to build a DOM tree? how to do it?

many thx for helping me
anthony


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org