Hello,
I've got an error in a form using an xpointer expression on a XML with namespaces in attributes: This is the original XML document (simplified): <?xml version="1.0" encoding="ISO-8859-1"?> <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> And this is the XPointer expression used in a XPL: #conf-service#xpointer(/configuration/configurations) This is the resulting XML document: <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> Note that the namespace declaration is included in every element that uses it, but it is not included for those elements that have an attribute with the namespace. So, this exception is thrown: org.xml.sax.SAXParseException: The prefix "cfg" for attribute "cfg:include-url" associated with an element type "configuration" is not bound. at orbeon.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:196) at orbeon.apache.xerces.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:175) at orbeon.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:351) at orbeon.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:281) at orbeon.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:232) at orbeon.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1654) at orbeon.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:324) at orbeon.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:845) at orbeon.apache.xerces.parsers.XML11Configuration.parse(XML11Configuration.java:768) at orbeon.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108) at orbeon.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1201) at org.dom4j.io.SAXReader.read(SAXReader.java:465) at org.dom4j.io.SAXReader.read(SAXReader.java:365) at org.orbeon.oxf.xml.dom4j.Dom4jUtils.readDom4j(Dom4jUtils.java:243) at org.orbeon.oxf.xforms.XFormsInstance.<init>(XFormsInstance.java:127) at org.orbeon.oxf.xforms.XFormsModel.restoreInstances(XFormsModel.java:449) at org.orbeon.oxf.xforms.XFormsModel.restoreState(XFormsModel.java:393) at org.orbeon.oxf.xforms.xbl.XBLContainer.restoreModelsState(XBLContainer.java:624) at org.orbeon.oxf.xforms.XFormsContainingDocument.restoreDynamicState(XFormsContainingDocument.java:1468) at org.orbeon.oxf.xforms.XFormsContainingDocument.<init>(XFormsContainingDocument.java:261) at org.orbeon.oxf.xforms.processor.XFormsServer.outputAjaxResponse(XFormsServer.java:816) at org.orbeon.oxf.xforms.processor.XFormsServer.doIt(XFormsServer.java:351) at org.orbeon.oxf.xforms.processor.XFormsServer.access$000(XFormsServer.java:62) at org.orbeon.oxf.xforms.processor.XFormsServer$1.readImpl(XFormsServer.java:93) at org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl$1.read(ProcessorImpl.java:996) at org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1179) at org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:351) at org.orbeon.oxf.processor.pipeline.TeeProcessor.access$200(TeeProcessor.java:35) at org.orbeon.oxf.processor.pipeline.TeeProcessor$TeeProcessorOutputImpl.readImpl(TeeProcessor.java:89) at org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl$1.read(ProcessorImpl.java:996) at org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1179) at org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:351) at org.orbeon.oxf.processor.ProcessorImpl.readInputAsTinyTree(ProcessorImpl.java:378) at org.orbeon.oxf.processor.ProcessorImpl$4.read(ProcessorImpl.java:411) at org.orbeon.oxf.processor.ProcessorImpl.readCacheInputAsObject(ProcessorImpl.java:457) at org.orbeon.oxf.processor.ProcessorImpl.readCacheInputAsTinyTree(ProcessorImpl.java:409) at org.orbeon.oxf.processor.pipeline.choose.ConcreteChooseProcessor.start(ConcreteChooseProcessor.java:189) at org.orbeon.oxf.processor.pipeline.PipelineProcessor$5.run(PipelineProcessor.java:647) at org.orbeon.oxf.processor.ProcessorImpl.executeChildren(ProcessorImpl.java:526) at org.orbeon.oxf.processor.pipeline.PipelineProcessor.start(PipelineProcessor.java:644) at org.orbeon.oxf.processor.pipeline.choose.ConcreteChooseProcessor.start(ConcreteChooseProcessor.java:245) at org.orbeon.oxf.processor.pipeline.PipelineProcessor$5.run(PipelineProcessor.java:647) at org.orbeon.oxf.processor.ProcessorImpl.executeChildren(ProcessorImpl.java:526) at org.orbeon.oxf.processor.pipeline.PipelineProcessor.start(PipelineProcessor.java:644) at org.orbeon.oxf.pipeline.InitUtils.runProcessor(InitUtils.java:90) at org.orbeon.oxf.webapp.ProcessorService.service(ProcessorService.java:96) at org.orbeon.oxf.servlet.OrbeonServletDelegate.service(OrbeonServletDelegate.java:138) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:567) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454) at java.lang.Thread.run(Thread.java:595) If I put the debug attribute in the XPL, the result of applying the XPointer expression is correct. Why this different behaviour? Thanks in advance. jpereza |
Administrator
|
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 On Jan 11, 2010, at 9:02 AM, jpereza <[hidden email]> wrote: > > Hello, > > I've got an error in a form using an xpointer expression on a XML with > namespaces in attributes: > > This is the original XML document (simplified): > > <?xml version="1.0" encoding="ISO-8859-1"?> > <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> > > And this is the XPointer expression used in a XPL: > #conf-service#xpointer(/configuration/configurations) > > This is the resulting XML document: > <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> > > Note that the namespace declaration is included in every element > that uses > it, but it is not included for those elements that have an attribute > with > the namespace. > > So, this exception is thrown: > org.xml.sax.SAXParseException: The prefix "cfg" for attribute > "cfg:include-url" associated with an element type "configuration" is > not > bound. > at > orbeon.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException > (ErrorHandlerWrapper.java:196) > at > orbeon.apache.xerces.util.ErrorHandlerWrapper.fatalError > (ErrorHandlerWrapper.java:175) > at > orbeon.apache.xerces.impl.XMLErrorReporter.reportError > (XMLErrorReporter.java:351) > at > orbeon.apache.xerces.impl.XMLErrorReporter.reportError > (XMLErrorReporter.java:281) > at > orbeon.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement > (XMLNSDocumentScannerImpl.java:232) > at > orbeon.apache.xerces.impl.XMLDocumentFragmentScannerImpl > $FragmentContentDispatcher.dispatch > (XMLDocumentFragmentScannerImpl.java:1654) > at > orbeon.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument > (XMLDocumentFragmentScannerImpl.java:324) > at > orbeon.apache.xerces.parsers.XML11Configuration.parse > (XML11Configuration.java:845) > at > orbeon.apache.xerces.parsers.XML11Configuration.parse > (XML11Configuration.java:768) > at orbeon.apache.xerces.parsers.XMLParser.parse(XMLParser.java:108) > at > orbeon.apache.xerces.parsers.AbstractSAXParser.parse > (AbstractSAXParser.java:1201) > at org.dom4j.io.SAXReader.read(SAXReader.java:465) > at org.dom4j.io.SAXReader.read(SAXReader.java:365) > at org.orbeon.oxf.xml.dom4j.Dom4jUtils.readDom4j(Dom4jUtils.java: > 243) > at org.orbeon.oxf.xforms.XFormsInstance.<init> > (XFormsInstance.java:127) > at org.orbeon.oxf.xforms.XFormsModel.restoreInstances > (XFormsModel.java:449) > at org.orbeon.oxf.xforms.XFormsModel.restoreState > (XFormsModel.java:393) > at > org.orbeon.oxf.xforms.xbl.XBLContainer.restoreModelsState > (XBLContainer.java:624) > at > org.orbeon.oxf.xforms.XFormsContainingDocument.restoreDynamicState > (XFormsContainingDocument.java:1468) > at > org.orbeon.oxf.xforms.XFormsContainingDocument.<init> > (XFormsContainingDocument.java:261) > at > org.orbeon.oxf.xforms.processor.XFormsServer.outputAjaxResponse > (XFormsServer.java:816) > at org.orbeon.oxf.xforms.processor.XFormsServer.doIt > (XFormsServer.java:351) > at > org.orbeon.oxf.xforms.processor.XFormsServer.access$000 > (XFormsServer.java:62) > at > org.orbeon.oxf.xforms.processor.XFormsServer$1.readImpl > (XFormsServer.java:93) > at > org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl$1.read > (ProcessorImpl.java:996) > at > org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read > (ProcessorImpl.java:1179) > at > org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX > (ProcessorImpl.java:351) > at > org.orbeon.oxf.processor.pipeline.TeeProcessor.access$200 > (TeeProcessor.java:35) > at > org.orbeon.oxf.processor.pipeline.TeeProcessor > $TeeProcessorOutputImpl.readImpl(TeeProcessor.java:89) > at > org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl$1.read > (ProcessorImpl.java:996) > at > org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read > (ProcessorImpl.java:1179) > at > org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX > (ProcessorImpl.java:351) > at > org.orbeon.oxf.processor.ProcessorImpl.readInputAsTinyTree > (ProcessorImpl.java:378) > at org.orbeon.oxf.processor.ProcessorImpl$4.read > (ProcessorImpl.java:411) > at > org.orbeon.oxf.processor.ProcessorImpl.readCacheInputAsObject > (ProcessorImpl.java:457) > at > org.orbeon.oxf.processor.ProcessorImpl.readCacheInputAsTinyTree > (ProcessorImpl.java:409) > at > org.orbeon.oxf.processor.pipeline.choose.ConcreteChooseProcessor.start( > ConcreteChooseProcessor.java:189) > at > org.orbeon.oxf.processor.pipeline.PipelineProcessor$5.run > (PipelineProcessor.java:647) > at > org.orbeon.oxf.processor.ProcessorImpl.executeChildren > (ProcessorImpl.java:526) > at > org.orbeon.oxf.processor.pipeline.PipelineProcessor.start > (PipelineProcessor.java:644) > at > org.orbeon.oxf.processor.pipeline.choose.ConcreteChooseProcessor.start( > ConcreteChooseProcessor.java:245) > at > org.orbeon.oxf.processor.pipeline.PipelineProcessor$5.run > (PipelineProcessor.java:647) > at > org.orbeon.oxf.processor.ProcessorImpl.executeChildren > (ProcessorImpl.java:526) > at > org.orbeon.oxf.processor.pipeline.PipelineProcessor.start > (PipelineProcessor.java:644) > at org.orbeon.oxf.pipeline.InitUtils.runProcessor(InitUtils.java: > 90) > at org.orbeon.oxf.webapp.ProcessorService.service > (ProcessorService.java:96) > at > org.orbeon.oxf.servlet.OrbeonServletDelegate.service > (OrbeonServletDelegate.java:138) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter > (ApplicationFilterChain.java:290) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter > (ApplicationFilterChain.java:206) > at > org.apache.catalina.core.StandardWrapperValve.invoke > (StandardWrapperValve.java:233) > at > org.apache.catalina.core.StandardContextValve.invoke > (StandardContextValve.java:191) > at > org.apache.catalina.core.StandardHostValve.invoke > (StandardHostValve.java:128) > at > org.apache.catalina.valves.ErrorReportValve.invoke > (ErrorReportValve.java:102) > at > org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java: > 567) > at > org.apache.catalina.core.StandardEngineValve.invoke > (StandardEngineValve.java:109) > at > org.apache.catalina.connector.CoyoteAdapter.service > (CoyoteAdapter.java:293) > at > org.apache.coyote.http11.Http11Processor.process > (Http11Processor.java:849) > at > org.apache.coyote.http11.Http11Protocol > $Http11ConnectionHandler.process(Http11Protocol.java:583) > at org.apache.tomcat.util.net.JIoEndpoint$Worker.run > (JIoEndpoint.java:454) > at java.lang.Thread.run(Thread.java:595) > > > If I put the debug attribute in the XPL, the result of applying the > XPointer > expression is correct. > Why this different behaviour? > > Thanks in advance. > jpereza > > -- > View this message in context: http://n4.nabble.com/XPointer-and-attributes-with-namespace-tp1011376p1011376.html > Sent from the ObjectWeb OPS - Users mailing list archive at > Nabble.com. > > -- > You receive this message as a subscriber of the [hidden email] > mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > OW2 mailing lists service home page: http://www.ow2.org/wws -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
|
In reply to this post by Alessandro Vernet
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
|
Administrator
|
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 On Jan 13, 2010, at 7:38 AM, jpereza <[hidden email]> wrote: > > 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 >> > > -- > View this message in context: http://n4.nabble.com/XPointer-and-attributes-with-namespace-tp1011376p1013110.html > Sent from the ObjectWeb OPS - Users mailing list archive at > Nabble.com. > > -- > You receive this message as a subscriber of the [hidden email] > mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > OW2 mailing lists service home page: http://www.ow2.org/wws -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
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
|
Administrator
|
I see, indeed this is a bug with the XPointer implementation. Instead
of using XPointer, you can use XSLT for this, as follows: <p:processor name="oxf:xslt"> <p:input name="data" href="#data"/> <p:input name="config"> <xsl:stylesheet version="2.0"> <xsl:template match="/"> <xsl:copy-of select="/root/configuration"/> </xsl:template> </xsl:stylesheet> </p:input> <p:output name="data" id="subset"/> </p:processor> Alex On Fri, Jan 15, 2010 at 1:21 AM, jpereza <[hidden email]> wrote: > > 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 >> > > -- > View this message in context: http://n4.nabble.com/XPointer-and-attributes-with-namespace-tp1011376p1014619.html > Sent from the ObjectWeb OPS - Users mailing list archive at Nabble.com. > > > -- > You receive this message as a subscriber of the [hidden email] mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > OW2 mailing lists service home page: http://www.ow2.org/wws > > -- Orbeon Forms - Web forms, open-source, for the Enterprise Orbeon's Blog: http://www.orbeon.com/blog/ My Twitter: http://twitter.com/avernet -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Free forum by Nabble | Edit this page |