Subject: [netmod] DSDL translation of datatypes

From: Ladislav Lhotka <[email-masked]>
Date: Wed, 06 Aug 2008 10:37:31 +0200

Hi,

I propose to include DSDL translation of standard datatype modules in
the "datatypes" draft using the compact syntax. This means that each
module will be first translated with pyang, e.g.,

pyang -f dsdl -o ieee-types.rng ieee-types.yang

and then converted to the compact syntax using trang:

java -jar trang.jar -I rng -O rnc ieee-types.rng ieee-types.rnc

The result is shown below. Please have a look and tell me your opinion.

The only thing that potentially has to be hand-edited are long lines -
for example, long regexp patterns can be broken into the same chunks as
in the original YANG module, just using the compact syntax concatenation
operator '~'.

Also note that the current release 0.9.1 of pyang will prefix all names
of RELAX NG named patterns with double underscore '__'. In order to get
the output below, checkout the head revision from the SVN repository
(see http://code.google.com/p/pyang/source/checkout), or wait till the
next release.

Lada

============================= ieee-types.rnc===========================
namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0"
namespace dc = "http://purl.org/dc/terms"
namespace dsrl = "http://purl.oclc.org/dsdl/dsrl"
namespace nm = "urn:ietf:params:xml:ns:netmod:dsdl-attrib:1"
namespace sch = "http://purl.oclc.org/dsdl/schematron"

dc:creator [ "YANG Language Design Team" ]
dc:description [
  "This module contains standard derived YANG types\x{a}" ~
  "for IEEE 802 addresses and related things."
]
dc:issued [ "2008-05-22" ]
dc:source [ "YANG module 'ieee-types' (automatic translation)" ]
dc:contributor [
  "Juergen Schoenwaelder (Editor)\x{a}" ~
  "<[email-masked]>"
]

## The mac-address type represents an 802 MAC address
## represented in the `canonical' order defined by
## IEEE 802.1a, i.e., as if it were transmitted least
## significant bit first, even though 802.5 (in contrast
## to other 802.x protocols) requires MAC addresses to
## be transmitted most significant bit first.

## See: RFC 2579 STD 58
mac-address = yang-types__phys-address
yang-types__phys-address = xsd:string

## The bridgeid type represents identifers that uniquely
## identify a bridge.  Its first four hexadecimal digits
## contain a priority value followed by a colon. The
## remaining characters contain the MAC address used to
## refer to a bridge in a unique fashion (typically, the
## numerically smallest MAC address of all ports on the
## bridge).

## See: RFC 4188
bridgeid =
  xsd:string {
    pattern = "[0-9a-fA-F]{4}:([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}"
  }

## The vlanid type uniquely identifies a VLAN. This is
## the 12-bit VLAN-ID used in the VLAN Tag header. The
## range is defined by the referenced specification.

## See: IEEE Std 802.1Q 2003 Edition, Virtual Bridged Local
## Area Networks.
vlanid = xsd:unsignedShort { minInclusive = "1" maxInclusive = "4094" }

-- 
Ladislav Lhotka, CESNET
PGP Key ID: E74E8C0C

_______________________________________________
netmod mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/netmod

---

From: Andy Bierman <[email-masked]>
Date: Wed, 06 Aug 2008 08:10:17 -0700

Ladislav Lhotka wrote:
>....

IMO, the DSDL syntax is not an improvement over XSD.
Here is the XSD that yangdump generates for the same file:

    http://www.netconfcentral.com/xsd/ieee-types_2008-05-22.xsd

I am not convinced that XSD is dead and this is the future instead.
I see plenty of I-Ds and RFCs published with XSDs in them,
and doubt this practice will stop.

Andy

---

From: Ladislav Lhotka <[email-masked]>
Date: Wed, 06 Aug 2008 17:29:54 +0200

> IMO, the DSDL syntax is not an improvement over XSD.

DSDL is in the charter whereas XSD is not. Moreover, I find the compact
syntax easier to read and understand than XML.

> I am not convinced that XSD is dead and this is the future instead.

Most people that really work with XML think it is the case, see, e.g.,
Tim Bray's tutorial he gave during IETF 70. Even groups in W3C that
eventually publish XSD schemas use RELAX NG for the development and then
translate the result with trang.

> and doubt this practice will stop.

Yes, there is still a lot of sentiment for XSD in IETF. I find it
unfortunate. James Clark presented the arguments in favor of using RELAX
NG in IETF already in 2002:

http://www.imc.org/ietf-xml-use/mail-archive/msg00217.html

Lada

-- 
Ladislav Lhotka, CESNET
PGP Key ID: E74E8C0C

---

From: Balazs Lengyel <[email-masked]>
Date: Wed, 06 Aug 2008 18:31:11 +0200

Support the idea.
I hope the inmaturity of pyang will not delay the types work.
Balazs

-- 
Balazs Lengyel                       Ericsson Hungary Ltd.
TSP System Manager
ECN: 831 7320                        Fax: +36 1 4377792
Tel: +36-1-437-7320     email: [email-masked]
_______________________________________________
netmod mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/netmod