← Prev in month
← Prev in thread
Re: [relax-ng] Conversion of comments between the compact and the XMLsyntax
On Wed, 2003-01-29 at 14:49, James Clark wrote:
> > I don't know if there is a real need for this or if it's purely
> > "academical" but I stumbled on this issue while presenting workarounds
> > for people who would absolutely need to annotate "value" or "param"
> > patterns and comments are one of them.
>
> I'm not sure I understand what you are trying to workaround. You can
> annotate param (or value) patterns:
>
> xsd:string {
> ## a pattern
> pattern = "xyzzy"
> }
>
> turns into:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <data type="string" xmlns="http://relaxng.org/ns/structure/1.0"
> datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
> <param name="pattern">xyzzy</param>
> <a:documentation>a pattern</a:documentation>
> </data>
>
> Do you mean you want to be able to annotate particular characters with a
> param or value? If so, why?
It seems to me that the annotation should be included in what is
described (especially if you want to extract documentation) and that if
I want to document a complex regular expression within a pattern, the
annotation should be included in the "pattern" element rather than
following it.
Using the XML syntax, since I can't write:
<param><xxx:doc>blah</xxx:doc>xyzzy</param>
I have two solutions left:
- Use a foreign attribute:
<param xxx:doc="blah">xyzzy</param>
- Use a comment:
<param><!-- blah -->xyzzy</param>
If the comment doesn't stay at the same location after a roundtrip
through the compact syntax it means that this is not a reliable
workaround.
Eric
PS: Comments are so much easier to read than annotations with the
compact syntax that it's a documentation system which deserves some
consideration with Relax NG!
--
Freelance consulting and training.
http://dyomedea.com/english/
------------------------------------------------------------------------
Eric van der Vlist http://xmlfr.org http://dyomedea.com
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------
← Prev in month
← Prev in thread