Loading ...
Sorry, an error occurred while loading the content.

Is there anything wrong with relaxer?

Expand Messages
  • echeckline@yahoo.cn
    Hi, I am a post graduate student from institution of Computer Network and Communication in China. I have come accross some problems when using the RELAXER
    Message 1 of 2 , Jun 2, 2009
    • 0 Attachment
      Hi,
      I am a post graduate student from institution of Computer Network and Communication in China.
      I have come accross some problems when using the RELAXER tool,which has made me confused.Using RELAXER to generate classes from RELAX NG schema,the problem was that it worked successfully when the RELAX NG schema was simple,but there tended to be some bugs when the schema was a little bit complicated.And here is a examle dhcp.rng encountering bugs as well as a picture about the specific bugs seen in the attachment. Can you give me some advice on what the real problem was and how to solve this kind of problem?Thanks a lot.
      the rng file as follow

      <?xml version="1.0" encoding="utf-8"?> <grammar
      xmlns="http://relaxng.org/ns/structure/1.0"
      xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
      xmlns:dc="http://purl.org/dc/terms" xmlns:dhcp="http://example.com/ns/dhcp"
      xmlns:nma="urn:ietf:params:xml:ns:netmod:dsdl-annotations:1"
      xmlns:nmt="urn:ietf:params:xml:ns:netmod:conceptual-tree:1"
      datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
      ns="urn:ietf:params:xml:ns:netconf:base:1.0"> <rng:include
      xmlns:rng="http://relaxng.org/ns/structure/1.0" href="./relaxng-lib.rng"/>
      <start> <rng:element xmlns:rng="http://relaxng.org/ns/structure/1.0"
      name="rpc-reply"> <rng:ref name="message-id-attribute"/> <rng:element
      name="data"> <interleave>
      <optional>
      <element name="dhcp:dhcp">
      <optional>
      <element name="dhcp:max-lease-time">
      <data type="unsignedInt"/>
      </element>
      </optional>
      <optional>
      <element name="dhcp:default-lease-time">
      <data type="unsignedInt"/>
      </element>
      </optional>
      <ref name="_dhcp__subnet-list"/>
      <optional>
      <element name="dhcp:shared-networks">
      <zeroOrMore>
      <element name="dhcp:shared-network">
      <element name="dhcp:name">
      <data type="string"/>
      </element>
      <ref name="_dhcp__subnet-list"/>
      </element>
      </zeroOrMore>
      </element>
      </optional>
      <optional>
      <element name="dhcp:status">
      <zeroOrMore>
      <element name="dhcp:leases">
      <element name="dhcp:address">
      <ref name="inet-types__ip-address"/>
      </element>
      <optional>
      <element name="dhcp:starts">
      <ref name="yang-types__date-and-time"/>
      </element>
      </optional>
      <optional>
      <element name="dhcp:ends">
      <ref name="yang-types__date-and-time"/>
      </element>
      </optional>
      <optional>
      <element name="dhcp:hardware">
      <optional>
      <element name="dhcp:type">
      <choice>
      <value>ethernet</value>
      <value>token-ring</value>
      <value>fddi</value>
      </choice>
      </element>
      </optional>
      <optional>
      <element name="dhcp:address">
      <ref name="yang-types__phys-address"/>
      </element>
      </optional>
      </element>
      </optional>
      </element>
      </zeroOrMore>
      </element>
      </optional>
      </element>
      </optional>
      </interleave>
      </rng:element>
      </rng:element>
      </start>
      <define name="_dhcp__subnet-list">
      <zeroOrMore>
      <element name="dhcp:subnet">
      <element name="dhcp:net">
      <ref name="inet-types__ip-prefix"/>
      </element>
      <optional>
      <element name="dhcp:range">
      <optional>
      <element name="dhcp:dynamic-bootp">
      <empty/>
      </element>
      </optional>
      <element name="dhcp:low">
      <ref name="inet-types__ip-address"/>
      </element>
      <element name="dhcp:high">
      <ref name="inet-types__ip-address"/>
      </element>
      </element>
      </optional>
      <optional>
      <element name="dhcp:dhcp-options">
      <zeroOrMore>
      <element name="dhcp:router">
      <ref name="inet-types__host"/>
      </element>
      </zeroOrMore>
      <optional>
      <element name="dhcp:domain-name">
      <ref name="inet-types__domain-name"/>
      </element>
      </optional>
      </element>
      </optional>
      <optional>
      <element name="dhcp:max-lease-time">
      <data type="unsignedInt"/>
      </element>
      </optional>
      </element>
      </zeroOrMore>
      </define>
      <define name="inet-types__ip-prefix">
      <choice>
      <ref name="inet-types__ipv4-prefix"/>
      <ref name="inet-types__ipv6-prefix"/>
      </choice>
      </define>
      <define name="inet-types__ipv4-prefix">
      <data type="string">
      <param name="pattern">(/d)</param>
      </data>
      </define>
      <define name="inet-types__ipv6-prefix">
      <data type="string">
      <param name="pattern">(/d)</param>
      </data>
      </define>
      <define name="inet-types__ip-address">
      <choice>
      <ref name="inet-types__ipv4-address"/>
      <ref name="inet-types__ipv6-address"/>
      </choice>
      </define>
      <define name="inet-types__ipv4-address">
      <data type="string">
      <param name="pattern">(/d)</param>
      </data>
      </define>
      <define name="inet-types__ipv6-address">
      <data type="string">
      <param name="pattern">(/d)</param>
      </data>
      </define>
      <define name="inet-types__host">
      <choice>
      <ref name="inet-types__ip-address"/>
      <ref name="inet-types__domain-name"/>
      </choice>
      </define>
      <define name="inet-types__domain-name">
      <data type="string">
      <param name="pattern">(/d)</param>
      <param name="pattern">(/d)</param>
      </data>
      </define>
      <define name="yang-types__date-and-time">
      <data type="string">
      <param name="pattern">(/d).</param>
      </data>
      </define>
      <define name="yang-types__phys-address">
      <data type="string"/>
      </define>
      </grammar>
    • John Cowan
      ... I can only give a general answer, as I am not familiar with the details of RELAXER. However, data binding tools typically cannot handle the full
      Message 2 of 2 , Aug 13, 2009
      • 0 Attachment
        echeckline@... scripsit:

        > I have come accross some problems when using the RELAXER tool, which
        > has made me confused. Using RELAXER to generate classes from RELAX NG
        > schema, the problem was that it worked successfully when the RELAX NG
        > schema was simple, but there tended to be some bugs when the schema was
        > a little bit complicated. And here is a examle dhcp.rng encountering bugs
        > as well as a picture about the specific bugs seen in the attachment. Can
        > you give me some advice on what the real problem was and how to solve
        > this kind of problem? Thanks a lot.

        I can only give a general answer, as I am not familiar with the details
        of RELAXER. However, data binding tools typically cannot handle the
        full complexity of RELAX NG. In particular, when multiple parses are
        possible, the tools can't cope.

        --
        John Cowan cowan@... http://www.ccil.org/~cowan
        Historians aren't constantly confronted with people who carry on
        self-confidently about the rule against adultery in the sixth amendment to
        the Declamation of Independence, as written by Benjamin Hamilton. Computer
        scientists aren't always having to correct people who make bold assertions
        about the value of Objectivist Programming, as examplified in the HCNL
        entities stored in Relaxational Databases. --Mark Liberman
      Your message has been successfully submitted and would be delivered to recipients shortly.