cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chitharanjan Das" <c...@accordiasys.com>
Subject RE: Help: xml from a class with XSP
Date Sat, 30 Mar 2002 00:03:37 GMT
 
 
If u use just xsp:expr, it will treat the o/p as parsed  string , if you
require the contents to be treated as a XML fragment, you need to do as
listed below
Include util logic sheet and use the <util:* >tags 
===
<?xml version="1.0"?>
<xsp:page xmlns:xsp="http://apache.org/xsp"
xmlns:util="http://apache.org/xsp/util/2.0"><page>
<util:include-expr><util:expr><xsp:expr>
com.plumcreek.junk.XSPTest.testMethod()</xsp:expr></util:expr></util:inc
lude-expr>  
</page></xsp:page>
===
 
 
accordia, inc 
34347 Maybird Circle
Fremont, CA 94555
650 279 1137
cdas@accordiasys.com
 
The information contained in this communication is intended solely for
the use of the individual or entity to whom it is addressed and others
authorized to receive it. It may contain confidential or legally
privileged information. If you are not the intended recipient you are
hereby notified that any disclosure, copying, distribution or taking any
action in reliance on the contents of this information is strictly
prohibited and may be unlawful. If you have received this communication
in error, please notify us immediately by responding to this email and
then delete it from your system. Accordia Inc. is neither liable for the
proper and incomplete transmission of the information contained in this
communication nor for any delay in its receipt
 
-----Original Message-----
From: Larry Meadors [mailto:Larry.Meadors@plumcreek.com] 
Sent: Friday, March 29, 2002 3:39 PM
To: cocoon-users@xml.apache.org
Subject: Help: xml from a class with XSP
 
I am trying to do this:
 
===
<?xml version="1.0"?>
<xsp:page xmlns:xsp="http://apache.org/xsp"><page>
  <xsp:expr>com.plumcreek.junk.XSPTest.testMethod()</xsp:expr>
</page></xsp:page>
===
 
Here's the code for the class: 
===
package com.plumcreek.junk;
public class XSPTest {
 public static String testMethod(){
  return "<p>This space for rent.</p>";
 }
}
===
 
I am expecting this string: "<p>This space for rent.</p>", but instead,
what I get on my page is "&lt;p&gt;This space for rent.&lt;/p&gt;".
 
Is there a way to tell XSP to not tweak the returned string to make it
"xml-safe"?
 
Environment: Win2K, jdk1.3.1, cocoon 2.0
 
Larry
 

Mime
View raw message