Data verification in an XML document.

J

Joseph Nolting

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
 
P

Patrick TJ McPhee

% 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
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top