Hi,
A workaround I have found is to add the following code to org.orbeon.oxf.processor.transformer.xslt.XSLTTransformer.java at line 135:
public void startPrefixMapping(String s, String s1) thro
ws SAXException {
if ("xmlns".equals(s)) {
return;
}
// Start of my added code
if (s.length() > 0 && s1.equals("")) {
return;
}
// End of my added code
super.startPrefixMapping(s, s1);
}
}));
So this gets rid of the xmlns:xs="" type statements. Unfortunately there seems to be another problem concerning attributes with namespace, e.g. xsi:type with replication of the namespace so in the document that it being submitted to eXist, they appear as xsi:xsi:type, which throws an exception.
Cheers,
Matthew
On Oct 14, 2004, at 1:39 PM, Erik Bruchez wrote:
I think that this is because of the old problem of XForms / XUpdate losing namespace prefixes. BTW this should have just been fixed by Julien yesterday.
With prefixes missing, the dom4j serializer used to serialize XForms instances generates declarations of the type xmlns:abc="" to undeclare prefixes. This is BTW supported in XML 1.1, but not in XML 1.0. So basically, nobody can parse the resulting XML documents, and this is most likely the error you are seeing now, as result of the <xsl:copy-of select="/form/document/*"/>. If you put some debug on #registryEntry, you will probably see some of those xmlns:abc="".
Your options are:
1. Get a build of the latest code or build from CVS (maybe after making sure with Julien that this is really fixed).
2. Write a transformation with XSLT or something else that re-adds namespace prefixes, or removes those faulty declarations.
-Erik
Matthew J. Graham wrote:
Hi,
Here's an obscure problem that's preventing my documents being inserted into an eXist database:
I have the following pipeline:
<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
xmlns:oxf="http://www.orbeon.com/oxf/processors"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xdb="http://orbeon.org/oxf/xml/xmldb"
xmlns:xdt="http://www.w3.org/2003/11/xpath-datatypes"
xmlns:carn="http://www.cacr.caltech.edu/projects/us-vo/schemas/ Carnivore"
>
<p:param type="input" name="instance"/>
<p:processor name="oxf:xslt">
<p:input name="data" href="#instance"/>
<p:input name="config">
<carn:RegistryEntry xsl:version="2.0">
<carn:RegistryData>
<carn:User><xsl:value-of select="/form/user"/></carn:User>
<carn:Id><xsl:value-of select="//*:identifier"/></carn:Id>
<carn:CreationDate><xsl:value-of select="adjust-dateTime-to-timezone(current-dateTime(), xdt:dayTimeDuration('PT0H'))"/></carn:CreationDate>
<carn:LastModificationDate><xsl:value-of select="adjust-dateTime-to-timezone(current-dateTime(), xdt:dayTimeDuration('PT0H'))"/></carn:LastModificationDate>
<carn:Source>mercury.cacr.caltech.edu:8080/carnivore</carn:Source>
<carn:Version>Current</carn:Version>
<carn:Set/>
<carn:ValidationLevel>0</carn:ValidationLevel>
</carn:RegistryData>
<carn:RegistryItem>
<xsl:copy-of select="/form/document/*"/>
</carn:RegistryItem>
</carn:RegistryEntry>
</p:input>
<p:output name="data" id="registryEntry"/>
</p:processor>
<!-- Insert new document -->
<p:processor name="oxf:xmldb-insert">
<p:input name="datasource" href="../datasource.xml"/>
<p:input name="query">
<xdb:insert collection="/db/test"/>
</p:input>
<p:input name="data" href="#registryEntry"/>
</p:processor>
</p:config>
and when I run it, I get an error about xmlns:xu having no content:
org.xml.sax.SAXParseException: The value of the attribute "prefix="xmlns",localpart="xu",rawname="xmlns:xu"" is invalid. Prefixed namespace bindings may not be empty.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unk no wn Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanAttribute(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unkno wn Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentD is patcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unk no wn 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.exist.collections.Collection.determineTreeStructure(Collection.jav a: 1114)
at org.exist.collections.Collection.validate(Collection.java:851)
at org.exist.xmldb.LocalCollection.storeXMLResource(LocalCollection.java: 590)
at org.exist.xmldb.LocalCollection.storeResource(LocalCollection.java: 531)
at org.orbeon.oxf.processor.xmldb.XMLDBProcessor.insert(XMLDBProcessor.ja va :343)
I put a logging statement into XMLDBProcessor to see what the XMLResource content is that is being sent to eXist and the log shows:
<carn:RegistryEntry xmlns:xu="http://www.xmldb.org/xupdate" xmlns:oxf="http://www.orbeon.com/oxf/processors" xmlns:carn="http://www.cacr.caltech.edu/projects/us-vo/schemas/ Carnivore" xmlns:xdb="http://orbeon.org/oxf/xml/xmldb" xmlns:p="http://www.orbeon.com/oxf/pipeline" xmlns:xdt="http://www.w3.org/2003/11/xpath-datatypes"><carn: RegistryData><carn:User/><carn:Id>ivo://nvo.caltech/B/1</carn: Id><carn: CreationDate>2004-10-14T19:53:51.826Z</carn:CreationDate><carn: LastModificationDate>2004-10-14T19:53:51.826Z</carn: LastModificationDate><carn:Source>mercury.cacr.caltech.edu:8080/ carnivore</carn:Source><carn:Version>Current</carn:Version><carn:Set/ ><carn:ValidationLevel>0</carn:ValidationLevel></carn: RegistryData><carn:RegistryItem xmlns:xu="" xmlns:oxf="" xmlns:xdb="" xmlns:p="" xmlns:xdt=""><vr:resource xmlns:vr="http://www.ivoa.net/xml/VOResource/v0.10" xmlns:xu="" xmlns:oxf="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:carn="" xmlns:xdb="" xmlns:p="" xmlns:xdt="" status="active" updated="1970-01-01" xsi:xsi:type="cs:ConeSearch" created="1970-01-01">
So it looks as though at the point where <xsl:copy-of select="/form/document/*/> is called in the pipeline, all unused namespaces have their content missing. Is this a bug in the SAX parser?
Cheers,
Matthew
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
orbeon-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/orbeon-user
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
orbeon-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/orbeon-user
------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ orbeon-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/orbeon-user
