AnIML / schemas

AnIML XML schemas
17 stars 10 forks source link

EmbeddedXML and SVG seem to have wrong content model #14

Open laeubi opened 5 months ago

laeubi commented 5 months ago

EmbeddedXML and SVG are currently defined as String simple types that mean their content model is an XML encoded String (that afterwards might form an XML again or an SVG...)

That means that a Parameter for example that is of type EmbeddedXML wil not contain XML elements like

<my attr1="abc">
    <custom>content</custom>
</my>

Will result in something like this (if not using CDATA ...):

&lt;my attr1=&quot;abc&quot;&gt;
    &lt;custom&gt;content&lt;/custom&gt;
&lt;/my&gt;

But as it is just a string even invalid XML will be validated as correct.

Instead I think these types must use the XML Representation of Wildcard Schema Components and therefore it should map to:

That way the XML processor has at least basic chance to validate the content given with these models.

If backward compatibility is a concern, one might define two new possible types:

  1. XML
  2. SVGDocument

a maybe more smart way would be to let EmbeddedXML be without a type what will result it to be an ur-type:

that mean it can contain anything including text content....