cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Cave <>
Subject XIncludeTransformer lacks base URI fixup support?
Date Fri, 22 Jun 2007 21:00:20 GMT
I think the Cocoon XIncludeTransformer might be missing some important 
functionality. Namely, I don't think it inserts xml:base attributes 
according to the specification (see ).

For example, given these source documents:

<?xml version="1.0" encoding="UTF-8"?>
<doc xmlns:xi="">
    <xi:include href="Content/bar.xml"/>
<?xml version="1.0" encoding="UTF-8"?>

And the pipeline fragment:

<map:match pattern="foo.xml">
    <map:generate src="foo.xml"/>
    <map:transform type="xinclude"/>
    <map:serialize type="xml"/>

I would expect the serialized output to be:

<?xml version="1.0" encoding="UTF-8"?>
<doc xmlns:xi="">
    <included xml:base="Content/bar.xml">

However, in reality, the xml:base attribute is not present. Trying this 
with the command line XML parser, xmllint, yields the expected result. A 
quick scan of the XIncludeTransformer source turned up nothing that 
looked like it was meant to take care of this base URI fixup. Maybe 
there's something I'm missing? Can anyone else confirm this issue?

The reason I'd like to see this functionality is that my included 
documents, located in subdirectories, will often have relative file URIs 
pointing to images, and those paths break when included into a document 
in a different directory. I'd like to be able to use the xml:base 
attributes to resolve those URIs. Is there perhaps another mechanism to 
deal with this issue?

Thanks for any insight,
Andrew Cave

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message