Go Back   Velocity Reviews > Newsgroups > XML
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

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

 
Thread Tools Search this Thread
Old 02-05-2007, 09:02 PM   #1
Default RELAX NG: emulating XSD <any> wildcard with processContents="lax"?


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.



jiffers
  Reply With Quote
Old 02-05-2007, 10:39 PM   #2
jiffers
 
Posts: n/a
Default Re: RELAX NG: emulating XSD <any> wildcard with processContents="lax"?

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?

  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump