I
inquirydog
I am trying to store my computer network information in an xml file,
and plan to write an xml schema for the file. The general format of
the xml should be like this
<networkinfo>
<ipaddress>1.2.3.4</ipaddress>
<hostname>qwerty</hostname>
<dnsserver>7.7.7.7</dnsserver>
</networkinfo>
The xml schema for this is simple (so simple that I won't
mention it). The problem is that on some computers, the network
information should be determined by dhcp, and all of the usual
information is not needed. In these cases the xml should look like
this
<networkinfo>
<dhcp />
</networkinfo>
I don't know how to write an xml schema that requires either n
elements (ie- ipaddress, hostname, and dnsserver), or a single
different element (ie- dhcp). I could bin the n elements in another,
and then use xsd:choice, although it seems a waste to add another tag
for this reason only.
I thank anyone in advance for suggestions.
thank
-I
ps- extra credit if you can extend this to describe an arbitrary
number of ethernet cards (eth0 ipaddress, eth1 ipaddress, etc.)
and plan to write an xml schema for the file. The general format of
the xml should be like this
<networkinfo>
<ipaddress>1.2.3.4</ipaddress>
<hostname>qwerty</hostname>
<dnsserver>7.7.7.7</dnsserver>
</networkinfo>
The xml schema for this is simple (so simple that I won't
mention it). The problem is that on some computers, the network
information should be determined by dhcp, and all of the usual
information is not needed. In these cases the xml should look like
this
<networkinfo>
<dhcp />
</networkinfo>
I don't know how to write an xml schema that requires either n
elements (ie- ipaddress, hostname, and dnsserver), or a single
different element (ie- dhcp). I could bin the n elements in another,
and then use xsd:choice, although it seems a waste to add another tag
for this reason only.
I thank anyone in advance for suggestions.
thank
-I
ps- extra credit if you can extend this to describe an arbitrary
number of ethernet cards (eth0 ipaddress, eth1 ipaddress, etc.)