XInclude and content completion

<oXygen/> general issues.
Posts: 151
Joined: Wed Apr 20, 2005 5:43 pm
Location: Victoria, BC, Canada

XInclude and content completion

Post by martindholmes » Thu Dec 13, 2007 2:18 am

Hi there,

We're contemplating a large TEI project which would involve editors working on thousands of small files, each of which would contain ref elements linking to the xml:id attribute of other tags. Most of these other tags will be in a separate document, like this:

In doc 1:

<item xml:id="aaa">Item aaa</item>
<item xml:id="bbb">Item bbb</item>

In doc 2:

<ref target="#aaa">Link to aaa</ref>

We'd like to help the editors by enabling content completion for these values, so that when I type this in doc 2:

<ref target="

I see a drop-down list of the values in doc 1. I was hoping to accomplish this by using XInclude to include doc 1 in the header of doc 2, but it doesn't seem to work. Even if doc 1 is included in doc 2, the content completion engine still only shows me values from doc 2; it doesn't seem to parse through the XIncluded doc 1 to add its values to the list.

Is there any way I can make this work? Is it possible to have the content from doc 1 parsed by the content-completion engine without actually pulling the content into doc 2?

All help appreciated,

Posts: 7099
Joined: Fri Jul 09, 2004 5:18 pm

Post by Radu » Thu Dec 13, 2007 5:12 pm

Hi Martin,

First of all, in order for this to work you have to go to the Oxygen Preferences->XML->XML Parser page and make sure the "Enable XInclude processing" checkbox is activated.
Also Xincluding only works in the TEI P5 version.
The DTD's available in the TEI P4 version cannot be used to validate correctly a document with XIncluded sections.

The ID values are collected from the document when validating so if you change an ID value you have to re-validate the document in order to collect again all ID values.

Here are 2 sample files on which you can test this feature:


Code: Select all

<list type="bulleted" xmlns="">
<item xml:id="aaa">
<item xml:id="bbb">

Code: Select all

<?xml version="1.0" encoding="iso-8859-1"?>
<?oxygen RNGSchema="" type="xml"?>
<TEI xmlns="">
<divGen type="toc"/>
<div type="sect">
<xi:include href="list.xml" xmlns:xi=""/>
Reference to <ref target="" >Ref</ref>
In the main.xml after pressing "Validate Document" you can invoke content completion in the ref target attribute value by pressing Ctrl-Space and there you should see "aaa" and "bbb" as proposed values.

If this does not work maybe you could give us more information like some complete sample files and the version of Oxygen you are currently using.

Radu Coravu
<oXygen/> XML Editor

Post Reply