Data verification in an XML document.

Joseph Nolting

Usenet Archive
Joined
Oct 10, 2003
Messages
2
Reaction score
0
Hi,

I'm new to XML and I am working on a project where I need to verify some of the data in the XML document. The tests I will need to verify include: if a certain element exists then this element must exist, or whether or not a certain attribute exists and has a value, or simply if an element contains text content. My question is, what is the best method to go about performing these verifications? Using a schema, DTD, XSLT, or some other method?

Thank you,

Joseph Nolting
 

Patrick TJ McPhee

Usenet Archive
Joined
Apr 2, 2000
Messages
269
Reaction score
0
% some of the data in the XML document. The tests I will need to verify % include: if a certain element exists then this element must exist, or % whether or not a certain attribute exists and has a value, or simply % if an element contains text content.

Schema was made for these kinds of test. Actually, except for ensuring an element has text content, you could do it with a DTD as well. To ensure one element exists when another does, you either have to ensure that they are adjacent or do a lot of typing.
 

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

No members online now.

Forum statistics

Threads
548,042
Messages
3,104,224
Members
248,132
Latest member
henrywalsh

Latest Threads

Top