fantasai wrote: > The second problem is the unquantifiable nature of the 'text' pattern > combined with the restriction on mixing data and elements. I can't > figure out any way to express a *non-empty* requirement in Relax NG: > > # Some elements are defined to have as a content model significant > # inline content. This means that at least one descendant of the > # element must be significant text or embedded content. > # > # Significant text, for the purposes of determining the presence > # of significant inline content, consists of any character other > # than those falling in the Unicode categories Zs, Zl, Zp, Cc, > # and Cf. [UNICODE] > > Even without the Unicode-level restrictions, I don't see any way of > requiring an element to have *some* inline content. Perhaps a > 'requiredText' pattern that didn't have 'text's implicit 'zeroOrMore' > would help here. (It would have to count white space as insufficient > text.)
And what about
element foo { token { pattern = "[^\p{Zs}\p{Zl}\p{Zp}\p{Cc}\p{Cf}]+" } }
or in case of XSD datatypes:
element foo { token { minLength = 1 } }
Jirka
--
------------------------------------------------------------------
Jirka Kosek e-mail: [EMAIL PROTECTED] http://xmlguru.cz
------------------------------------------------------------------
Professional XML consulting and training services
DocBook customization, custom XSLT/XSL-FO document processing
------------------------------------------------------------------
OASIS DocBook TC member, W3C Invited Expert, ISO/JTC1/SC34 member
------------------------------------------------------------------
Want to speak at XML Prague 2007 => http://xmlprague.cz/cfp.html
signature.asc
Description: OpenPGP digital signature
