define combine="interleave"
This should cover W3C XML Schema, Relax NG and DTD related problems.
-
- Posts: 17
- Joined: Wed Oct 28, 2009 8:35 pm
define combine="interleave"
I think there might be a problem with RelaxNG's combine="interleave" pattern in Oxygen.
I defined a "common" schema that contains element definitions used both in schemas "A" and "B". For schema B, I need to redefine a pattern called "narrow-inclusion" (already defined in "common") by allowing the occurrence of three new elements, but XML documents ONLY allow for those three new elements (as if I had replaced the definition, instead of combining by interleave. Below is an example:
In the "common" schema I did the following:
And in "B" I redefined "narrow-inclusion" and defined new elements C and D below include (not copied here):
But XML documents that use B as a schema only allow for C and D. Any help will be greatly appreciated.
Cheers,
Mariana
I defined a "common" schema that contains element definitions used both in schemas "A" and "B". For schema B, I need to redefine a pattern called "narrow-inclusion" (already defined in "common") by allowing the occurrence of three new elements, but XML documents ONLY allow for those three new elements (as if I had replaced the definition, instead of combining by interleave. Below is an example:
In the "common" schema I did the following:
Code: Select all
<define name="narrow-inclusion">
<zeroOrMore>
<choice>
<ref name="A-element"></ref>
<ref name="B-element"></ref>
</choice>
</zeroOrMore>
</define>
Code: Select all
<include href="common.rng">
<define name="narrow-inclusion">
<zeroOrMore>
<choice>
<ref name="C-element"></ref>
<ref name="D-element"></ref>
</choice>
</zeroOrMore>
</define>
</include>
Cheers,
Mariana
-
- Posts: 17
- Joined: Wed Oct 28, 2009 8:35 pm
Re: define combine="interleave"
My apologies, the second example should read:
Thanks!
Mariana
Code: Select all
<include href="common.rng">
<define name="narrow-inclusion" [b]combine="interleave"[/b]>
<zeroOrMore>
<choice>
<ref name="C-element"></ref>
<ref name="D-element"></ref>
</choice>
</zeroOrMore>
</define>
</include>
Mariana
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Re: define combine="interleave"
When you overwrite a pattern inside an include then the old pattern is removed. See
http://relaxng.org/spec-20011203.html#IDAG3YR
Best Regards,
George
http://relaxng.org/spec-20011203.html#IDAG3YR
You should place the combine pattern as a sibling of the include element, not as a child. Thus you will get both patterns in your grammar.If the include element has a define component, then the grammar element must have a define component with the same name. For every define component of the include element, all define components with the same name are removed from the grammar element.
Best Regards,
George
George Cristian Bina
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service