XInclude and content completion

Oxygen general issues.
martindholmes
Posts: 176
Joined: Wed Apr 20, 2005 5:43 pm
Location: Victoria, BC, Canada

XInclude and content completion

Post by martindholmes »

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:

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

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,
Martin
Radu
Posts: 8991
Joined: Fri Jul 09, 2004 5:18 pm

Post by Radu »

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:

list.xml

Code: Select all

<list type="bulleted" xmlns="http://www.tei-c.org/ns/1.0">
<item xml:id="aaa">
<p>1</p>
</item>
<item xml:id="bbb">
<p>2</p>
</item>
</list>
main.xml

Code: Select all


<?xml version="1.0" encoding="iso-8859-1"?>
<?oxygen RNGSchema="http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_xinclude.rng" type="xml"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0">
<text>
<body>
<divGen type="toc"/>
<div type="sect">
<xi:include href="list.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<p>
Reference to <ref target="" >Ref</ref>
</p>
</div>
</body>
</text>
</TEI>
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.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply