Q. Как выразить xsd:any c помощью RelaxNG?
Как с помощью RelaxNG выразить следующую конструкцию
<xsd:any processContents="skip" maxOccurs="unbounded"/>
Т.е. имеется схема, необходимо перевести ее в RelaxNG
<xsd:complexType name="extensionType" mixed="true">
<xsd:annotation>
<xsd:documentation>
use for local extensions or
for extensions from other XML schemas
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:any processContents="skip"
maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
A [flax].
Tom Gaven замечает
AFAIK, RNG doesn't have an 'any' pattern, which might make your expression
simpler, but why clutter up the syntax? It's perfect as is!
The code might be:
...
| element extension { anyElementOrText }
| recordInfo)+
anyElementOrText = element * { attribute * { text } | text | anyElementOrText }*