Devrim E. wrote:
we are trying to use xinclude in our Docbook 5 documentation. This
general works great. Now we tried to use the element() scheme to include
all child elements (sections) of a chapter from another file. The
chapter looks like:
<chapterxml:id="ModelsAndConfiguration">
<title>Models and Configuration</title>
<section>
<title>General Models</title>
In our master docbook file, we would like to include all the child sections of
the chapter, we did the following:
select the reference
untransclude reference
changed the xpointer attribute to element(/ModelsAndConfiguration/*),
retransclude reference
There is a more convenient and also much safer way to do this:
1) Check option "Allow advanced use of XInclude" in Options|Preferences,
Edit section
More info about this option in
http://www.xmlmind.com/xmleditor/_distrib/doc/help/editOptions.html#allowAdvancedXInclude
2) Select all the child elements of the source chapter.
3) Press Ctrl+Shift-C, which is Edit|Reference|Copy as Reference.
4) Select all the child elements of the (generally empty) chapter which
is the target of the inclusion.
5) Press Ctrl-V (Edit|Paste).
we see the error message:
Inclusion Error
*
file:/C:/Home/RTD/Fabrika/_RTDynamics.trunk/VRF/Src/Doc/UG/VRF%20Plugin%20Users%20Guide.xml:::
cannot parse inclusion directive: cannot parse XPointer
"element(/ModelsAndConfiguration/*)": "/ModelsAndConfiguration/*",
XPointer element() scheme syntax error
element(/ModelsAndConfiguration) and element(/ModelsAndConfiguration/1) seems
to work, but element(/ModelsAndConfiguration/*) doesn't seem to work. Any idead
how we can get this working?
The element() scheme syntax error reported by XXE is 100% correct. The
element() scheme does not support something like
element(/ModelsAndConfiguration/*)
If I use the safer way described above, XXE automatically generates for me:
---
<xi:include href="WHATEVER_HREF_HERE"
xpointer="xpointer(id('ModelsAndConfiguration')/node())"/>
---
Notice how XXE has automatically switched from the element() scheme to
the xpointer() scheme.
Reference:
See http://www.w3.org/TR/xinclude/
See http://www.w3.org/TR/xptr-element/
See http://www.w3.org/TR/xptr-framework/
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support