Page 1 of 1

All tags now with xmlns:xi="http://www.w3.org/2001/XInc

Posted: Wed May 12, 2004 2:09 am
by gammoth
Hi all,

Perhaps this is to spec, but here goes.

I'm using xinclude.mod to break up my documents. The problem is that once I have validated my document, all tags created with the convenient drop down list include the attribute 'xmlns:xi="http://www.w3.org/2001/XInclude"'. This tends to make the markup unreadable.

Here's an example:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
[ <!ENTITY % xinclude SYSTEM "file:/usr/oxygen/Oxygen-4.0/docbook/dtd/xinclude.mod">
%xinclude;
<!ENTITY % local.common.attrib "xml:base CDATA #IMPLIED" >
]>
<article>
<title>Article with XInclude Title</title>
<sect1>
<title>Section1 Title</title>
<para>Text</para>
<orderedlist xmlns:xi="http://www.w3.org/2001/XInclude">
<listitem xmlns:xi="http://www.w3.org/2001/XInclude"><para xmlns:xi="http://www.w3.org/2001/XInclude">Item 1</para></listitem>
<listitem xmlns:xi="http://www.w3.org/2001/XInclude"><para xmlns:xi="http://www.w3.org/2001/XInclude">Item 2</para></listitem>
</orderedlist>
</sect1>
</article>
In the example, the tags without the attribute were created by the 'File -> New From Templates...' feature. Note that the attributes can be removed without adversely affecting validation or transformation. (In fact, I do a 'Search/Replace files' to remove them.)

Can this be toggled off, or is it just something I've got to live with?

Thanks and best regards,
Jonathan

Posted: Wed May 12, 2004 8:09 am
by george
Hi Jonathan,

In the DTD customization for adding XInclude support, the xinclude.mod file, the xmlns:xi is added to all DocBook elements as a fixed attribute. This was done as a workaround to fix a Xerces XInclude problem [1]. To fix the automatic addition of this attribute just turn off "Insert the fixed attributes" [2] option.


[1] http://www.oxygenxml.com/forum/viewtopi ... light=#843
[2] http://www.oxygenxml.com/doc/ug-oxygen/ ... etion.html

Best Regards,
George

Posted: Wed May 12, 2004 10:22 pm
by gammoth
George, you're one smart cookie. Thanks!