OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

relax-ng message

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


Subject: Re: [relax-ng] Updated resources on the RELAX NG pages




--On 07 December 2001 04:57 -0600 Michael Smith <smith@xml-doc.org> wrote:

> But maybe the non-XML syntax example[1] for RELAX NG should be
> updated. It seems like it's out of sync with the RELAX NG XML schema
> in appendix A of the current spec, and it doesn't actually fully
> express some of the named-pattern layers in the XML version in the
> spec -- for example, there's no "combine-att" pattern in the non-XML
> syntax version, only the pattern for the <combine> element itself.

It's intended to be equivalent (i.e. allows exactly the same set of 
documents) rather than identical.  The usage of named patterns is designed 
to optimize readability of the non-XML syntax.  The way to express things 
that most readable in the non-XML syntax doesn't necessarily correspond to 
what's most readable in the XML syntax.

However, the non-XML syntax does actually need updating: the ns attribute 
should be a string rather than xsd:anyURI.

> And FWIW, I think people will find it cumbersome to always have to
> refer to the syntax as "non-XML syntax for RELAX NG" to be clear what
> they mean. If it were to be given some arbitrary shorter name -- "NX
> syntax" or whatever -- it sure would make it a lot easier to refer to.

Yeah, it's a pretty lame name, especially since it is possible for there to 
be other XML syntaxes.

> One more thing: I realize annotations can't be represented using the
> non-XML syntax, but is there any way the Rngnx conversion tool could
> support some kind of extra processing step that would let you specify
> attribute defaults in a separate file or something, and have them
> automatically added to the generated RELAX NG XML schema -- instead of
> needing to manually add them to the schema after it's generated?

I want to extend the syntax to support at least some annotations.  My 
current plan is to allow something like:

namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"

element foo {
  attribute bar [ a:defaultValue = "whatever" ] { text }
}

Supporting annotation elements is harder.  I've considered:

namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"

element foo {
  foreign a:documentation [ xml:lang = "en" ] { "Represents foo" },
  empty
}

and

namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"

element foo {
  ## <a:documentation xml:lang="en">
  ## Represents foo.
  ## </a:documentation>
  empty
}


Another possibility is to make a special syntax for a:documentation.

James





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


Powered by eList eXpress LLC