cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cumming...@netscape.net (Steven Cummings)
Subject Transformer problem
Date Fri, 01 Nov 2002 22:26:00 GMT
Hey all,

I'm working on developing a SOAPTransformer that behaves very much like the SQLTransformer.
In other words, the input XML under my current working namespace should describe a SOAP call
(but doesn't really look like a SOAP envelope) and the response will be the result value or
the result list. Sometimes however, the result value might be an XML document itself. I can
return this document just fine as a string and the xmlConsumer in the transformer just takes
the characters and sends them out. But I want to provide the option of passing known XML that
is returned from a method through the xmlConsumer so that it becomes and embedded part of
the result document. So I use the following code to send it inline into the outgoing SAX event
stream:

/* Assuming that content is the string variable that is the return value
 * of the SOAP call and that I've been using super.startElement, 
 * super.endElement and so on up to this point and continuing after I
 * release the Avalon parser. Also, just FYI, super is of course the
 * AbstractTransformer.
 */
Parser parser = (Parser) this.manager.lookup(Parser.ROLE);
InputSource source = new InputSource(new StringReader(content));
// XMLConsumer implements both ContentHandler and LexicalHandler.
parser.parse(source, super.xmlConsumer, super.xmlConsumer);
this.manager.release(parser);

I would think that this should work with no problem or give me some sort of parser error during
the parsing of the embedded content. Instead, the transformer *SEEMS* to succeed, but constructs
the result so that I get the following error in the browser. 

A name contained an invalid character. Error processing resource 'http://knuth:8080/test-demos/soap-call'.
Line 6, Position 176 
<document xmlns:req="http://xml.apache.org/cocoon/requestgenerator/2.0" xmlns:soap="http://ideal.cecs.missouri.edu/cocoon/transformation/soap/1.0"><soap:response><soap:value<?xml
version="1.0" encoding="UTF-8"?>

You can see what the problem is with the soap:value starting tag. But why would the parser
construct the text in this way? What could possibly be giving me this problem. The log files
don't tell me anything about this error, so that's no help. Let me know if anybody has any
ideas about this. Thanks!

/S

-- 
Steven Cummings
Columbia, MO
Email: cummingscs@netscape.net
AIM:   cummingscs
ICQ:   3330114


__________________________________________________________________
The NEW Netscape 7.0 browser is now available. Upgrade now! http://channels.netscape.com/ns/browsers/download.jsp


Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message