[Nml-wg] XML syntax for NML relations

Roman Łapacz romradz at man.poznan.pl
Tue Aug 16 06:36:29 CDT 2011


W dniu 2011-08-16 12:09, Freek Dijkstra pisze:
> Hi,

Hi Freek,

> I've been thinking about the relation syntax.
>
> So far, we have seen these two proposals:
>
>    <nml:link id="urn:ogf:network:example.net:link_A-to-C">
>      <nml:relation type="serialcompound">
>         ...
>      </nmlserialcompound:relation>
>    </nml:link>
>
> and:
>
>    <nml:link id="urn:ogf:network:example.net:link_A-to-C">
>      <nmlserialcompound:relation>
>         ...
>      </nmlserialcompound:relation>
>    </nml:link>
>
> The advantage of the first syntax is that it is very easily extendable,
> and it is still obvious for a parser to understand that it is some kind
> of nml:relation, even if the particular type of relation is not known by
> the parser.
>
> The advantage of the second syntax is that it is easy to create a
> meaningful validator for each specific nml:relation.
>
>
> I dislike both syntaxes, and was hoping for a syntax that would provide
> both benefits.
>
> If I'm correct, the following syntax will do just that:
>
>    <nml:link id="urn:ogf:network:example.net:link_A-to-C">
>      <nml:relations>
>        <nmlserialcompound:relation>
>           ...
>        </nmlserialcompound:relation>
>      </nml:relations>
>    </nml:link>
>
> This adds a parent element to the relation elements, signifying that
> <nmlserialcompound:relation>  is indeed a nml:relation. So even a parser
> that has no knowledge about this particular nml:relation still knows
> it's base syntax, while a parser that understands the details can still
> use an meaningful syntax validator (such as XSD) to make sure the syntax
> is correct.

The solution with namespaces gives you that (nmlserialcompound:relation 
inherits from the base nml:relation). nml:relations only complicates the 
xml structure without giving too much.


Cheers,
Roman

> Would this do, and is this syntax acceptable to all?
>
> Regards,
> Freek
> _______________________________________________
> nml-wg mailing list
> nml-wg at ogf.org
> http://www.ogf.org/mailman/listinfo/nml-wg



More information about the nml-wg mailing list