list of posible values for a tag content

S

Sergei

Hello everybody,
I need to validate an XML document with a DTD file.
The problem is that <lang> tag is empty some times, (but it should
contain ENG,RUS,SPA...)
which causes en error later in the program. How can I catch this with
DTD validation ?
Is there a way to specify a list of posible values for a tag content ?
Or it only can be done for attributes ?
Any suggestions are greatly appreciated.
--Sergei
 
P

Peter Flynn

Sergei said:
Hello everybody,
I need to validate an XML document with a DTD file.

See http://xml.silmaril.ie/authors/parsers/
The problem is that <lang> tag

Element. See http://xml.silmaril.ie/authors/makeup/
is empty some times, (but it should
contain ENG,RUS,SPA...)
which causes en error later in the program. How can I catch this with
DTD validation ?

Is this your own DTD that you have written
or someone else's that you have been given?
Is there a way to specify a list of posible values for a tag content ?

No. Not with a DTD. If you need to check element content you can write
an XSLT program that will do this. Or use a Schema.
Or it only can be done for attributes ?

Correct.

///Peter
 

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
474,001
Messages
2,570,254
Members
46,850
Latest member
VMRKlaus8

Latest Threads

Top