Re: change encoding of avalon SAX parser

2003-02-06 Thread Oskar Casquero



Try using xsl:output encoding="ISO-8859-1"/ 
after the xml declaration in the stylesheet

Oskar


custom transformer problem

2003-02-05 Thread Oskar Casquero



Hello,

My question is about exception handling in cocoon. 
I've a transformer that checks the validity of an XML document. If the document 
is not valid it throws an exception.
When the transformer is after a generator it works 
well: it throws an exception and the error page is sent to the browser. But if 
the transformer is after another transformer, it doesn't throw the exception and 
all the pipeline is executed. However, the exception is logged in 
sitemap.log.Does anybody know how solve this problem?

map:match 
pattern="UML_MAST_XMI2MAST_XMLresponse"map:generate 
type="myStream"map:parameter 
name="file-name" 
value="mast"/map:parameter 
name="validation" 
value="false"//map:generatemap:transform 
type="xalan" src=""/ !-- if Iadd this 
transformer, the following transformer doesn't work well; if I delete it 
myValidation transformerworks 
well--map:transform 
type="myValidation"map:parameter 
name="dom-name" 
value="DBresult"/map:parameter 
name="dom-root-element" 
value="MAST_RT_View"/map:parameter 
name="schema" 
value="mast.xsd"//map:transformmap:transform 
type="xalan" 
src=""/map:serialize//map:match

Oskar


Re: convert text in xml wel form

2003-01-30 Thread Oskar Casquero

Hi Angelo,

You can convert structured text to XML with Chaperon parser generator
(a parser because it parses the text and generator because it creates
an XML document) which is integrated in cocoon as a generator.

See for more details:
http://chaperon.sourceforge.net/
http://xml.apache.org/cocoon/howto/chaperon/howto-chaperon-intro.html

My sitemap example:
map:match pattern=MAST_TXT2MAST_XMLresponse
map:act type=myFileUpload !--action for getting the uploaded text
file, returning fileName in {src} sitemap parameter--
 map:parameter name=file-name value=mast/ !--file-name
attribute in the HTML form--
 map:generate type=textparser src={src}
!--text2chaperonXML--
 map:parameter name=grammar value=cocoon:/mast-out.grm/
!--the grammar describing my text file structure and vocabulary--
 map:parameter name=includeignorabletokens value=true/
 /map:generate
 map:transform src=stylesheets/chaperon2mastXML.xsl/
!--chaperonXML2myXML--
 map:transform type=myAddDocDB !--save XML to eXist--
 map:parameter name=dom-name value=DBresult/
 map:parameter name=dom-root-element value=Mast_Result/
 map:parameter name=collection value=/Ruben/
 map:parameter name=id value=Robot_Teleoperado.xml/
 /map:transform
 map:transform type=xalan src=stylesheets/simple-xml2html.xsl/
!--visualize XML in Mozilla--
 map:serialize/
/map:act
/map:match

map:match pattern=*.grm !--convert txt grammar to xml grammar--
map:generate type=textparser src=grammars/{1}.rgrm
 map:parameter name=grammar value=grammars/rgrm.grm/
/map:generate
map:transform src=stylesheets/rgrm2grm.xsl/
map:serialize type=xml/
/map:match

Oskar

- Original Message -
From: CARLETTA ANGELO [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 30, 2003 8:25 AM
Subject: convert text in xml wel form


--- Reçu de   INFETUDE.G145193 02/250.96.71  30-01-03 08.25

Hi,

I am beginner with cocoon.
I want convert a file text in xml wel form.
The string text is
  .SE NAME 'toto   '
  .SE ADRESS 'xxyy jj'
  .SE TEL '01236547'
...
I want convert data in xml
  NAMEtoto/NAME
  ADRESSxxyy jj/ADRESS
  TEL01236547/TEL
...
It's possible??
Are you a sample of this use (sitemap and stylesheet)

Thanks.
Angelo

 30-01-03 08.25  Envoyé à  
  - [EMAIL PROTECTED]


**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.


[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]


-
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]




ValidationTransformer

2003-01-27 Thread Oskar Casquero
Hi,

I am trying to do a ValidationTransformer that will validate an xml document
with a grammar (W3C Schema, RELAX NG, DTD). To do this I am using JARV, that
gives a validation interface which can control a validation engine (for
example, Xerces-2) through the suitable driver.

I have done the first version of the ValidationTransformer via DOM. To do
it, I modified the WriteDOMSessionTransformer, implementing ErrorHandler
interface and adding to it the code necessary to validate with W3C schemas
(another grammars can be used setting the grammar type as a parameter in the
sitemap).

setup method:

public void setup(SourceResolver resolver, Map objectModel, String source,
Parameters parameters)
throws ProcessingException, SAXException, IOException, Exception {
...
schema = parameters.getParameter(MyValidationTransformer.SCHEMA, null);
if (schema!=null) {
getLogger().debug(MyValidationTransformer: +
MyValidationTransformer.SCHEMA + = + schema);
} else {
getLogger().error(MyValidationTransformer: need  +
MyValidationTransformer.SCHEMA +  parameters);
}

File schemaFile = new
File(/usr/local/jakarta-tomcat-4.0.4/webapps/cocoon/RTF/schemas/ +
schema);
VerifierFactory factory =
VerifierFactory.newInstance(http://www.w3.org/2001/XMLSchema;);
getLogger().debug(MyValidationTransformer: JARV implementation
obtained);
Schema schemaObject = factory.compileSchema(schemaFile);
getLogger().debug(MyValidationTransformer: schema compiled);
verifier = schemaObject.newVerifier();
verifier.setErrorHandler(this);
getLogger().debug(MyValidationTransformer: errorHandler configured);
} catch (Exception e) {
getLogger().debug(MyValidationTransformer: JARV error:  +
e.getMessage() + ,  + e.getCause());
}
}

endElement method:

public void endElement(String uri, String name, String raw)
throws SAXException {
if (name.equalsIgnoreCase(rootElement)  sessionAvailable) {
...
getLogger().debug(MyValidationTransformer: DOM tree is in session
object);
verifier.verify(builder.getDocument());
getLogger().debug(MyValidationTransformer: DOM tree verified);
}
...
}

error method for ErrorHandler implementation:

public void error( final SAXParseException spe )
throws SAXException
{
String message = Error parsing  + spe.getSystemId() +  (line  +
spe.getLineNumber() +  col.  + spe.getColumnNumber() +
):  + spe.getMessage();
getLogger().error( message, spe );
throw new SAXException( message, spe );
}

I check the transformer with the following pipeline: if I send a valid
document it must return the document without doing any transformation; if
the document is not valid, an error message must be returned by cocoon
containing ErrorHandler's exception message.

