K
keksforscher
Hello,
consider the following DTD and XML:
<?xml version="1.0" encoding="UTF-8"?>
<!--DTD generated by XMLSpy v2007 (http://www.altova.com)-->
<!ELEMENT root ((name, city))>
<!ELEMENT name (#PCDATA)>
<!ELEMENT city (#PCDATA)>
<!DOCTYPE root SYSTEM "d:\1.dtd">
<root>
<name>qw</name>
<city>qw</city>
</root>
Problem is that the tags name and city alsways have to be in the XML
in the order defined in the DTD. The following XML would be invalid:
<!DOCTYPE root SYSTEM "d:\1.dtd">
<root>
<city>qw</city>
<name>qw</name>
</root>
I could change the DTD of course to:
<?xml version="1.0" encoding="UTF-8"?>
<!--DTD generated by XMLSpy v2007 (http://www.altova.com)-->
<!ELEMENT root ((name | city))>
<!ELEMENT name (#PCDATA)>
<!ELEMENT city (#PCDATA)>
Now the tags could inserted in the xml in any order but because of the
OR the tags could be omitted at all..
Ich möchte aber, daß die beiden Tags Pflicht sind aber deren
Reihenfolge mir egal ist.
How could this be solved?
Thanks
Stefan
consider the following DTD and XML:
<?xml version="1.0" encoding="UTF-8"?>
<!--DTD generated by XMLSpy v2007 (http://www.altova.com)-->
<!ELEMENT root ((name, city))>
<!ELEMENT name (#PCDATA)>
<!ELEMENT city (#PCDATA)>
<!DOCTYPE root SYSTEM "d:\1.dtd">
<root>
<name>qw</name>
<city>qw</city>
</root>
Problem is that the tags name and city alsways have to be in the XML
in the order defined in the DTD. The following XML would be invalid:
<!DOCTYPE root SYSTEM "d:\1.dtd">
<root>
<city>qw</city>
<name>qw</name>
</root>
I could change the DTD of course to:
<?xml version="1.0" encoding="UTF-8"?>
<!--DTD generated by XMLSpy v2007 (http://www.altova.com)-->
<!ELEMENT root ((name | city))>
<!ELEMENT name (#PCDATA)>
<!ELEMENT city (#PCDATA)>
Now the tags could inserted in the xml in any order but because of the
OR the tags could be omitted at all..
Ich möchte aber, daß die beiden Tags Pflicht sind aber deren
Reihenfolge mir egal ist.
How could this be solved?
Thanks
Stefan