Not everything familiar with XSD is wondering if the following can be done:
<xs:group name="SomeGroup">
<xs:sequence>
<xs:element name="Groupingcode" type="OurType" origin="DB" />
<xs:element name="Description" type="StringType" origin="XML" />
Explanation: I have an XSD schema file. I need to create an XML file according to the XSD (this part works fine) containing the database data. However, some elements need additional data to find a suitable field to retrieve from the database. The one to which the origin tag will come . This will allow me to describe in XSD where to look for data. The tag should not be present in the generated XML, but, if possible, the same XSD will be used to validate the generated XML. Another way is to use a separate XML file to describe this, I know. But I would like to know if it can be done at all in my XSD.
The above snippet generates the following XML:
<SomeGroup>
<Groupingcode>None</Groupingcode>
<Description>This item does not belong to any group.</Description>
, .