map:match pattern=UML_MAST_XMI2MAST_XMLresponse
map:generate type=myStream
map:parameter name=file-name value=mast/
map:parameter name=validation value=false/
/map:generate
!--map:transform type=xalan src=stylesheets/xmi2xml.xsl/--
map:transform type=myValidation
map:parameter name=dom-name value=DBresult/
map:parameter name=dom-root-element value=MAST_RT_View/
map:parameter name=schema value=mast.xsd/
/map:transform
map:transform type=xalan src=stylesheets/simple-xml2html.xsl/
map:serialize/
/map:match

This works well. But if I try to add map:transform type=xalan
src=stylesheets/xmi2xml.xsl/ after the generator, the document is
returned to the browser, despite it is not valid. So I think that the
ValidationTransformer is not working well, but I am not totally sure,
because the error is logged in sitemap.log.

So, why is the error logged into sitemap.log, but not returned as an
exception error message to the client?

Could be because of the way in how cocoon works, because when the validation
of the DOM tree is starting or being done, the pipeline process is already
complete?

The alternative is to perform the validation via SAX, but I don't know how
to mix the verifierHandler and the contentHandler of the transformer in
order to make available incoming SAX events for the verifierHandler. I try
to do:

public void setup(SourceResolver resolver, Map objectModel, String source,
Parameters parameters)
throws ProcessingException, SAXException, IOException, Exception {
...
VerifierHandler verifierHandler = verifier.getVerifierHandler();
super.setContentHandler(verifierHandler);
...
}

so that as the transformer receives SAX events from a generator or another
transfomer, the verifierHandler will also receive them, and if the documents
is not valid and exception will be thrown by the ErrorHandler. But I don't
know why, the super.setContentHandler(verifierHandler) is not working (???)

Oskar


-
Please check that your question  has not already been answered in the
FAQ before posting. 

Re: Schematron transform in a Cocoon pipeline

2003-01-22 Thread Oskar Casquero
Jack,

I also use it to validate uploaded documents. When cocoon receives the
document, first, I check with the parser (inside the generator), that the
document is well formed and valid according to a certain W3C Schema. But
there are some verifications that the W3C Schema can't check, so, for them,
there is a second validation step, in which I use the Schematron which is
embedded in the W3C Schema.

map:match pattern=validationRequest
map:generate src=forms/sendDocument.xml/
map:transform src=stylesheets/wizard2html.xsl/
map:transform src=stylesheets/xmlform2html.xsl/
map:serialize/

/map:match
map:match pattern=validationResponse
map:generate type=myStream
map:parameter name=file-name value=document/
map:parameter name=validation value=true/
/map:generate
map:transform src=cocoon:/schematron2compiledSchematron/
map:transform src=stylesheets/schematronError2error.xsl/
map:transform src=stylesheets/error2html.xsl/
/map:match

map:match pattern=schematron2compiledSchematron
map:generate src=schemas/berta.xsd/
map:transform type=xalan src=stylesheets/getSchematron.xsl/
map:transform type=xalan src=stylesheets/skeleton1-5.xsl/
map:serialize type=xml/
/map:match

