[xml] DTD questions



Hi there,

I am currently trying to solve two problems - one is a general DTD thing, the other is related to libxml2.

1. I have a document with the following structure:

   <root>
     <editor ...><user.../></editor>
     <node ...><node...></node></node>
     <node ...></node>
     <template...>...</template>
   </root>

   there is always 0-1 editor- and template-element and 0-n node-elements.
   The problem is, that I can not control the order of the elements and
   when I try to define the root element like
   <!ELEMENT root (editor?,node*,template?)>
   I end up with an error because the order often is wrong (it depends on
   userinteraction when which element is created).
   I also might end up with something like node,template,node,node,editor,
   node,node...

   Is there a way to get around this or to define the element properly?

2. How can I create a new XML document using libxml2 and adding an internal
  DTD containing several entities, elements and attributes? I could not
  find any examples showing how to do this. :-(

Any hints are highly welcome!

Harry

--

1024D/40F14012 18F3 736A 4080 303C E61E  2E72 7E05 1F6E 40F1 4012

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GIT/S dx s: a C++ ULS++++$ P+++ L+++$ !E W++ N+ o? K? !w !O !M
V PS+ PE Y? PGP+++ t+ 5-- X+ R+ !tv b++ DI++ D+ G e* h r++ y++
------END GEEK CODE BLOCK------

Attachment: pgpfuntjugLW3.pgp
Description: PGP signature



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