XML, DTD: how to make the order not important

后端 未结 5 433
难免孤独
难免孤独 2020-12-06 05:27

I started off using an XML file and a parser as a convenient way to store my data

I want to use DTD to check the structure of the xml files when they arrive.

5条回答
  •  天涯浪人
    2020-12-06 05:54

    If you can guess sensible upper-bound for the number of children for your element, than there is extremely dirty way how to overcome the problem. Follows the example for 0-3 children:

    
    

    Thus, you allow the element "myUnorderedElement" to have 0-3 children of any of type option1, option2 or option3.

提交回复
热议问题