Now, as Jeff Turner suggested
(http://marc.theaimsgroup.com/?l=xml-cocoon-usersm=104306512017996w=2),
I'm thinking on moving the W3C Schema validation from the generator to a
transformer (ValidationTransformer), because I had an example where the
validation must be after procesing the document.

Oskar

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 22, 2003 1:24 PM
Subject: Re: Schematron transform in a Cocoon pipeline


 Oskar,

 Excellent suggestion.  The XPATH of the error would be very useful for
 debugging.  What applications of Schematron have you done within Cocoon?
 So far, I'm using it to validate uploaded documents.

 -- jack

 
  Hi Jack,
 
  I have done the same to validate an XML document with an schematron. I
think
  that it would be also useful to get the XPATH path of the errors in the
XML
  output. The template which does this is done in skeleton1-5
(axsl:template
  match=*|@* mode=schematron-get-full-path); so you have to call it
from
  the assert template:
 
  xsl:template match=sch:assert | assert
  xsl:if test=not(@test)
  xsl:messageMarkup Error: no test attribute in
  lt;assert/xsl:message
  /xsl:if
  axsl:choose
  axsl:when test={@test}/
  axsl:otherwise
  error !--my xml output--
  message !--my xml output--
  xsl:call-template name=process-assert
  xsl:with-param name=role select=@role/
  xsl:with-param name=id select=@id/
  xsl:with-param name=test
  select=normalize-space(@test) /
  xsl:with-param name=icon select=@icon/
  xsl:with-param name=subject select=@subject/
  xsl:with-param name=diagnostics
  select=@diagnostics/
  /xsl:call-template
  /message
  location !--my xml output--
  axsl:apply-templates
mode=schematron-get-full-path
  select=self::*/ !--XPATH path of the error--
  /location
  /error
   /axsl:otherwise
  /axsl:choose
  /xsl:template
 
  Oskar
 
  - Original Message -
  From: John R. Callahan [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Tuesday, January 21, 2003 9:58 PM
  Subject: Schematron transform in a Cocoon pipeline
 
 
   This seems too simple, but I wanted to see if I could
   use Schematron generated XSLT to validate some
   XML in a Cocoon pipeline.  This might be used for
   validating uploaded  XML files for example.
  
   I downloaded the latest Schematron skeleton (1.5),
   then generated some XSLT from a set of assertions,
   and then put it into a transform in a pipeline with some
   data:
  
   map:match pattern=*.xml
 map:generate src={1}.xml/
 map:transform src=asserts1.xsl/
 map:serialize type=xml/
   /map:match
  
   !-- build the Schematron generated XSLT --
   map:match pattern=asserts1.xsl
 map:generate src=asserts1.sch/
 map:transform src=skeleton1-5.xsl/
 map:transform src=store.xsl
 map:parameter name=file value=asserts1.xsl/
 map:parameter name=dir value=./
 /map:transform
 map:transform type=write-source/
 map:serialize type=xml/
   /map:match
  
   (see below for the source code for store.xsl)
  
   Unfortunately, the Schematron skeleton puts out plain
   text messages so the output from data1.xml isn't well-formed
   XML.  What I wanted was a series of applicable
   Schematron messages as XML output.  So, I altered
   the skeleton somewhat and now I works!
  
   My alterations to the skeleton were pretty simple:
  
   (1)  Add the following template:
  
   xsl:template 

Re: Schematron transform in a Cocoon pipeline

2003-01-21 Thread Oskar Casquero
Hi Jack,

I have done the same to validate an XML document with an schematron. I think
that it would be also useful to get the XPATH path of the errors in the XML
output. The template which does this is done in skeleton1-5 (axsl:template
match=*|@* mode=schematron-get-full-path); so you have to call it from
the assert template:

xsl:template match=sch:assert | assert
xsl:if test=not(@test)
xsl:messageMarkup Error: no test attribute in
lt;assert/xsl:message
/xsl:if
axsl:choose
axsl:when test={@test}/
axsl:otherwise
error !--my xml output--
message !--my xml output--
xsl:call-template name=process-assert
xsl:with-param name=role select=@role/
xsl:with-param name=id select=@id/
xsl:with-param name=test
select=normalize-space(@test) /
xsl:with-param name=icon select=@icon/
xsl:with-param name=subject select=@subject/
xsl:with-param name=diagnostics
select=@diagnostics/
/xsl:call-template
/message
location !--my xml output--
axsl:apply-templates mode=schematron-get-full-path
select=self::*/ !--XPATH path of the error--
/location
/error
 /axsl:otherwise
/axsl:choose
/xsl:template

Oskar

- Original Message -
From: John R. Callahan [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 21, 2003 9:58 PM
Subject: Schematron transform in a Cocoon pipeline


 This seems too simple, but I wanted to see if I could
 use Schematron generated XSLT to validate some
 XML in a Cocoon pipeline.  This might be used for
 validating uploaded  XML files for example.

 I downloaded the latest Schematron skeleton (1.5),
 then generated some XSLT from a set of assertions,
 and then put it into a transform in a pipeline with some
 data:

 map:match pattern=*.xml
   map:generate src={1}.xml/
   map:transform src=asserts1.xsl/
   map:serialize type=xml/
 /map:match

 !-- build the Schematron generated XSLT --
 map:match pattern=asserts1.xsl
   map:generate src=asserts1.sch/
   map:transform src=skeleton1-5.xsl/
   map:transform src=store.xsl
   map:parameter name=file value=asserts1.xsl/
   map:parameter name=dir value=./
   /map:transform
   map:transform type=write-source/
   map:serialize type=xml/
 /map:match

 (see below for the source code for store.xsl)

 Unfortunately, the Schematron skeleton puts out plain
 text messages so the output from data1.xml isn't well-formed
 XML.  What I wanted was a series of applicable
 Schematron messages as XML output.  So, I altered
 the skeleton somewhat and now I works!

 My alterations to the skeleton were pretty simple:

 (1)  Add the following template:

 xsl:template match=sch:error | error mode=text
  xsl:copy-of select=./
 /xsl:template

 (2) Wrap a sch:results around the / template:

   axsl:template match=/
   sch:results
   xsl:call-template name=process-root
 ...
   /xsl:call-template
   /sch:results
   /axsl:template

 Finally, you must wrap all messages in the .sch file with
 sch:error.../sch:error as follows:

 sch:schema xmlns:sch=http://www.ascc.net/xml/schematron;
 ...
 sch:assert test=(@Title = 'Mr' and Sex = 'Male') or @Title != 'Mr'
   sch:errorIf the Title is Mr then the sex of the person must be
Male./sch:error
 /sch:assert
 ...
 /sch:schema

 Enjoy!

 -- jack


 (The XSLT file store.xsl is my own brew to wrap an
 element around the input source for use by the subsequent
 SourceWriterTransformer:

 ?xml version=1.0 encoding=UTF-8?
 !-- CVS: $Id: store.xsl,v 1.1 2002/12/16 11:04:11 callahan Exp $ --

 xsl:stylesheet version=1.0
xmlns:xsl=http://www.w3.org/1999/XSL/Transform;

 xsl:param name=file select='foo'/
 xsl:param name=dir select='foo'/

 xsl:template match=/
 source:write xmlns:source=http://apache.org/cocoon/source/1.0;
  source:sourcexsl:value-of select=$dir//xsl:value-of
select=$file//source:source
  source:fragment
  xsl:copy-of select=./
  /source:fragment
 /source:write
 /xsl:template

 /xsl:stylesheet
 )



 -
 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]




serializing inside a transformer

2003-01-20 Thread Oskar Casquero



Hi,

I would like toserializeSAX events to a 
file inside a transformer, so that I can validate the file with the parser. The 
problem is that I don't how to set theserializer in order to make it able 
to receive the SAX events which the transformer is receiving from the previous 
component (a generator or another transformer). Here is a code snippet that 
shows what I'm trying to do:

public class MyValidationTransformer extends AbstractSAXTransformer {
 XMLSerializer 
serializer = (XMLSerializer) this.manager.lookup(XMLSerializer.ROLE);
FileOutputStream fos=new 
FileOutputStream(/tmp/tmp.xml);
 serializer.setOutputStream(fos);
 /*??? 
  HOW TO SEND THE SAX EVENTS THE 
TRANSFORMER IS RECEIVING TO THE SERIALIZER 
 *???/
FileInputStream fis=new 
FileInputStream(/tmp/tmp.xml);
InputSource is=new InputSource(fis);
 Parser parser = 
(Parser)this.manager.lookup(Parser.ROLE);
 boolean validation = 
parameters.getParameterAsBoolean("validation", false);
 parser.myParse(this.inputSource, super.xmlConsumer, 
validation);
}
Oskar


Re: serializing inside a transformer

2003-01-20 Thread Oskar Casquero
I agree with you. I thought that using a serializer would be useful to get
an input source for the parser. But now I see that it would be much better
to use JARV to develop the transformer based only in SAX events (use 4_2 of
JARV), as you suggested.

I have another question, which is the same I did before: how do I set the
VerifierHandler of JARV in order to send to it the SAX events the
transformer is receiving from the previous component? With
super.setContentHandler(verifierHandler), perhaps?

public class ValidationTransformer extends AbstractSAXTransformer {
...
super.setContentHandler(verifierHandler);
...
}

Thank you
Oskar



- Original Message -
From: Jeff Turner [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, January 20, 2003 1:22 PM
Subject: Re: serializing inside a transformer


 On Mon, Jan 20, 2003 at 01:00:41PM +0100, Oskar Casquero wrote:
  Hi,
 
  I would like to serialize SAX events to a file inside a transformer, so
  that I can validate the file with the parser. The problem is that I
  don't how to set the serializer in order to make it able to receive the
  SAX events which the transformer is receiving from the previous
  component (a generator or another transformer).

 How about inheriting from DOMTransformer, and then (if possible)
 validate the DOM directly, or use o.a.c.xml.XMLUtils#serializeNode() to
 get a String which you can validate?

 It's a nasty hack though.  Best way would be to write a
 ValidatorTransformer that validates SAX events as they go past:

 http://iso-relax.sourceforge.net/JARV/JARV.html#use_42


 --Jeff

 ...
  Oskar

 -
 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]




how to connect two pipelines in cocoon?

2002-12-17 Thread Oskar Casquero
Hello,

I have the following pipelines in cocoon:

!-- This pipeline generates an XML document from an structured text
file --
map:match pattern=MAST_TXT2MAST_XMLresponse
map:act type=fileUploadAction
map:parameter name=file-name value=mast/
map:generate type=textparser src={src}
map:parameter name=grammar value=cocoon:/mast-out.grm/
map:parameter name=includeignorabletokens value=true/
/map:generate
map:transform src=stylesheets/chaperon2mastXML.xsl/
map:serialize type=text/
/map:act
/map:match

!-- This pipeline stores an XML document in eXist database using the xmldb
logicsheet--
map:match pattern=eXistAdmin
map:generate type=serverpages src=serverpages/xadmin.xsp/
map:transform src=stylesheets/doc2html.xsl/
map:serialize type=xhtml/
/map:match

I want to store the XML file in the database, so I would like to connect the
first pipeline with the second one, creating a chain, where the first
pipeline's output SAX events feed the second pipeline's generator. How can I
do this?

Thank you,
Oskar


-
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: How may I get the FilePart object ?

2002-12-04 Thread Oskar Casquero



The FilePart object represents the uploaded file. 
Depending on how you configure "autosave-upload" parameter in WEB-INF/web.xml 
cocoon returns a FilePartFile (the file is written to disk; 
autosave-upload=true) or a FilePartArray (the file is in memory; 
autosave-upload=false).Here is the code snippet I add to the 
StreamGenerator to manage multipart http requests:Request req = 
ObjectModelHelper.getRequest(objectModel);} else if 
(contentType.startsWith("multipart/form-data")) { String 
myParameter = parameters.getParameter(FILE_NAME, null); if 
(myParameter == null) { throw new 
ProcessingException("StreamGenerator expects a sitemap parameter called '" + 
FILE_NAME + "' for handling form data"); } 
 FilePart filePart = (FilePart)req.get(myParameter); 
/* or FilePartArray filePart = (FilePartArray)req.get(myParameter); 
*/ InputStream is = 
filePart.getInputStream(); inputSource = new 
InputSource(is);
This only works with autosave-upload=false, so the FilePart object is a 
FilePartArray object. If you want want to save the file in the disk you must 
turn on autosave-uploading and do this:
 FilePartFile filePart = 
(FilePartFile)req.get(myParameter); InputStream is = 
filePart.getInputStream(); inputSource = new 
InputSource(is);

Oskar- Original Message - From: 
[EMAIL PROTECTED]To: 
[EMAIL PROTECTED]Sent: Wednesday, December 04, 2002 5:04 
PMSubject: How may I get the FilePart object ? 
 Hi !   I'm trying to 
use automatic upload with cocoon 2.0.3 (with jboss, jetty, Linux red 
hat). I've read that cocoon uploads the file and puts a FilePart object 
inside the request.  So my question is : How can 
I get this object inside my Java code ?  
 Michael 
- 
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: How may I get the FilePart object ?

2002-12-04 Thread Oskar Casquero
The FilePart object represents the uploaded file. Depending on how you
configure autosave-upload parameter in WEB-INF/web.xml cocoon returns a
FilePartFile (the file is written to disk; autosave-upload=true) or a
FilePartArray (the file is in memory; autosave-upload=false).

Here is the code snippet I add to the StreamGenerator to manage multipart
http requests:

Request req = ObjectModelHelper.getRequest(objectModel);

} else if (contentType.startsWith(multipart/form-data)) {
String myParameter = parameters.getParameter(FILE_NAME, null);
if (myParameter == null) {
throw new ProcessingException(StreamGenerator expects a sitemap
parameter called ' + FILE_NAME + ' for handling form data);
}
FilePart filePart = (FilePart)req.get(myParameter);  /* or FilePartArray
filePart = (FilePartArray)req.get(myParameter); */
InputStream is = filePart.getInputStream();
inputSource = new InputSource(is);

This only works with autosave-upload=false, so the FilePart object is a
FilePartArray object. If you want want to save the file in the disk you must
turn on autosave-uploading and do this:

FilePartFile filePart = (FilePartFile)req.get(myParameter);
InputStream is = filePart.getInputStream();
inputSource = new InputSource(is);

Oskar

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 04, 2002 5:04 PM
Subject: How may I get the FilePart object ?



 Hi !


 I'm trying to use automatic upload with cocoon 2.0.3 (with jboss, jetty,
 Linux red hat).
 I've read that cocoon uploads the file and puts a FilePart object inside
the
 request.

 So my question is :
 How can I get this object inside my Java code ?


Michael




 -
 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: Weird Saxon errors

2002-11-18 Thread Oskar Casquero
Jeremy, I have got exactly the same problem when I use saxon 6.5.2 with
cocoon 2.0.3 or cocoon 2.1 (invalid processing instruction name
(saxon:warning) at line 13 column -1 (what column is that?)). I have
configured saxon role in the same way as you (as described in
http://outerthought.net/wiki/Wiki.jsp?page=DocbookTransformation) and I know
that the xslt stylesheet is correct because I have tested it with xalan.

Does anyone know how to solve this problem?

Oskar

- Original Message -
From: Jeremy Quinn [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, November 16, 2002 3:26 PM
Subject: Weird Saxon errors


 I just switched to using Saxon 6.5.2 with Cocoon 2.1-dev as lots of
 people say it is faster than xalan and xsltc.

 I get lots of strange errors in my stylesheets, that I cannot work out.
 These are stylesheets that are largely trivial, and work fine in Xalan
 and XSLTC.

 Has anyone else noticed this kind of behaviour?

 Example:

 org.apache.cocoon.ProcessingException: Could not read resource
 file:/Users/jermq/Library/TomCat/webapps/cocoon/iniva/parts/components/
 meta-data.xml:
 file:/Users/jermq/Library/TomCat/webapps/cocoon/iniva/parts/xsl/macro-
 filter.xsl:12:-1:javax.xml.transform.TransformerException: Invalid
 processing instruction name (saxon:warning)

 this is line 12, column -1 (sic)

 ?xml version=1.0?

 xsl:stylesheet version=1.0
 xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns:saxon=http://icl.com/saxon;
 exclude-result-prefixes=saxon
  

 xsl:param name=idref/

 xsl:template match=doc
 xsl:apply-templates select=macro[@id=$idref]/*/
 /xsl:template

xsl:template match=@*|node()
 priority=-2xsl:copyxsl:apply-templates
 select=@*|node()//xsl:copy/xsl:template
xsl:template match=text() priority=-1xsl:value-of
 select=.//xsl:template

 /xsl:stylesheet

 Where line 12 is:

 xsl:template match=@*|node()
 priority=-2xsl:copyxsl:apply-templates
 select=@*|node()//xsl:copy/xsl:template

 Do What???
 There is nothing wrong with this line according to the other XSLT
 engines.
 Invalid processing instruction??


 This is my config:

 in cocoon.xconf:

xslt-processor logger=core.xslt-processor
   parameter name=use-store value=false/
   parameter name=incremental-processing value=true/
/xslt-processor

component
  role=org.apache.cocoon.components.xslt.XSLTProcessor/Saxon
  class=org.apache.cocoon.components.xslt.XSLTProcessorImpl
  logger=core.xslt-processor
 parameter name=use-store value=true/
 parameter name=incremental-processing value=false/
 parameter name=transformer-factory
  value=com.icl.saxon.TransformerFactoryImpl/
/component

 in sitemap.xmap:

 map:transformer logger=sitemap.transformer.saxon name=saxon
pool-grow=2 pool-max=32 pool-min=8
 src=org.apache.cocoon.transformation.TraxTransformer
   use-request-parametersfalse/use-request-parameters
   use-browser-capabilities-dbfalse/use-browser-capabilities-db
   xslt-processor-role
  org.apache.cocoon.components.xslt.XSLTProcessor/Saxon
/xslt-processor-role
 /map:transformer


 Any suggestions would be gratefully accepted.

 regards Jeremy


 -
 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]




XSLT processor problems

2002-11-18 Thread Oskar Casquero




Hello,

I have done a simple pipeline in cocoon that 
applies some transformations to an xml document and obtains a text 
document:

map:match pattern="MAST"
 map:generate 
src=""/
 map:transform 
src=""/
 map:serialize 
type="text"/
/map:match

Depending on the cocoon version, the result is 
different:

1) When the pipeline is included in cocoon 
2.0.3the resultis the expectedone.
2) When the pipeline is included in cocoon 2.1-dev 
(not updated),itloststhe followingtransformation 
rule:
xsl:output omit-xml-declaration="yes"/ 

 despite I have selected xalan as 
the xslt processor (the default xslt processor in cocoon 2.1-dev is 
xsltc).
3) When the pipeline is included in cocoon 2.1-dev 
(updated),the previous transformation rule and the following one are not 
applied:
 xsl:variable 
name="pe"![CDATA[]]/xsl:variable
 xsl:value-of 
disable-output-escaping="yes" select="$pe"/ 

So, the three different versions of cocoon I use, 
give me three different results. This not only happens with my xslt stylsheets: 
cocoon's(2.1-dev, not updated) xmlform2html.xsl doesn't workin the 
updated version. And when I tried to configure 
saxon, it doesn't work (http://marc.theaimsgroup.com/?l=xml-cocoon-usersm=103761165124303w=2). 
What can I do?

Oskar


Re: Weird Saxon errors

2002-11-18 Thread Oskar Casquero
Here you have XML/XSLT combination. Can you tell me the steps you followed
to setup saxon role?

Thanks,
Oskar

- Original Message -
From: SAXESS - Hussayn Dabbous [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, November 18, 2002 11:40 AM
Subject: Re: Weird Saxon errors


 Hy;

 I got exactly the same problems as you describe. Finnally i managed
 to setup my system for operation. Unfortunately i had lots of
 interconnected problems, so i can't tell you, what finally solved
 exactly the problem, you are describing.
 I had a look into your problem, but couldn't reprocuce it so far
 from the data in your email. But if you send me a small XML/XSLT
 combination that triggers this problem, i will check this against my
 cocoon-2.0.3/saxon-6.5.2 setup and uncover the cause of the problem.

 This is, what i can offer so far.

 regards, hussayn

 Oskar Casquero wrote:
  Jeremy, I have got exactly the same problem when I use saxon 6.5.2 with
  cocoon 2.0.3 or cocoon 2.1 (invalid processing instruction name
  (saxon:warning) at line 13 column -1 (what column is that?)). I have
  configured saxon role in the same way as you (as described in
  http://outerthought.net/wiki/Wiki.jsp?page=DocbookTransformation) and I
know
  that the xslt stylesheet is correct because I have tested it with xalan.
 
  Does anyone know how to solve this problem?
 
  Oskar
 
  - Original Message -
  From: Jeremy Quinn [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Saturday, November 16, 2002 3:26 PM
  Subject: Weird Saxon errors
 
 
 
 I just switched to using Saxon 6.5.2 with Cocoon 2.1-dev as lots of
 people say it is faster than xalan and xsltc.
 
 I get lots of strange errors in my stylesheets, that I cannot work out.
 These are stylesheets that are largely trivial, and work fine in Xalan
 and XSLTC.
 
 Has anyone else noticed this kind of behaviour?
 
 Example:
 
 org.apache.cocoon.ProcessingException: Could not read resource
 file:/Users/jermq/Library/TomCat/webapps/cocoon/iniva/parts/components/
 meta-data.xml:
 file:/Users/jermq/Library/TomCat/webapps/cocoon/iniva/parts/xsl/macro-
 filter.xsl:12:-1:javax.xml.transform.TransformerException: Invalid
 processing instruction name (saxon:warning)
 
 this is line 12, column -1 (sic)
 
 ?xml version=1.0?
 
 xsl:stylesheet version=1.0
 xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns:saxon=http://icl.com/saxon;
 exclude-result-prefixes=saxon
  
 
 xsl:param name=idref/
 
 xsl:template match=doc
 xsl:apply-templates select=macro[@id=$idref]/*/
 /xsl:template
 
xsl:template match=@*|node()
 priority=-2xsl:copyxsl:apply-templates
 select=@*|node()//xsl:copy/xsl:template
xsl:template match=text() priority=-1xsl:value-of
 select=.//xsl:template
 
 /xsl:stylesheet
 
 Where line 12 is:
 
 xsl:template match=@*|node()
 priority=-2xsl:copyxsl:apply-templates
 select=@*|node()//xsl:copy/xsl:template
 
 Do What???
 There is nothing wrong with this line according to the other XSLT
 engines.
 Invalid processing instruction??
 
 
 This is my config:
 
 in cocoon.xconf:
 
xslt-processor logger=core.xslt-processor
   parameter name=use-store value=false/
   parameter name=incremental-processing value=true/
/xslt-processor
 
component
  role=org.apache.cocoon.components.xslt.XSLTProcessor/Saxon
  class=org.apache.cocoon.components.xslt.XSLTProcessorImpl
  logger=core.xslt-processor
 parameter name=use-store value=true/
 parameter name=incremental-processing value=false/
 parameter name=transformer-factory
  value=com.icl.saxon.TransformerFactoryImpl/
/component
 
 in sitemap.xmap:
 
 map:transformer logger=sitemap.transformer.saxon name=saxon
pool-grow=2 pool-max=32 pool-min=8
 src=org.apache.cocoon.transformation.TraxTransformer
   use-request-parametersfalse/use-request-parameters
   use-browser-capabilities-dbfalse/use-browser-capabilities-db
   xslt-processor-role
  org.apache.cocoon.components.xslt.XSLTProcessor/Saxon
/xslt-processor-role
 /map:transformer
 
 
 Any suggestions would be gratefully accepted.
 
 regards Jeremy
 
 
 -
 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]
 

 --
 Dr. Hussayn Dabbous
 SAXESS Software Design GmbH
 Neuenhöfer Allee 125
 50935 Köln
 Telefon: +49-221-56011-0
 Fax: +49-221-56011-20
 E-Mail:  [EMAIL PROTECTED

how to lock a pipeline?

2002-11-18 Thread Oskar Casquero



Hello,

Does anyone know if it is possible to lock the 
access to a pipeline while that pipeline is being executed? I want to use a 
pipeline as a shared resource: when a user calls that pipeline from the browser, 
thepipeline is locked untilit finish its execution and then 
itisunlocked, being available again for another user. Can this be 
done in an action?

Oskar


Re: Weird Saxon errors

2002-11-18 Thread Oskar Casquero
With cocoon-2.0.3 the transformation works correctly (I don't have to change
anything in cocoon). The problem appears with cocoon 2.1-dev, because some
transformation rules are not correctly applied (xsltc processor bug?).
That's why I want to change to saxon. I would like to know which steps you
followed when setting up saxon role (I do what is explained in
http://outerthought.net/wiki/Wiki.jsp?page=DocbookTransformation, but
perhaps there is something else I must do) in order to avoid
'saxon:warning'.

Thank you
Oskar


- Original Message -
From: SAXESS - Hussayn Dabbous [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, November 18, 2002 1:50 PM
Subject: Re: Weird Saxon errors


 Hy;

 Your stylesheet produces plain text as output. This seems to be
 a problem for cocoon transformers. I don't know, if this behaviour
 is a feature, or a bug. (Maybe the developers can tell us ;-) ?
 But here is the solution as it works on my site:


 1.) Add following template to your stylesheet:

  xsl:template match=/
   xml
xsl:apply-templates/
   /xml
  /xsl:template

  You also can omit the omit-xml-declaraion in your stylesheet:

!--xsl:output omit-xml-declaration=yes/--

  Yes, your file has been reXMLized by now, but look further down...


 2.) Add just another serializer to your sitemap:

  map:serializers default=html
map:serializer
 logger=sitemap.serializer.text
 mime-type=text/plain name=plain
 src= org.apache.cocoon.serialization.TextSerializer
/
  /map:serializers

  The text-serializer declared on the main sitemap does not work for
  me (in conjunction with mozilla). It only produces empty lines of
  text. I think, it is because of the mime-type declaration
  text/text. I took a verbatim copy from the default text
  serializer and changed the mime type to text/plain. This works
  for me.

 3.) Add the following matcher into your sitemap:

  map:match pattern=go
map:generate  src  = Robot_Teleoperado.xml/
map:transform type=xslt src = xml2txt.xsl/
map:serialize type = plain/
  /map:match


  Now, when you enter go, you get a plain text as result into your
  browser. When applying save you get a nice plain text file as
  result (no more XML in it ;-) )


 If there is a better solution, i'd like to hear about it.
 I'm interested, if this helps to fix your problem, and if this
 is something for the HOWTO docs ;-)

 regards, hussayn

 Oskar Casquero wrote:
  Here you have XML/XSLT combination. Can you tell me the steps you
