Re: [PHP-XML-DEV] Relax NG tricky issue ...
[email protected] (Christian Stocker) Wed, 03 Nov 2004 15:21:25 +0100
| Newsgroups | php.xml.dev |
|---|---|
| Message-ID | <[email protected]> |
Hi Here you'll find the right list for such questions: http://relaxng.org/#mailing-lists ,) chregu On 3.11.2004 9:22 Uhr, Mezzophanti wrote: > Okies, > > Always one to try and push specs beyond their possibilities - I've bumped up > against another nasty. > > *Apologies if this is the wrong forum - redirect me with prejudice as > required* > > I love Relax NG's ambiguity and some of the things this allows - expecially > relating to context-sensitive data modeling. > > Such as having: > > <attribute name="length"><value>1</value></attribute> > <data type="string"><param name="maxLength">1</param></data> > > as a group within a series of such groups (with the numbers changing to 2,3 > and so on to whatever) > > This allows the maxLength facet to be preset according to whatever value the > xml document records for the attribute: > > <myelement length="3">abc</myelement> would therefore validate, whereas: > <myelement length="3">abcD</myelement> would not (because it has four > characters) > > Now ... using this value-based method of context-sensitivity is fine when > you know how many value aspects there are (for example if length can be > between 1 and 20 inclusive) Buuuuut - not if the number is indeterminant OR > if the number is excessively large. > > Is there ANY other method around this that brains out there know of? > > Such as: > > <attribute name="length"><value>X</value></attribute> > <data type="string"><param name="maxLength">X</param></data> > > where X (or whatever syntax we use to reference it) is AUTOMATICALLY set to > be the same in each position. > > This way, we are basically using only 2 lines to say that WHATEVER value is > given to a length attribute will automatically set that attribute's element > maxLength to THAT value. > > Clear? > > Does the compact syntax have an ability to forward reference like this? > > Thoughts? Ideas? :) > > Any and all thoughts welcome ... > > Mezzophanti > -- christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich phone +41 1 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71 http://www.bitflux.ch | [email protected] | gnupg-keyid 0x5CE1DECB