[xml] Help with dtd, and XML_PARSE_PEDANTIC



Hello,

I'm validating a xml document via xmlCtxtReadFile,
with the flags XML_PARSE_DTDVALID |
XML_PARSE_PEDANTIC.

The problem I'm finding is with the structure of my
document which looks like this:

<question>
  <title>bla bla</title>
  <answer>bla bla</answer>
  <correct-answer>bla bla</correct-answer>
  <image>bla bla</image>
</question>

There can be more than one possible <answer>, but only
one mandatory <correct-answer> per question, and zero
or one <image>.

Then I thought on letting the user being able to put
those nodes in the order he/she felt like doing it,
though I think this is not actually possible, is it?

At dtd validation time "positional-strictness"
applies, and there's no way I can do it (or I haven't
achieved it, have tried many different dtd
constructions for a while)

So I wonder if someone can confirm me that I'm forced
to provide a static structure so users would have to
build the document strictly as dtd says is should
(same order), or if there's someway I could have the
document well validated while letting the users chuck
these nodes in an arbitrary order?

Kind Regards,



Send instant messages to your online friends http://uk.messenger.yahoo.com 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]