followed
  to setup saxon role?
 
  Thanks,
  Oskar
 
  - Original Message -
  From: SAXESS - Hussayn Dabbous [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Monday, November 18, 2002 11:40 AM
  Subject: Re: Weird Saxon errors
 
 
 
 Hy;
 
 I got exactly the same problems as you describe. Finnally i managed
 to setup my system for operation. Unfortunately i had lots of
 interconnected problems, so i can't tell you, what finally solved
 exactly the problem, you are describing.
 I had a look into your problem, but couldn't reprocuce it so far
 from the data in your email. But if you send me a small XML/XSLT
 combination that triggers this problem, i will check this against my
 cocoon-2.0.3/saxon-6.5.2 setup and uncover the cause of the problem.
 
 This is, what i can offer so far.
 
 regards, hussayn
 
 Oskar Casquero wrote:
 
 Jeremy, I have got exactly the same problem when I use saxon 6.5.2 with
 cocoon 2.0.3 or cocoon 2.1 (invalid processing instruction name
 (saxon:warning) at line 13 column -1 (what column is that?)). I have
 configured saxon role in the same way as you (as described in
 http://outerthought.net/wiki/Wiki.jsp?page=DocbookTransformation) and I
 
  know
 
 that the xslt stylesheet is correct because I have tested it with
xalan.
 
 Does anyone know how to solve this problem?
 
 Oskar
 
 - Original Message -
 From: Jeremy Quinn [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Saturday, November 16, 2002 3:26 PM
 Subject: Weird Saxon errors
 
 
 
 
 I just switched to using Saxon 6.5.2 with Cocoon 2.1-dev as lots of
 people say it is faster than xalan and xsltc.
 
 I get lots of strange errors in my stylesheets, that I cannot work
out.
 These are stylesheets that are largely trivial, and work fine in Xalan
 and XSLTC.
 
 Has anyone else noticed this kind of behaviour?
 
 Example:
 
 org.apache.cocoon.ProcessingException: Could not read resource

file:/Users/jermq/Library/TomCat/webapps/cocoon/iniva/parts/components/
 meta-data.xml:
 file:/Users/jermq/Library/TomCat/webapps/cocoon/iniva/parts/xsl/macro-
 filter.xsl:12:-1:javax.xml.transform.TransformerException: Invalid
 processing instruction name (saxon:warning)
 
 this is line 12, column -1 (sic)
 
 ?xml version=1.0?
 
 xsl:stylesheet version=1.0
 xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 xmlns:xsi=http://www.w3.org/2001

two components implementing parser role?

2002-11-13 Thread Oskar Casquero



Hello,

I would like to know if it is posible to define two 
components that implement parser role: one ofwould be the default parser 
of cocoon (with its default configuration) and the other would use xerces parser 
but with the validation feature turned on (I'm thinking of looking up the 
validating parser only in my own components). What I want to do is similar to 
the case of generators: there is one generator role and several components 
implementing this role. The problem is that while different type of generators 
are defined in the sitemap, a unique parser is defined for all cocoon components 
in cocoon.xconf, so whena parser is looked up inside a component (for 
example, a generator) there is only one choice. Do you know any solution or 
alternative to this?

Oskar


Re: xml version procesing instruction and text serializer?

2002-11-11 Thread Oskar Casquero
I've included it and the xml declaration still appears. Do you know if the
omit-xml-declaration parameter is also valid for the text serializer?

Oskar

- Original Message -
From: Ryan Agler [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, November 05, 2002 8:09 PM
Subject: RE: xml version procesing instruction and text serializer?


In your XSLT file, right under xsl:stylesheet, include:

xsl:output omit-xml-declaration=yes method=text /

-Original Message-
From: Oskar Casquero [mailto:jtacaoio;bi.ehu.es]
Sent: Tuesday, November 05, 2002 11:31 AM
To: [EMAIL PROTECTED]
Subject: xml version procesing instruction and text serializer?

I want to obtain a text file (not xml) from an XSLT transformation. The
problem is that after doing the transformation and serializing the
result with a text serializer, the ?xml version=1.0? processing
instruction appears at the beginning of the text file, so I have to
delete it manually. Do I have to modify text serializer or is there
another way to delete the ?xml version=1.0? processing instruction?

Oskar

-
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: File upload with Cocoon

2002-11-08 Thread Oskar Casquero
And what can I do to disable cocoon's automatic file uploading? I want to
send files to cocoon but not to save them in disk
And another question about
http://outerthought.net/wiki/Wiki.jsp?page=FileUploadWithAction I've seen
that the example uses

Request request = ObjectModelHelper.getRequest(objectModel);
FilePartFile filePartFile = (FilePartFile)request.get(uploadfile);

to get the FilePartFile object. If I change the second line in order to get
a FilePartArray it doesn't work. Do you know any solution?

Thanks
Oskar

- Original Message -
From: Ray Martin [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, November 08, 2002 1:40 PM
Subject: RE: File upload with Cocoon


 Sir,

 Someone pointed out to me that Cocoon handles file uploading for you.  I
was
 rather skeptical - but, i just tried it and it works.

 On client machine, i used a browser and my form with an
 enctype=multipart/form-data, an HTML INPUT tag of type file, and an HTML
 INPUT of type submit.

 Of course, your pipeline answers the match for handling the form.
 And guess what, the file is sitting on my server at c:\program
files\apache
 group\tomcat 4.1\work\standalone\localhost\cocoon\cocoon-files\upload-dir.

 IT'S A BEAUTIFUL THING.

 But, ya know, it is just like i tell the folks that i work with - You may
 have done the greatest things, but unless you can tell others (written)
 about what you have done - you have done nothing.

 Having found the hidden gem, my next step is to take the form data and
place
 it into an email body and attach the uploaded file to the email and send
it
 on its way.

 It is gonna take me longer to find out how to do it than what it will take
 for me to actually do it.

 good luck, Sir,

 Ray

  -Original Message-
  From: Volker Schneider [mailto:volker.schneider;danet.de]
  Sent: Friday, November 08, 2002 4:15 AM
  To: [EMAIL PROTECTED]
  Subject: File upload with Cocoon
 
 
  Dear colleagues,
 
  does anybody know how I can do a file upload using the html input
  type=file ../ tag?
 
  Do you have an example pipeline?
  What shall I do with the result?
  Where can I get the content of the selected file from?
 
  Thank you, best regards
  - Volker -
 
 
  -
  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]



-
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: Reference to a servlet in sitemap

2002-11-07 Thread Oskar Casquero
I'm very interested in this because I want to use some classes than only
work well with servlet's HttpServlet Request and not with cocoon's
HttpServletRequest request = (HttpServletRequest)
objectModel.get(HttpEnvironment.HTTP_REQUEST_OBJECT);

I've read in cocoon wiki that the servlet must produce XML, but how?
serialized into the ServeltOutputStream?

Oskar
- Original Message -
From: Mauro Daniel Ardolino [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, November 07, 2002 6:55 PM
Subject: RE: Reference to a servlet in sitemap


 Thanks a lot!  That is what I wanted.

 Mauro

 On Thu, 7 Nov 2002, Leigh Dodds wrote:

  I added a HOW-TO about this to the Cocoon Wiki a while back.
  Here's the reference:
 
  http://outerthought.net/wiki/Wiki.jsp?page=IntegrateAServlet
 
  It was based on some conversations in this mailing list.
 
  Hope it helps,
 
  L.
 
   -Original Message-
   From: Mauro Daniel Ardolino [mailto:mauro;altersoft.com.ar]
   Sent: 07 November 2002 14:59
   To: [EMAIL PROTECTED]
   Subject: Reference to a servlet in sitemap
  
  
   Hi! I have tried to reference a servlet in sitemap without success.  I
   searched in the web and in the mails an haven't found an answer.
  
   I have to program a servlet (e.g. a simple servlet that throws a
html).
   So I configured the servlet in the web.xml file.
   Then, because I'm using cocoon, I have to configure a match in the
   sitemap.
   I do not know how to do it.  I've tried everything.
   Help please!
  
   Thanks.
  
   Mauro
  
   --
   Ing.Mauro Daniel Ardolino
   Departamento de Desarrollo y Servicios
   Altersoft
   Billinghurst 1599 - Piso 9
   C1425DTE - Capital Federal
   Tel/Fax: 4821-3376 / 4822-8759
   mailto: [EMAIL PROTECTED]
   website: http://www.altersoft.com.ar
  
  
  
   -
   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]
 
 

 --
 Ing.Mauro Daniel Ardolino
 Departamento de Desarrollo y Servicios
 Altersoft
 Billinghurst 1599 - Piso 9
 C1425DTE - Capital Federal
 Tel/Fax: 4821-3376 / 4822-8759
 mailto: [EMAIL PROTECTED]
 website: http://www.altersoft.com.ar


 -
 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]




HttpServletRequest

2002-11-07 Thread Oskar Casquero




Hi,

Is there any alternative to HttpServletRequest request = (HttpServletRequest) 
objectModel.get(HttpEnvironment.HTTP_REQUEST_OBJECT); ? 
What type of object does objectModel.get(HttpEnvironment.HTTP_REQUEST_OBJECT) 
return? I'm having 
problems with this declaration and I think that servlet's HttpServletRequest and 
HttpServletRequest request = (HttpServletRequest) 
objectModel.get(HttpEnvironment.HTTP_REQUEST_OBJECT); aren't 
totally equivalent. Do you agree?

Thanks,
Oskar


xml version procesing instruction and text serializer?

2002-11-05 Thread Oskar Casquero



I want to obtain a text file (not xml) from an XSLT 
transformation. The problem is that after doing the transformation and 
serializing the result with a text serializer, the ?xml version="1.0"? processing instruction appears at the 
beginning of the text file,so I have to delete it manually.Do I have 
to modify text serializer or is there another way to delete the ?xml 
version="1.0"? processing instruction?

Oskar 


StreamGenerator again

2002-10-30 Thread Oskar Casquero



Hello,

I'm trying to modify StreamGenerator so it can 
accept "multipart" content-type in HTTP request. To do it I'm using "marsh" 
project classes (in sourceForge.net). 

I've used them in a test servlet and they work 
well, but when I copy the code in the StreamGenerator it doesn't work. I've copy 
"marsh.jar" and new "cocoon-2.1-dev.jar" (with the new StreamGeneretor 
inside)to cocoon/WEB-INF/lib directory,and I thinkthat the 
problem is that cocoon doesn't recognise "marsh.jar", because I get the same 
input even ifI don't copy "marsh.jar"to WEB-INF/lib 
directory.What can I do to solve this problem?

Oskar


jar files in cocoon/WEB-INF/lib

2002-10-30 Thread Oskar Casquero



Hello,

When a jar file is saved in cocoon/WEB-INF/lib 
directory, does cocoonconfigure it automatically, or do I have to do 
something else (in cocoon.xconf, ...)? I've done a generator that needs some 
classes stored in a jar file, but it seems like if it is not using 
them.

Oskar


XercesParser

2002-10-30 Thread Oskar Casquero



Hello,

I´vemodifiedXercesParserin order 
to turn on validation, but when I configure it in cocoon.xconf, I can't start 
cocoon. I've seen that this class deprecated and that cocoon uses avalon's 
XercesParser. So, how can I turn on validation?

Oskar


xml document validation against schema or dtd

2002-10-29 Thread Oskar Casquero



Hello,

Has anybody tried to implement xml document 
validation in cocoon? I can'tconfigure validation in cocoon.xconf, because 
cocoon needs a grammar when this feature is setup. So, I would like to know if 
it is a good idea to build a component that doesthe validation, and in 
this case, which component (generator, transformer, ...)is the 
best.

Oskar


Re: pipeline problem

2002-10-25 Thread Oskar Casquero
Finally I've found the problem in one of my own stylesheets. The protocol
cocoon:/ inside the src attribute of the map:transform elements works
well on cocoon-2.1-dev

Oskar

- Original Message -
From: Omar Tazi [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, October 30, 2002 6:38 PM
Subject: Re: pipeline problem


 If you are interested in XML Pipelines and XML transformation, check
 out: http://www.orbeon.com/oxf/whitepaper.xhtml

 Regards,

 -ot

 Jeremy Quinn wrote:
 
  Have a look at the 'editor' sample in Cocoon 2.1.dev, it does exactly
this.
 
  regards Jeremy
 
  On Thursday, Oct 24, 2002, at 20:27 Europe/London, Oskar Casquero wrote:
 
  Hello,
 
  Is it possible to call a pipeline, that returns SAX events
  representing an stylesheet, from the src attribute of a
  map:transform element? I'm trying to do it in the following pipeline
  but it doesn't work.
 
  map:match pattern=schematronValidationResponse
 
  map:generate type=stream
 
  map:parameter name=form-name value=document/
 
  /map:generate
 
  map:transform src=cocoon:/schematron2compiledSchematron/
 
  map:serialize type=xml/
 
  /map:match
 
 
 
  map:match pattern=schematron2compiledSchematron
 
  map:generate src=schemas/berta.xsd/
 
  map:transform src=stylesheets/schematron.xsl/
 
  map:transform src=stylesheets/skeleton1-5.xsl/
 
  /map:match
 
  Oskar
 
 
 
  -
  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]



-
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]




pipeline problem

2002-10-24 Thread Oskar Casquero



Hello,

Is it possible to call a pipeline, that 
returnsSAX events representing an stylesheet, fromthe "src" 
attribute of a map:transform element? I'm trying to do it in the 
following pipeline but it doesn't work.

map:match pattern="schematronValidationResponse"
 map:generate type="stream"
  map:parameter name="form-name" 
value="document"/
 /map:generate
 map:transform 
src="cocoon:/schematron2compiledSchematron"/
 map:serialize type="xml"/
/map:match

map:match pattern="schematron2compiledSchematron"
 map:generate src="schemas/berta.xsd"/
 map:transform 
src="stylesheets/schematron.xsl"/
 map:transform 
src="stylesheets/skeleton1-5.xsl"/
/map:match
Oskar


XML instance validation

2002-10-23 Thread Oskar Casquero



Hello,

I would like to configure validation (against 
anXML schema)in some pipelines. When I turn on the validation 
feature of the parser in cocoon.xconf, I'm asked for the sitemapgrammar, 
even if the sitemap doesn't refer to any schema or DTD.I modify the 
sitemap in order to do the validation against sitemap-2.1-draft.xsd, but it 
doesn't work because of the different namespaces (1.0 in the sitemap and 2.0 in 
the schema). So,is this the correct way to activate validation in cocoon? 
And if it is, where canI find the correct schema for my sitemap? Or do I 
have to setthe validation insidethe pipeline, maybe with 
anaction, an XSP or my own "ValidationGenerator", instead of in 
cocoon.xconf?

Oskar




XML instance validation

2002-10-23 Thread Oskar Casquero



Hello,

I would like to configure validation (against 
anXML schema)in some pipelines. When I turn on the validation 
feature of the parser in cocoon.xconf, I'm asked for the sitemapgrammar, 
even if the sitemap doesn't refer to any schema or DTD.I modify the 
sitemap in order to do the validation against sitemap-2.1-draft.xsd, but it 
doesn't work because of the different namespaces (1.0 in the sitemap and 2.0 in 
the schema). So,is this the correct way to activate validation in cocoon? 
And if it is, where canI find the correct schema for my sitemap? Or do I 
have to setthe validation insidethe pipeline, maybe with 
anaction, an XSP or my own "ValidationGenerator", instead of in 
cocoon.xconf?

