[cxml-devel] RNG question

Cyrus Harmon ch-lisp at bobobeach.com
Tue Mar 6 17:53:53 UTC 2012


So I'm trying to parse a schema that has the following in it:

property-attach = element attach {

    element parameters {
        fmttypeparam? &
        encodingparam?
    }?,

    value-uri | value-binary
}

In order to get this to work with cxml-rng, I have to do the following:

property-attach = element attach {

    element parameters {
        fmttypeparam? &
        encodingparam?
    }?,

    ( value-uri | value-text )
}

Is the former invalid RNC or is cxml-rng's parser barfing where it shouldn't? A complete, minimal-ish example is shown below and attempting to parse it gives:

failed to parse compact syntax at char 552, file://+/Users/sly/projects/cl-vcard/foo.rnc:
  Unexpected terminal CXML-RNG::|\|| (value CXML-RNG::|\||). Expected one of: (NIL
                                                                               CXML-RNG::}
                                                                               CXML-RNG::DOCUMENTATION-LINE
                                                                               CXML-RNG::[
                                                                               :INCLUDE
                                                                               CXML-RNG::IDENTIFIER
                                                                               :START
                                                                               :DIV
                                                                               CXML-RNG::|)|
                                                                               CXML-RNG::CNAME
                                                                               CXML-RNG::|,|)
   [Condition of type CXML-RNG:RNG-ERROR]


Thanks,

Cyrus



# Hacked together from the RELAX NG Schema for iCalendar in XML

default namespace = "urn:ietf:params:xml:ns:icalendar-2.0-hack"

value-text = element text {
    xsd:string
}

value-binary =  element binary {
    xsd:string
}

value-uri = element uri {
    xsd:anyURI
}

encodingparam = element encoding {
    element text {
        "8BIT" |
        "BASE64"
    }
}

fmttypeparam = element fmttype {
    value-text
}

property-attach = element attach {

    element parameters {
        fmttypeparam? &
        encodingparam?
    }?,

    value-uri | value-text
}

start = element icalendar {
    property-attach+
}









More information about the cxml-devel mailing list