You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Bert Van Kets <be...@vankets.com> on 2002/05/27 14:06:57 UTC

Jtidy and character escaping

I'm using JTidy to convert a string containing some HTML to XHTML in a DOM 
tree.  I can't get the foreign characters like éèà converted to the XHTML 
counterpart.  What setting do I need to use???

Here's a code snip from my XSP page:

       String strContent = request.getParameter("content");
       ByteArrayInputStream in = new ByteArrayInputStream( 
strContent.getBytes() );
       String strOut = "";
       org.w3c.dom.Document doc = null;
       org.w3c.tidy.Configuration conf = new org.w3c.tidy.Configuration();
       try {
         Tidy tidy = new Tidy();

         //create output as XML
         tidy.setXmlOut(true);

         //output should be XHTML conforming
         tidy.setXHTML(true);

         tidy.setBreakBeforeBR(false);
         tidy.setRawOut(false);
         tidy.setCharEncoding( conf.UTF8 );

         //do not output 'non-breaking space' as entity.
         tidy.setQuoteNbsp(true);

         //output naked ampersand as &amp;
         tidy.setQuoteAmpersand(true);

         //drop presentation tags
         tidy.setLiteralAttribs(true);

         //parse the stream to a DOM document
         doc =  tidy.parseDOM(in, null);
       } catch (Exception e) {
       }

Bert


*Friends Are Angels Who Lift Us To Our Feet When Our Wings Have Trouble 
Remembering How To Fly*


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

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


os x install problem

Posted by Paul Kelly <pj...@rogers.com>.
platform: os x
tomcat: 4.0.1
cocoon: 2
java version: 1.3.1

tomcat installs just fine. adding cocoon.war causes tomcat to crash 
every time I attempt to access /cocoon/. The only thing in the logs 
that looks informative is in catalina.out:

Starting service Tomcat-Standalone
Apache Tomcat/4.0.1
Server 1.6 is running
Press [Ctrl]+[C] to abort
Starting service Tomcat-Apache
Apache Tomcat/4.0.1
(ipc/send) invalid destination port : initCGDisplayState: cannot map 
display interlocks.
kCGErrorFailure : CGSNewConnection cannot connect to server
kCGErrorFailure : CGSNewConnection cannot connect to server
kCGErrorInvalidConnection : CGSGetEventPort: Invalid connection

Other logs just have all kinds of DEBUG crap. Any help is greatly appreciated.

--paul

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

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