On Dec 8, 2006, at 2:39 PM, Alfred Nathaniel wrote:

Could you try to write a Relax NG schema sniplet (preferable in compact
notation) for validating your proposed syntax?

OK, I think this is it. Just a first swipe at it, I haven't tried validating anything against it, I've just run it through trang and that's all so far. Not much to it, huh? :-)

Cheers,
—ml—

sitemap-matcher-engine.rnc
===================


grammar {

    start = Match

    MatchType =
          "exact"
        | "contains"
        | "path"
        | "regexp"

    Match =
        element match {
            attribute value { text }
            & (
                Matchspec
                | Alternative +
              )
        }

    Matchspec =
        InlineMatchspec
        | Branch +

    InlineMatchspec =
        attribute MatchType { text }

    Branch =
        element MatchType { text }

    Alternative =
        element when { Matchspec }

}

=============================

Reply via email to