[jdom-interest] question on JDom document validation. Happy New Year

Mike Jennings mjenning at islandnet.com
Tue Jan 2 09:21:36 PST 2001


Hi,

I am new to JDOM as well (but not to Java)
as far as I understand it (which may be incorrect)
you can invent your own XML format if you wish, with tags
called "ABC", "DEF" and "XYZ" for example. You might
call this format 'The DH format'.
You may have your own rules for constructing DH format files;
for example: only one "XYZ" tag inside of "DEF" tags, only one
"ABC" tag etc.
You could enforce these rules by whatever application uses the DH format.
But that means that EVERY program that uses the DH format has to check
if the input document has more than one "XYZ" tag inside of a "DEF" tag.
Alternatively, you could create a DTD for the DH format, and inside the DTD
you could specify what tags and tag combinations are legal for the DH
format.
Then ANY validating XML parser could check if the input DH file is valid or
not.

At least this is how I understand it, I could be wrong.
-Mike Jennings

PS. Happy New Year!

----- Original Message -----
From: "Dominik Hasek" <DHasek1 at excite.com>
To: <jdom-interest at jdom.org>
Sent: Tuesday, January 02, 2001 2:19 AM
Subject: [jdom-interest] question on JDom document validation. Happy New
Year


>
> Hi to all of you
>
> First of all i would like to wish you an happy new year.
>
> I'm rather new in this mailing list and in the xml developpement in fact.
My
> first programming language was Java, and  i must tell you that jdom is the
> best API ever made. I really wanted to knock my head to the wall when i
see
> the DOM or Sax API.
> Fortunatly, Jason and Brett are here to exclusively think in java ;-))
>
> Sorry if my questions will sounds stupid to some of you :
>
> I've noticed that JDom (Java world article) uses a SaxBuilder to parse a
xml
> file, and we have the choise to use validation or not.
>
> in jason's examples validation is never set to true.
>
> I don't know what is exactly validation. But i think it is something
> like a verification to know if the inputted xml file is valid or not.
>
> Does validation checks according to the dtd assigned to the xml file ?
>
> If validation is set to true, and xml file is not valid what kind of
> exception is thrown ? saxExceptions ?
>
> Thanks to all of you who can me see the light ;-))
>
> Take care
>
> DH
>
>
>
>
>
> _______________________________________________________
> Send a cool gift with your E-Card
> http://www.bluemountain.com/giftcenter/
>
>
> _______________________________________________
> To control your jdom-interest membership:
>
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com
>




More information about the jdom-interest mailing list