Login  Register

Re: XPointer and attributes with namespace

Posted by jpereza on Jan 13, 2010; 3:38pm
URL: https://discuss.orbeon.com/XPointer-and-attributes-with-namespace-tp1011376p1013110.html

Hello Alex,

Please note that the <configuration> element is a child of <manager> or <repository> element, so it doesn't have any parent with the namespace declaration.

Here is an example to test with the XPL sandbox:

Input XML:
<configuration xmlns:cfg="http://rigel/configuration/XMLInclude">
        <configurations>
                <cfg:include url="rel:App/ConfigurationService.xml#/configuration/authenticationTypes" />
                <cfg:include url="variableRel:App/cfg-LogonComponentsDefinition.xml#/configuration/components"/>                                                       
                <cfg:include url="variableRel:App/cfg-policies.xml#/configuration/ldapServer/repositorytype" />       
                <manager>
                        <configuration cfg:include-url="variableRel:App/cfg-manager.xml" />
                </manager>
                <repository>
                        <configuration cfg:include-url="variableRel:App/cfg-repository.xml" />
                </repository>
        </configurations>
</configuration>


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="aggregate('instance-data',
              #data#xpointer(/configuration/configurations)
              )" />
                <p:output name="data" ref="data" />
        </p:processor>

</p:config>


Output:
<instance-data>
  <configurations>
    <cfg:include url="rel:App/ConfigurationService.xml#/configuration/authenticationTypes" xmlns:cfg="http://rigel/configuration/XMLInclude" />
    <cfg:include url="variableRel:App/cfg-LogonComponentsDefinition.xml#/configuration/components" xmlns:cfg="http://rigel/configuration/XMLInclude" />
    <cfg:include url="variableRel:App/cfg-policies.xml#/configuration/ldapServer/repositorytype" xmlns:cfg="http://rigel/configuration/XMLInclude" />
    <manager>
      <configuration cfg:include-url="variableRel:App/cfg-manager.xml" />
    </manager>
    <repository>
      <configuration cfg:include-url="variableRel:App/cfg-repository.xml" />
    </repository>
  </configurations>
</instance-data>

Thanks,
jpereza


Alessandro Vernet wrote
The namespace doesn't need to be re-declared on an element if it has  
already been declared on a parent element, and here in the example  
output cfg is declared on the <cfg:include> element, so it doesn't  
need to be redeclared on <configuration>.

I am not sure why you are getting this error: could you create a  
simple XPL that maybe even runs in the XPL sandbox and that reproduces  
this?

Alex