Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - 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: 7/30/2005 9:35:00 PM I don't get it. If the exact content is predetermined, what information does the document convey? If a large section of a document must be boilerplate for content from a specific source, why not make a schema and documents such that the boilerplate content is excluded, then use XSLT to insert the boilerplate content after the initial validation is done? Finally, if inserting the content fixed later is not an option, you could use a combination of XML Schema and Schematron since Schematron makes it easy to validate data content. In the case below, you just first assert that, in the context of "/colors", "color[1]='green' and color[2]='red'" On 22 Jul 2005 09:24:41 -0700, mhuhn.de@g... wrote: >I am using XML Schema for quite a while but haven't written a single >line of Relax NG yet. > >For what I know, I cannot define static content within an XML Schema. >For example, I have the following structure: > ><colors> > <color>green</color> > <color>red</color> ></colors> > >With XML-Schema, I can say colors should have to elements of type >color, and color can contain "green" or "red". But I cannot say that >the content has to be exactly as posted above. Is this correct? > >Is there a way to do this in Relax NG? > >I need it for more levels than just one. I want to be able to define a >whole XML-Document within the "Schema", so only a document with exactly >that content will be valid. | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
