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 NGTo: NULL Date: 8/2/2005 8:03:00 AM On 2 Aug 2005 03:30:50 -0700, mhuhn.de@g... wrote: >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. No XML tools I know of were really built to do what you're describing in regard to performing both generation and validation. If you can make it work at all, it's going to be a terrible kludge. | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