I also need to use the schematron validation in my 
application. I´ve done a pipelinefor obtaining a compiledschematron 
from an schematron, and another one to apply itto an XML document, but I 
would like to know if cocoons support this type of validation with its own 
components.

Oskar




simple question about StreamGenerator

2002-10-21 Thread Oskar Casquero



What does the "form-name" parameter mean in the 
context of the Stream Generator?

Oskar


question about uploading

2002-10-18 Thread Oskar Casquero



Hello,

I want to upload an xml file to cocoon in order to 
apply some transformations to it. I have seen upload.xsp example, but I don't 
wantto save the file in the server, just take the input stream in the http 
request and pass it to a transformer. How could it be done?

Oskar


Re: question about uploading

2002-10-18 Thread Oskar Casquero
Where is that UploadAction.java? I can't find it.

Oskar

- Original Message -
From: Sreenivasan N. [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, October 18, 2002 1:03 PM
Subject: Re: question about uploading


 Hi

 Can you tell me what to do after downloading that UploadAction.java. When
i
 try to compile i was getting error. Can you give us the step to be done to
 work with that code.

 Thanks in advance
 Regards
 Sreenivasan.

 At 12:55 PM 10/18/02 +0200, you wrote:
 There is a mail in the mail-archive with an Action code that does what
 you want.
 
 Have a Look
 
 Martin
 
   [EMAIL PROTECTED] Freitag, 18. Oktober 2002 12:48:59 
 Hello,
 
 I want to upload an xml file to cocoon in order to apply some
 transformations to it. I have seen upload.xsp example, but I don't want
 to save the file in the server, just take the input stream in the http
 request and pass it to a transformer. How could it be done?
 
 Oskar
 
 -
 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]








 Attitudes are much more important than aptitudes.
 Nothing is impossible for a willing heart

 Sreenivasan N.
 Sony SARD
 Ext 5816

 Email. [EMAIL PROTECTED]
 Per: [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]



-
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]




how to create an xml document with XMLForm

2002-08-22 Thread Oskar Casquero




Hi,

I would like to use XMLFormto collect data 
through a wizard andsavedata in a DOM tree (bindingforms to 
DOM nodes). How can be produced SAX events from this DOM 
tree?

Thanks,
 
Oskar