[Openstack-docs] Use of XML xi:include with xpointer

Sean Roberts seanrob at yahoo-inc.com
Tue Sep 17 05:13:19 UTC 2013


i found this example on http://wiki.docbook.org/Using%20XInclude

<xi:include href="path/to/source/file/source-docbook.xml"
             xmlns:xi="http://www.w3.org/2001/XInclude"
             xpointer="xpointer(//section[@id='IdOfTheSourceSection']/title/following-sibling::*)"/>

my version of this
    <xi:include href="../install-guide/basic-install-files/basic-install_architecture.xml"
      xpointer="xpointer(//chapter[@id='basic-install_architecture']/title/following-sibling::*)"/>

fails on build with same SEVERE: 100:40:err:XD0023:Expression could not be evaluated

David and Shaun: Should we just dump trying to use xpointer and xpath?  I'd really like to be able to include and parse content, but maybe this "working draft" isn't the way to go.

Shaun: should the training-guides just make it simple by using a solid release version of the install guide and scrape content while providing a backllink to the original?

Sean Roberts
Infrastructure Strategy
seanrob at yahoo-inc.com<mailto:seanrob at yahoo-inc.com> (925) 980-4729

On Sep 16, 2013, at 9:44 PM, Sean Roberts <seanrob at yahoo-inc.com<mailto:seanrob at yahoo-inc.com>>
 wrote:

I was able to get <xi:include href="../install-guide/basic-install-files/basic-install_architecture.xml" xpointer="xmlns(db=http://docbook.org/ns/docbook) xpath(//*[@xml:id = 'basic-install_architecture'])"> to work where the xml:id matches an xml:id in the included file.

but what I really like to do is something like
<xi:include href="../install-guide/basic-install-files/basic-install_architecture.xml" xpointer="xmlns(db=http://docbook.org/ns/docbook) xpath(//*[@xml:id = 'basic-install_architecture']/*[not(self:db:chapter)])">

where I could include content, but strip out the source path hierarchy and replace it with new.
The reasoning is to change source chapters or sections into just raw content that could be inserted into an existing section or chapter.


Sean Roberts
Infrastructure Strategy
seanrob at yahoo-inc.com<mailto:seanrob at yahoo-inc.com> (925) 980-4729

On Aug 6, 2013, at 1:37 PM, David Cramer <david.cramer at rackspace.com<mailto:david.cramer at rackspace.com>> wrote:

On 08/06/2013 02:41 PM, Sean Roberts wrote:
oxygen is complaining about pointer scheme xpath is not supported and
that a well-formed document requires a root element
maven fails with expression could not be evaluated.

<chapterxmlns="http://docbook.org/ns/docbook"
 xmlns:xi="http://www.w3.org/2001/XInclude"
 xmlns:xlink="http://www.w3.org/1999/xlink"version="5.0"
 xml:id="bk001-ch003-associate-general">
 <title>Associate General</title>
<xi:includehref="../basic-install/src/basic-install_controller-common.xml"xpointer="xmlns(db=http://docbook.org/ns/docbook)
xpath(//*[@xml:id = 'controller-os']/*[not(self::db::title)])">

Ok, change self::db::title to self::db:title (just a single colon
between the namespace prefix and the element name).

You will see that warning in Oxygen, but it's just a warning (not a
validation error). This is because Oxygen doesn't recognize the xpointer
schemes. I'll contact Oxygen to ask if they plan to add support for the
xmlns and xpath schemes.

Btw., it looks like the content you're including uses conditional
text/profiling. So you'll want to add to the configuration section of
your pom a param to indicate which profile you want (e.g. ubuntu).
Otherwise you get all conditions:

<profileOs>ubuntu</profileOs>

David

_______________________________________________
Openstack-docs mailing list
Openstack-docs at lists.openstack.org<mailto:Openstack-docs at lists.openstack.org>
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-docs

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-docs/attachments/20130917/1ed5c3eb/attachment.html>


More information about the Openstack-docs mailing list