Login  Register

Re: Re: XPointer and attributes with namespace

Posted by jpereza on Jan 15, 2010; 9:21am
URL: https://discuss.orbeon.com/XPointer-and-attributes-with-namespace-tp1011376p1014619.html

The error is still there, but I don't know if you already noted it.

I'll try to explain myself:

In the input XML I have some elements named "cfg:include" and some attributes named "cfg:include-url". The namespace "cfg" is being declared on the root element.

When I run the XPL and apply the XPointer expression, the result is a fragment of the input XML. In this fragment I still have elements named "cfg:include" and attributes named "cfg:include-url", but the namespace declaration was left behind in the root element of the input XML.

What the Orbeon's engine is doing to insert the missing namespace declaration is, when an element with namespace is found, it inserts the namespace declaration on that element.
But when an attribute with namespace is found, the engine is missing to insert the namespace declaration.

Another simpler example:

Input XML:
<root xmlns:cfg="http://rigel/configuration/XMLInclude">
        <configuration>
                <manager>
                        <data cfg:include-url="some-url" />
                </manager>
                <cfg:include url="some-url" />
        </configuration>
</root>

XPL:
<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
          xmlns:oxf="http://www.orbeon.com/oxf/processors">

    <p:param name="data" type="input"/>
    <p:param name="data" type="output"/>

        <p:processor name="oxf:identity">
                <p:input name="data"
                        href="#data#xpointer(/root/configuration)" />
                <p:output name="data" ref="data" />
        </p:processor>

</p:config>

Output XML:
<configuration>
    <manager>
        <data cfg:include-url="some-url"/>
    </manager>
    <cfg:include url="some-url" xmlns:cfg="http://rigel/configuration/XMLInclude"/>
</configuration>

As you can see, the attribute "cfg:include-url" from element "/configuration/manager/data" is missing its namespace declaration. This is the error.

I hope is clearer now.

Thanks,
jpereza


Alessandro Vernet wrote
I am not sure to get it. I am running this, and indeed get the same  
result you do (and no error). See: http://img.skitch.com/20100115-bng52g6e2ynnbshwak9wtwqh41.png

This does not reproduce the error mentioned in your first message,  
right? Do you expected another result when running the in XPL sandbox?

Alex