AW: AW: convert String into Sax events into my own transformer

2003-02-06 Thread Jan Harms
Sorry, I forgot to tell you that you can wrap your xmlConsumer into a 
org.apache.cocoon.xml.IncludeXMLConsumer.
This class basically ignores the start/endDocument() and start/endDTD() method call:

parser.parse(inputSource, new IncludeXMLConsumer(xmlConsumer()));


BTW, where does your String come from? If you just want to emit one single tag, e.g. 
test/ it will be easier to just call the sax methods directly.

I assume that your transformer extends AbstractTransformer. Then you can do the 
following

//create test/ in consumer
super.startElement(, test, test, new org.xml.sax.helpers.AttributesImpl()); 
super.endElement(, test, test);


If you really want to build your own transformer, I can only recommend to have a look 
at the sources of cocoon-transformers. This helps a lot.

What confused me a bit about your last post, is that you have xsp code in your 
browser... Maybe you could explain in more detail what you are trying to do, then we 
might help you better.

Regards,

-Jan

 -Ursprüngliche Nachricht-
 Von: Lionel Crine [mailto:[EMAIL PROTECTED]]
 Gesendet: Donnerstag, 6. Februar 2003 10:33
 An: [EMAIL PROTECTED]
 Betreff: Re: AW: convert String into Sax events into my own 
 transformer
 
 
 OK, it's allmost working because i still have :
 
 ?xml version=1.0 encoding=UTF-8?
 
 and In my browser I have :
 
 
 ?xml version=1.0 encoding=UTF-8?
 xsp:page xmlns:xsp=http://apache.org/xsp; 
 xmlns:ixia-query=http://www.ixiasoft.com/ixia/query/1.0;
 
 
 ixia-query:document
?xml version=1.0 encoding=UTF-8?
 test/
 /ixia-query:document
 
 /xsp:page
 
 
 I would like the parser to not keep the ?xml version=1.0 
 encoding=UTF-8?.
 
 Is it possible ?
 
 

-
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: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]




Re: AW: AW: convert String into Sax events into my own transformer

2003-02-06 Thread Lionel Crine
I Found IT!!! thanks a lot

At 11:50 06/02/2003 +0100, you wrote:

Sorry, I forgot to tell you that you can wrap your xmlConsumer into a 
org.apache.cocoon.xml.IncludeXMLConsumer.
This class basically ignores the start/endDocument() and start/endDTD() 
method call:

parser.parse(inputSource, new IncludeXMLConsumer(xmlConsumer()));


BTW, where does your String come from? If you just want to emit one single 
tag, e.g. test/ it will be easier to just call the sax methods directly.

I assume that your transformer extends AbstractTransformer. Then you can 
do the following

//create test/ in consumer
super.startElement(, test, test, new 
org.xml.sax.helpers.AttributesImpl());
super.endElement(, test, test);


If you really want to build your own transformer, I can only recommend to 
have a look at the sources of cocoon-transformers. This helps a lot.

What confused me a bit about your last post, is that you have xsp code in 
your browser... Maybe you could explain in more detail what you are trying 
to do, then we might help you better.

Regards,

-Jan

 -Ursprüngliche Nachricht-
 Von: Lionel Crine [mailto:[EMAIL PROTECTED]]
 Gesendet: Donnerstag, 6. Februar 2003 10:33
 An: [EMAIL PROTECTED]
 Betreff: Re: AW: convert String into Sax events into my own
 transformer


 OK, it's allmost working because i still have :

 ?xml version=1.0 encoding=UTF-8?

 and In my browser I have :


 ?xml version=1.0 encoding=UTF-8?
 xsp:page xmlns:xsp=http://apache.org/xsp;
 xmlns:ixia-query=http://www.ixiasoft.com/ixia/query/1.0;


 ixia-query:document
?xml version=1.0 encoding=UTF-8?
 test/
 /ixia-query:document

 /xsp:page


 I would like the parser to not keep the ?xml version=1.0
 encoding=UTF-8?.

 Is it possible ?



-
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: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]


-
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: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]




Re: AW: AW: convert String into Sax events into my own transformer

2003-02-06 Thread Lionel Crine
My string comes from an XML Database.

there are java methods to access the database and they return XML results.

1/I will do an xsp generation to transform my document the first time.( 
reguler expression).- the request query is na xml document.
2/Then I use my transformer to request in the XML DB
3/then I Transform with whatever
and I serialize.


hope you understand what i am trying to do

Don't hesitate to ask me more question if you want to know more.

Lionel




At 11:50 06/02/2003 +0100, you wrote:
Sorry, I forgot to tell you that you can wrap your xmlConsumer into a 
org.apache.cocoon.xml.IncludeXMLConsumer.
This class basically ignores the start/endDocument() and start/endDTD() 
method call:

parser.parse(inputSource, new IncludeXMLConsumer(xmlConsumer()));


BTW, where does your String come from? If you just want to emit one single 
tag, e.g. test/ it will be easier to just call the sax methods directly.

I assume that your transformer extends AbstractTransformer. Then you can 
do the following

//create test/ in consumer
super.startElement(, test, test, new 
org.xml.sax.helpers.AttributesImpl());
super.endElement(, test, test);


If you really want to build your own transformer, I can only recommend to 
have a look at the sources of cocoon-transformers. This helps a lot.

What confused me a bit about your last post, is that you have xsp code in 
your browser... Maybe you could explain in more detail what you are trying 
to do, then we might help you better.

Regards,

-Jan

 -Ursprüngliche Nachricht-
 Von: Lionel Crine [mailto:[EMAIL PROTECTED]]
 Gesendet: Donnerstag, 6. Februar 2003 10:33
 An: [EMAIL PROTECTED]
 Betreff: Re: AW: convert String into Sax events into my own
 transformer


 OK, it's allmost working because i still have :

 ?xml version=1.0 encoding=UTF-8?

 and In my browser I have :


 ?xml version=1.0 encoding=UTF-8?
 xsp:page xmlns:xsp=http://apache.org/xsp;
 xmlns:ixia-query=http://www.ixiasoft.com/ixia/query/1.0;


 ixia-query:document
?xml version=1.0 encoding=UTF-8?
 test/
 /ixia-query:document

 /xsp:page


 I would like the parser to not keep the ?xml version=1.0
 encoding=UTF-8?.

 Is it possible ?



-
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: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]


-
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: [EMAIL PROTECTED]
For additional commands, e-mail:   [EMAIL PROTECTED]