Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 24583 invoked from network); 1 Sep 2004 15:09:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 1 Sep 2004 15:09:14 -0000 Received: (qmail 51557 invoked by uid 500); 1 Sep 2004 15:09:02 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 51450 invoked by uid 500); 1 Sep 2004 15:09:01 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: users@cocoon.apache.org Delivered-To: mailing list users@cocoon.apache.org Delivered-To: moderator for users@cocoon.apache.org Received: (qmail 78293 invoked by uid 99); 1 Sep 2004 14:40:21 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of lpb@focalpoint.com designates 66.237.148.186 as permitted sender) Message-ID: <4135DF47.2020501@focalpoint.com> Date: Wed, 01 Sep 2004 09:40:07 -0500 From: Luigi Bai Reply-To: lpb+cocoon@focalpoint.com Organization: Focal Point Software, Inc. User-Agent: Mozilla Thunderbird 0.7.1 (Windows/20040626) X-Accept-Language: en-us, en MIME-Version: 1.0 To: users@cocoon.apache.org Cc: dev@cocoon.apache.org Subject: Trouble with XMLDBTransformer X-Enigmail-Version: 0.84.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime X-Habeas-SWE-1: winter into spring X-Habeas-SWE-2: brightly anticipated X-Habeas-SWE-3: like Habeas SWE (tm) X-Habeas-SWE-4: Copyright 2002 Habeas (tm) X-Habeas-SWE-5: Sender Warranted Email (SWE) (tm). The sender of this X-Habeas-SWE-6: email in exchange for a license for this Habeas X-Habeas-SWE-7: warrant mark warrants that this is a Habeas Compliant X-Habeas-SWE-8: Message (HCM) and not spam. Please report use of this X-Habeas-SWE-9: mark in spam to http://www.habeas.com/report/. Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Focal-Point-Software-Inc-MailScanner-Information: Please contact the ISP for more information X-Focal-Point-Software-Inc-MailScanner: Found to be clean X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I'm having a problem with XMLDBTransformer sending an xupdate to an XMLDB database. I'm pretty sure others are using this successfully, so I'm not sure what I'm doing wrong. I'm using a generator to output a document that looks like this (confirmed with ?cocoon-view=content): users 7 XMLDBTransformer correctly identifies the outer element and creates its ContentHandler for the inner one, a transformer(org.apache.xalan.transformer.TransformerIdentityImpl from Xalan 2.6.0) with a new StreamResult around a StringWriter. Once the endElement is seen for ax:query, the inner ContentHandler is sent an endDocument(), and the StringWriter is asked to produce its string to be sent to the target XUpdateQueryService. However, the string (serialized XML) lackes any xmlns Attributes, which causes at least eXist's SAX parser to throw an Exception. String: users 7 throws: [Fatal Error] :1:33: The prefix "xu" for element "xu:modifications" is not bound. org.xml.sax.SAXParseException I've tried, in my cocoon.xconf, to do the following for namespaces; I turned "namespace-prefixes" on: Also, I modified XMLDBTransformer() to explicitly set the Output.METHOD to "xml": public XMLDBTransformer() { format.put(OutputKeys.ENCODING, "utf-8"); format.put(OutputKeys.INDENT, "yes"); format.put(OutputKeys.OMIT_XML_DECLARATION, "yes"); format.put(OutputKeys.METHOD, "xml"); } I have a feeling it's not the Transformer nor the XMLParser which are the problem, for two reasons. One, the cocoon-view=content properly shows the namespaces, so the xml serializer there seems to work fine. Second, in XMLDBTransformer.startElement() I traced the arguments, and saw: Putting prefix ax as URI http://apache.org/cocoon/xmldb/1.0 Putting prefix xu as URI http://www.xmldb.org/xupdate Queryhandler is getting #http://www.xmldb.org/xupdate#, loc#modifications#, raw#xu:modifications#, 1 attributes. Queryhandler is getting #http://www.xmldb.org/xupdate#, loc#append#, raw#xu:append#, 1 attributes. Queryhandler is getting ##, loc#user#, raw#user#, 4 attributes. Queryhandler is getting ##, loc#group#, raw#group#, 0 attributes. Queryhandler is getting #http://www.xmldb.org/xupdate#, loc#update#, raw#xu:update#, 1 attributes. By looking at the count of attributes on each element, I don't see an explicit "xmlns" attribute being passed through - but I do see the startPrefixMapping happening, so I'm fine with that. Any suggestions? After all that, it's probably something pretty simple I'm missing. :-( --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org