Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: define static content in XML-Schema / Relax NG >Thread Next - Re: define static content in XML-Schema / Relax NG Re: define static content in XML-Schema / Relax NGTo: NULL Date: 8/2/2005 3:31:00 AM It is (normally) not the whole document that is predetermined but I want the possibility to predetermine large parts of a document. Furthermore, I want to use the same mechanism (i.e. W3C XML Schema) to validate. In addition to validation I want to use this schema (or better call it template) to generate a valid XML file without further information. I use a modified version of W3C Schema now, i have an element called "template" where I can predetermine fixed parts and also include dynamic elements again. Looks like that: ... <xs:complexType name="colorsType"> <xc:template> <color>red</color> <color>blue</color> <color xs:type="colorType" xs:minOccurs="0" xs:maxOccurs="4" /> </xc:template> </xs:complexType> ... This is ok for my purpose and it works as an "XML constructor" as I provide initial values for regular pattern values for example. But I have to write my own validator which is quite a lot of work. You schematron suggestion is nice for validation but doesn't work for creation. I need it all in one file. | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
