Factoring out a name-class declaration in RNG
This should cover W3C XML Schema, Relax NG and DTD related problems.
Factoring out a name-class declaration in RNG
Hi all,
In my big RNG project that contains many files, I repeatedly use a particular name-class in various places throughout the project. (It's the name class of all names that are not in any of the namespaces used by my project, i.e. the foreign name class with respect to my project's namespaces.)
<anyName>
<except>
<nsName ns="http://myproject.org/ns1/"/>
<nsName ns="http://myproject.org/ns2/"/>
<nsName ns="http://myproject.org/ns3/"/>
</except>
</anyName>
Because it's used in lots of places, I'd like to factor the name-class declaration out into a separate file and reference in the locations where it appears in my files, so if my namespaces change, I can manage them in one place.
The problem is, in RNG a name-class is not a pattern. So to factor it out into an <externalRef> does not seem to be possible, since <externalRef/> requires the contents of the referenced file to be a valid pattern.
Nor can I seem to use <include> to insert a reference to this fragment, because a name-class can't be the immediate child of a <define> or <grammar> element, for the same reason as above.
So in RNG, does anybody know a good way to factor out name-class declarations into a separate file and reference them as externals in some way?
John
In my big RNG project that contains many files, I repeatedly use a particular name-class in various places throughout the project. (It's the name class of all names that are not in any of the namespaces used by my project, i.e. the foreign name class with respect to my project's namespaces.)
<anyName>
<except>
<nsName ns="http://myproject.org/ns1/"/>
<nsName ns="http://myproject.org/ns2/"/>
<nsName ns="http://myproject.org/ns3/"/>
</except>
</anyName>
Because it's used in lots of places, I'd like to factor the name-class declaration out into a separate file and reference in the locations where it appears in my files, so if my namespaces change, I can manage them in one place.
The problem is, in RNG a name-class is not a pattern. So to factor it out into an <externalRef> does not seem to be possible, since <externalRef/> requires the contents of the referenced file to be a valid pattern.
Nor can I seem to use <include> to insert a reference to this fragment, because a name-class can't be the immediate child of a <define> or <grammar> element, for the same reason as above.
So in RNG, does anybody know a good way to factor out name-class declarations into a separate file and reference them as externals in some way?
John
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Factoring out a name-class declaration in RNG
Yes, Sorin. Thanks.
It's an interesting problem. The alternative of using xi:include works fine (and I'm grateful for the XInclude support in oXygen!), but the bigger issue of whether name classes should be patterns in RNG is presently an open question, it seems.
John
It's an interesting problem. The alternative of using xi:include works fine (and I'm grateful for the XInclude support in oXygen!), but the bigger issue of whether name classes should be patterns in RNG is presently an open question, it seems.
John
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