With a clearer head, I now see that the errors were within the XMLDBSource code, and changing the XMLDB URL worked around the problem.

The problem as it now stands is that, when I use an XMLDB URI such as:

xmldb:xindice-embed:///db/tuneballoon/music/#//music[filename='Fathers']

I get a org.xmldb.api.base.XMLDBException.

Looking into this further, I see that it is due to Xerces 2.6. Without it in my classpath, it works fine.

I'm now just stuck with what seems the limited XPath available to Xindice (no 'contains' method).

Regards and thanks, Upayavira

Caused by: org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.

at org.apache.xml.utils.DOMBuilder.startElement(DOMBuilder.java:354)

at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1073)

at org.apache.cocoon.xml.AbstractXMLPipe.startElement(AbstractXMLPipe.java:130)

at org.apache.cocoon.xml.IncludeXMLConsumer.startElement(IncludeXMLConsumer.java:181)

at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)

at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)

at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)

at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)

at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)

at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)

at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)

at org.apache.xindice.client.xmldb.resources.XMLResourceImpl.getContentAsSAX(XMLResourceImpl.java:413)

at org.apache.cocoon.components.source.impl.XMLDBSource.queryToSAX(XMLDBSource.java:354)

at org.apache.cocoon.components.source.impl.XMLDBSource.collectionToSAX(XMLDBSource.java:258)

at org.apache.cocoon.components.source.impl.XMLDBSource.toSAX(XMLDBSource.java:185)

at org.apache.cocoon.components.source.SourceUtil.toSAX(SourceUtil.java:163)

at org.apache.cocoon.components.source.SourceUtil.toSAX(SourceUtil.java:128)

at org.apache.cocoon.components.source.SourceUtil.toDOM(SourceUtil.java:322)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:324)

at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:230)

at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1244)



Thanks for your help. Upayavira

Christopher Oliver wrote:

What errors did you get?

Upayavira wrote:

Maybe my last question was too specific.

I'm trying to parse the contents of a source into a DOM in Flowscript, but am getting all sorts of errors. Can anyone provide a better way than this (which doesn't work)?

var resolver = cocoon.getComponent(Packages.org.apache.excalibur.source.SourceResolver.ROLE);

var source = resolver.resolveURI("blah.xml");
var builder = Packages.javax.xml.parsers.DocumentBuilderFactory.newInstance().newDocumentBuilder();


var is = source.getInputStream();
var dom = builder.parse(source.getInputStream());

Regards, Upayavira



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to