[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Subject: RE: [relax-ng-comment] Mixing patterns and (empty) tags
Would something like this work for you instead of using mixed? Mike C:\Rng\Examples>cat fixed.xml <?xml version="1.0"?> <example><a>The quick </a><b/><a> brown fox </a><b/><c/><a> jumped </a><d/><a> over the lazy dog 5 times</a><d/></example> C:\Rng\Examples>cat fixed.rng <element name="example" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> <interleave> <zeroOrMore> <element name="a"> <data type="string"> <param name="pattern">[ a-zA-Z0-9]*</param> </data> </element> </zeroOrMore> <zeroOrMore> <element name="b"><empty/></element> </zeroOrMore> <zeroOrMore> <element name="c"><empty/></element> </zeroOrMore> <zeroOrMore> <element name="d"><empty/></element> </zeroOrMore> </interleave> </element> C:\Rng\Examples>java -jar c:\lib\jing.jar fixed.rng fixed.xml C:\Rng\Examples>java -jar c:\lib\msv.jar fixed.rng fixed.xml start parsing a grammar. validating fixed.xml the document is valid. C:\Rng\Examples> > -----Original Message----- > From: Michael Fitzgerald [mailto:mike@wyeast.net] > Sent: Friday, September 27, 2002 5:04 PM > To: John Cowan > Cc: Daniel Prager; relax-ng > Subject: RE: [relax-ng-comment] Mixing patterns and (empty) tags > > > Oh, er, I missed that little phrase "restricted text" and went for the > syntax error. Pardon me. -Mike > > > -----Original Message----- > > From: John Cowan [mailto:jcowan@reutershealth.com] > > Sent: Friday, September 27, 2002 10:45 AM > > To: Michael Fitzgerald > > Cc: Daniel Prager; relax-ng > > Subject: Re: [relax-ng-comment] Mixing patterns and (empty) tags > > > > > > Daniel Prager scripsit: > > > > > > How do you mix restricted text patterns with empty elements > > > > (used to represent escaped text)? > > > > The answer is that you can't: a data or list pattern has to occupy the > > whole of the element content. You can mix *unrestricted* text > with empty > > elements, of course, which is what Mike F. was doing. > > > > -- > > John Cowan jcowan@reutershealth.com > > At times of peril or dubitation, http://www.ccil.org/~cowan > > Perform swift circular ambulation, http://www.reutershealth.com > > With loud and high-pitched ululation. > > > > > ---------------------------------------------------------------- > To subscribe or unsubscribe from this elist use the subscription > manager: <http://lists.oasis-open.org/ob/adm.pl> >
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Powered by eList eXpress LLC