W3C home > Mailing lists > Public > xproc-dev@w3.org > November 2008

Re: Configuration options

From: Norman Walsh <ndw@nwalsh.com>
Date: Tue, 11 Nov 2008 08:09:49 -0500
To: XProc Dev <xproc-dev@w3.org>
Message-ID: <m2myg6wgrm.fsf@nwalsh.com>
"James Fuller" <james.fuller.2007@gmail.com> writes:
> so now all we have to do is figure out who does the schema... nudge
> nudge, hint ;)

Heh. Here's a first stab. I'm thinking of implementing this with the
following semantics:

1. It's a configuration file if the local-name of the root element is
"xproc-config". This way, users can choose an
implementation-appropriate default namespace if they want, but my
implementation will still look inside it.

2. My implementation will attempt to process any element in either
no-namespace or my namespace. If several implementations agree on the
name of a particular configuration property, then we can share the
same definition if it's in no-namespace. If it's in a namespace, but
not in my namespace, I just ignore it.

Here's a first pass at the schema:

default namespace local = ""
namespace cc = "http://com.xmlcalabash/ns/configuration"

xmlid.attr = attribute xml:id { xsd:ID }
xmlbase.attr = attribute xml:base { xsd:anyURI }

common.attributes = xmlid.attr?, xmlbase.attr?, extension.attr*

# ============================================================

start = XProcConfiguration

# ============================================================

XProcConfiguration =
   element xproc-config {
      common.attributes,
      (NotCC|CCConfig)*
   }

NotCC =
   element (* - cc:*) {
      (_any.attr | text | Any)*
   }

CCConfig =
   CCSchema | CCBinding | CCDebug | CCEntityResolver
 | CCInput | CCLogLevel | CCLibrary | CCOutput | CCWithParam
 | CCSafe | SSStepName | CCURIResolver | CCImplementation

CCSchema =
   element cc:schema-aware {
      common.attributes,
      xsd:boolean
   }
   
CCBinding =
   element cc:namespace-binding {
      common.attributes,
      attribute prefix { text },
      attribute uri { xsd:anyURI },
      empty
   }

CCDebug =
   element cc:debug {
      common.attributes,
      xsd:boolean
   }

CCEntityResolver =
   element cc:entity-resolver {
      common.attributes,
      attribute class-name { xsd:NMTOKEN },
      empty
   }

CCInput =
   element cc:input {
      common.attributes,
      attribute port { xsd:NMTOKEN },
      attribute href { xsd:anyURI }?,
      Any?
   }

CCLogLevel =
   element cc:log-level {
      common.attributes,
      attribute logger { xsd:NMTOKEN }?,
      attribute level {
         "finest" | "finer" | "fine" | "info"
       | "warning" | "error" | "severe"
      },
      empty
   }

CCLibrary =
   element cc:library {
      common.attributes,
      attribute href { xsd:anyURI }?,
      Any?
   }

CCOutput =
   element cc:output {
      common.attributes,
      attribute port { xsd:NMTOKEN },
      attribute href { xsd:anyURI },
      empty
   }

CCWithParam =
   element cc:with-param {
      common.attributes,
      attribute name { xsd:QName },
      attribute value { text }?
   }

CCSafe =
   element cc:safe-mode {
      common.attributes,
      xsd:boolean
   }

SSStepName =
   element cc:step-name {
      common.attributes,
      xsd:NMTOKEN
   }

CCURIResolver =
   element cc:uri-resolver {
      common.attributes,
      attribute class-name { xsd:NMTOKEN },
      empty
   }

CCImplementation =
   element cc:implementation {
      common.attributes,
      attribute step-name { xsd:QName },
      attribute class-name { xsd:NMTOKEN },
      empty
   }

# ============================================================

_any.attr =
   attribute * { text }

extension.attr =
   attribute (* - (local:*|xml:*)) { text }

Any =
   element * {
      (_any.attr | text | Any)*
   }


                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com> | No man's knowledge here can go beyond
http://nwalsh.com/            | his experience.--John Locke

Received on Tuesday, 11 November 2008 13:10:31 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 November 2008 13:10:31 GMT