You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Lionel Crine <cr...@4dconcept.fr> on 2003/02/04 15:14:48 UTC

startSerializedXMLRecording and endSerializedXMLRecording

I'm trying to implements my transformer but I can't figured out how to use 
these methods.

Here is what I did :

protected Stringbuffer body = new StringBuffer();

  public void startElement(String namespaceURI, String localName, String 
qName, Attributes attributes)
	throws SAXException
     {
	try
	{
		this.startSerializedXMLRecording(this.format);
		this.body.append(this.endSerializedXMLRecording());
	}
	catch (Exception e){}
	super.startElement(namespaceURI, localName, qName, attributes);
}	

I thought I was enought to get the elements in my StringBuffer, but it's 
still empty.

Moreover, there no documentation about this and the examples in the source 
don't use thes methods.

Anyone knows what's my mistake ?


---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


RE: startSerializedXMLRecording and endSerializedXMLRecording

Posted by Carsten Ziegeler <cz...@s-und-n.de>.
Have a look at the cinclude or the sql transformer for examples.

Carsten

> -----Original Message-----
> From: Lionel Crine [mailto:crine@4dconcept.fr]
> Sent: Tuesday, February 04, 2003 3:15 PM
> To: cocoon-users@xml.apache.org
> Subject: startSerializedXMLRecording and endSerializedXMLRecording
> 
> 
> I'm trying to implements my transformer but I can't figured out 
> how to use 
> these methods.
> 
> Here is what I did :
> 
> protected Stringbuffer body = new StringBuffer();
> 
>   public void startElement(String namespaceURI, String localName, String 
> qName, Attributes attributes)
> 	throws SAXException
>      {
> 	try
> 	{
> 		this.startSerializedXMLRecording(this.format);
> 		this.body.append(this.endSerializedXMLRecording());
> 	}
> 	catch (Exception e){}
> 	super.startElement(namespaceURI, localName, qName, attributes);
> }	
> 
> I thought I was enought to get the elements in my StringBuffer, but it's 
> still empty.
> 
> Moreover, there no documentation about this and the examples in 
> the source 
> don't use thes methods.
> 
> Anyone knows what's my mistake ?
> 
> 
> ---------------------------------------------------------------------
> 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:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
> 

---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: startSerializedXMLRecording and endSerializedXMLRecording

Posted by Brian Johnson <jo...@yahoo.com>.
You need to call endSerializedXMLRecording in your endElement method. 
The AbstractSAXTransformer is setup to pick out elements based on a 
namespace uri. You can look at the code for startElement and endElement 
to see how to pick the xml fragment you want based on a qname.
Brian

On Tuesday, February 4, 2003, at 09:14  AM, Lionel Crine wrote:

> I'm trying to implements my transformer but I can't figured out how to 
> use these methods.
>
> Here is what I did :
>
> protected Stringbuffer body = new StringBuffer();
>
>  public void startElement(String namespaceURI, String localName, 
> String qName, Attributes attributes)
> 	throws SAXException
>     {
> 	try
> 	{
> 		this.startSerializedXMLRecording(this.format);
> 		this.body.append(this.endSerializedXMLRecording());
> 	}
> 	catch (Exception e){}
> 	super.startElement(namespaceURI, localName, qName, attributes);
> }	
>
> I thought I was enought to get the elements in my StringBuffer, but 
> it's still empty.
>
> Moreover, there no documentation about this and the examples in the 
> source don't use thes methods.
>
> Anyone knows what's my mistake ?
>
>
> ---------------------------------------------------------------------
> 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:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
>


---------------------------------------------------------------------
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:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>