[relaxng-user] Relax NG schema to match entity-reference ints?

David Carlisle davidc at nag.co.uk
Mon Feb 2 13:51:54 ICT 2004


  that contain entity-reference integers as attribute values, e.g.
  the value of the 'output' attribute in
  <key code="0" output="&#xE719;" />

After the XML parse that character (not entity) reference will be
indistinguishable from the character referenced.

So, you can't use an integer based constraint, but if your validator
supports regexp constraints (eg if it includes xsd:string and its pattern
facets) then you could use a regexp  to constrain them.
The constraint that you gave as an example (less than 10FFFF) isn't
required as if the input uses the & # syntax with a number bigger than
that it would not  be well formed XML.

or of course you can change your instances to match your description

  In general, the value of the output attribute can be a list of
  integers with values ranging from 0x1 to 0x10FFFF inclusive.

in which case you don't want the & # ; syntax, just


<key code="0" output="59161" />

David

-- 
http://www.dcarlisle.demon.co.uk/matthew

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________


More information about the relaxng-user mailing list