xml extension type and user defined
I've a xml document that according to its schema definition for a certain node "level" only allows a predefined list of values (aka enumeration if not wrong). This predefined values are ok for a country, but if we change country the values might change.
For this the "level" node allows ( and here starts my doubts) attribute "userDefined" and sub nodes such as <extension>
and I believe is through this <extension>
node or maybe userdefined attr that I will be able to specify other value and thus get the doc validated.
The xsd file is here: http://utdanning.no/schemas/CDM/2.1/CDM.xsd and the xml sample file here
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<CDM xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://utdanning.no/schemas/CDM/2.1/CDM.xsd">
<orgUnit>
<orgUnitID>217</orgUnitID>
<orgUnitName>Contoso Inc [TEST PURPOSES ONLY]</orgUnitName>
<webLink>
<href>http://www.google.com</href>
</webLink>
开发者_运维知识库 <course>
<courseID>341</courseID>
<courseCode>FWTEST2222222</courseCode>
<courseName>Another field course test imported</courseName>
<courseDescription>Testing purposes only test teste teste</courseDescription>
<level level="other_value"/><!--This is where i want to add a diff value other than the allowed list: vgs, folkehogskole, bachelor, master, phd, fagskole, evu, aarsstudium -->
<credits ECTScredits="45"/>
<admissionInfo/>
<teachingPlace>
<adr>
<country>NORWAY</country>
</adr>
</teachingPlace>
<formOfTeaching>Field course</formOfTeaching>
<instructionLanguage>Norske</instructionLanguage>
</course>
</orgUnit>
</CDM>
This schema does not allow arbitrary values in the "level" attribute. There is no way to extend the set of valid values.
精彩评论