[Home] [By Thread] [By Date] [Recent Entries]

  • From: David Lee <dlee@c...>
  • To: John Cowan <johnwcowan@g...>
  • Date: Mon, 11 Nov 2013 19:48:17 +0000

Holy krap I had no idea RNG could do this


Sent from my iPad (excuse the terseness) 
David A Lee


On Nov 11, 2013, at 1:34 PM, "John Cowan" <johnwcowan@g...> wrote:




On Sun, Nov 10, 2013 at 9:59 AM, David Lee <dlee@c...> wrote:

"For every member element with an attribute named 'name' with a value "a json name" it must have a single child
element "value" with a "type" attribute  with the value "Number" and its text contents must follow the constraints of xs:decimal

This is difficult or impossible to express in common XML schema languages

It's straightforward in RNG.  Compact syntax version:

define a-json-name = element * {
  attribute name { "a json name" },
  element value {
    attribute type { "Number"},
    xs:decimal
  }
}

It's really only DTDs and XSD 1.0 that can't cope with this sort of thing.

--
GMail doesn't have rotating .sigs, but you can see mine at http://www.ccil.org/~cowan/signatures


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member