Oi :)
Try adding to your xml header this : encoding="ISO-8859-1" ?>
It might do the trick.

Greetings,
CarlosN.

On Mon, 6 Jun 2005, pedrosacosta wrote:

Hi, i hope this is the place to send my xsp doubt.

I've difficulty to understand what's wrong with my xsp code, and i already 
looked to the documentation of the xsp, in the net and in a book. But, i still 
have the problem. this is my xsp file:

<?xml version="1.0"?>

<xsp:page language="java"                                       
xmlns:xsp="http://apache.org/xsp";
                                       
xmlns:xsp-request="http://apache.org/xsp/request/2.0";>

<xsp:logic>
       StringBuffer buf = new StringBuffer();
       CharSequence sampleText="abcdeabcde";
       String sampleRegex="abc";
       java.util.regex.Pattern p = java.util.regex.Pattern.compile(sampleRegex);
       java.util.regex.Matcher m = p.matcher(sampleText);

       while(m.find()){
               String replaceStr = m.group();

               replaceStr = replaceStr.toUpperCase();

               m.appendReplacement(buf, replaceStr);
       }
       m.appendTail(buf);
       String result = buf.toString();
</xsp:logic>

<xsp:expr>result</xsp:expr>
</xsp:page>

The purpose of my code is to replace the string abcdeabcde with ABCdeABCde.

The code is correct, because i've already tested. But, when i run this code it 
appears:


org.apache.cocoon.ProcessingException: Language Exception: org.apache.cocoon.components.language.LanguageException: Error compiling 
SimpleRegexTest_xsp: ERROR 1 (org/apache/cocoon/www/samples/simpleform/projecto2/SimpleRegexTest_xsp.java): ... StringBuffer buf = new 
StringBuffer(); CharSequence sampleText="abcdeabcde"; String sampleRegex="abc"; java.util.regex.Pattern p = 
java.util.regex.Pattern.compile(sampleRegex); // start error (lines 67-67) "Syntax error on token ";", { expected after this 
token" java.util.regex.Matcher m = p.matcher(sampleText); // end error while(m.find()){ String replaceStr = m.group(); ... ERROR 2 
(org/apache/cocoon/www/samples/simpleform/projecto2/SimpleRegexTest_xsp.java): ... String sampleRegex="abc"; 
java.util.regex.Pattern p = java.util.regex.Pattern.compile(sampleRegex); java.util.regex.Matcher m = p.matcher(sampleText); // start error 
(lines 69-69) "Syntax error on token(s), misplaced construct(s)" while(m.find()){ // end error String repla!
ceStr = m.group(); replaceStr = replaceStr.toUpperCase(); ... Line 67, column 0: Syntax 
error on token ";", { expected after this token Line 69, column 0: Syntax error 
on token(s), misplaced construct(s)


I don't know what to do to this work properly. Can you help me?

My sitemap is:

<map:match pattern="test">
 <map:generate src="SimpleRegexTest.xsp" type="serverpages"/>
 <map:serialize type="html"/>
</map:match>



My second question is:

My final objective to do with this file is, to get a sequence of characters 
that was passed in url, by http GET, and do the replace. My only question is, 
how to get the sequence that is passes by url.
Example of url:
http://localhost:8888/samples/simpleform/projecto2/sequence?seq=%0AMKFLILLFNILCLF%0A

I've already looked at hello-world example that comes in cocoon documents, and 
put my xsp file in a xsl file, and created other xsp file like the 
greeting.xsp. But the problem is the same, as the described above.

what should i do?

Thanks.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to