RELAX NG: emulating XSD <any> wildcard with processContents="lax"?

J

jiffers

I'm trying to figure out how to define an element in RNC so that its
contents are validated if a definition matches, othewise no validation
is done.

The example given in the tutorial seems to indicate that you need to
exclude by enumeration all defined attributes and elements:

#this validates all attributes loosely, except for the defined
xml:space attribute
element example {
attribute * - xml:space { text }*,
attribute xml:space { "default" | "preserve" }?
}

What I would like to do is:
element example {
attribute * - xml:* {text}*,
attribute xml:*
}

But this won't parse.
 
J

jiffers

namespace foo = "http://www.w3.org/1999/xhtml"

anyOtherElement =
element * - foo:* { #any element names not in this namespace
attribute * { text }*,
(text
| anyElement)*
}

anyElement = {
anyOtherElement*
& element foo:* #any element names in this
namespace
}

The problem is that the last line is trying to validate against
element names in the namespace, not grammar definitions in the
namespace. How do you refer to all top-level grammars in the schema
without enumerating them? Can you?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top