At 2007-01-05 15:26 +0000, antonin_karolik wrote:
>Does anybody know how can I use just one element with arbitrary
>content (with atbitrary sequence of other elements).
I usually create a pattern that I name "any" that allows any element
with any attributes mixed with text and use that.
Note the running example below where I modify your instance to first
be invalid, validate it with errors, then in another window I edit it
to be valid, then validate it without errors.
I hope this helps.
. . . . . . . . Ken
T:\ftemp>type antonin.rnc
start = element root { important_element, unimportant_element }
important_element = element important_element { text }
unimportant_element = any
any = ( element * { attribute * { text }*, any } | text )*
T:\ftemp>type antonin.xml
<root>
<important_element>important <rich/> data</important_element>
<unimportant_element>
unimportant <rich/> XML <structrure/>
</unimportant_element>
</root>
T:\ftemp>rnc antonin.rnc antonin.xml
T:\ftemp\antonin.xml:2: error: element "rich" not allowed in this context
T:\ftemp>type antonin.xml
<root>
<important_element>important data</important_element>
<unimportant_element>
unimportant <rich/> XML <structrure/>
</unimportant_element>
</root>
T:\ftemp>rnc antonin.rnc antonin.xml
T:\ftemp>
--
World-wide corporate, govt. & user group XML, XSL and UBL training
RSS feeds: publicly-available developer resources and training
G. Ken Holman mailto:[EMAIL PROTECTED]
Crane Softwrights Ltd. http://www.CraneSoftwrights.com/r/
Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
Male Cancer Awareness Aug'05 http://www.CraneSoftwrights.com/r/bc
Legal business disclaimers: http://www.CraneSoftwrights.com/legal