A concise regex based expression which looks more arcane then perl ? Or a bloated-down heavy-handed overly designed complicated language in XML which if your lucky GUI app tools can comprehend but no mortals. ---------------------------------------- David A. Lee From: Kurt Cagle [mailto:kurt.cagle@gmail.com] alternatives would be indicated via the pipe character: "|" ISBNSet ? ^ISBN + ^priceUS |^priceUK I'm trying to write this while debugging some XSD code for use in JAXB, so I apologize for the sporadic corrections. I should concentrate on my XSDs (bleeurgh).
On Fri, Dec 17, 2010 at 2:38 PM, Kurt Cagle <kurt.cagle@gmail.com> wrote: Let's try that again: &descript: string ISBN: /\d{13}/ priceUS: /\$\d+\.d{2}/ priceUK: /£\d+\.d{2}/ book @category:enumeration ? title:string author:string description:descript ? ISBNSet ? ^ISBN + ^priceUS books ^book * where /../ indicates a regular expression ? indicates an optional element + indicates 1 or more items * indicates 0 or more items ^ is a reference to a previously defined element. & is a complex type a:b indicates that element a is of type b Similar notation could handle groups Kurt Cagle On Fri, Dec 17, 2010 at 2:01 PM, Kurt Cagle <kurt.cagle@gmail.com> wrote: You can also use a shorthand notation: <book category="enumeration('children','adult','unknown') [0..1]"> <title> string() </title> <description> string() [0..1] </description> <author> string() </author> <ISBNSet> [0..1] <ISBN> numeric(8,15) [1..*] </IBSN> </IBSN> </book> <bookSet> [0..1] <book> ref [1..*] </book> </bookSet> or even use a compact notation: description:string ISBN: /\d{13}/ book @category:enumeration ? title:string author:string description:description ? ISBNSet ? ^ISBN price:decimal(4,2) (Getting close to RNC, admittedly)
On Fri, Dec 17, 2010 at 12:23 PM, Michael Kay <mike@saxonica.com> wrote: On 17/12/2010 14:33, Pete Cordell wrote:
Vaclav Trojan has a similar schema-by-annotated-example specification in the form of XDefinition:
|