Here is an example method I just finished, hope it helps and anyone who sees
anything stupid please let me know!
public String doTransformation(String pSource, String styleURL)
throws SAXException {
DOMParser parser = new DOMParser();
String transformedSource = "";
StringReader sr = new StringReader(pSource);
InputSource is = new InputSource(sr);
Log.debug("In the transformation method");
// Get the DOM tree as Document
try{
parser.parse(is);
Document doc = parser.getDocument();
transformedSource = SimpleTransform.transform( doc,
styleURL,
getPortletConfig().getInitParameters() );
}
catch(IOException e){
transformedSource = null;
Log.debug("Error transforming source with " + styleURL);
}
Log.info("doing transformation with:" + styleURL);
Log.info("Here is the Transformed source\n\n\n" + transformedSource);
return transformedSource;
}
Thanks,
Casey
-----Original Message-----
From: Wimmer, Matthias [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 01, 2002 11:03 AM
To: 'Jetspeed Users List'
Subject: RE: XSLT
Sergio:
I am doing the same thing. But I don't use DTDs or XMLSchema. It is rendered
inside of the method portlet.getContent(RunData). It works fine.
I use the method org.apache.jetspeed.util.SimpleTransform.transform(...). It
takes a DOM object and a file as the stylesheet. So I don't have to save the
XML file.
Was that your problem? So check this out and kindly tell me your experience.
Matthias Wimmer
> -----Original Message-----
> From: Sergio [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, June 30, 2002 1:51 AM
> To: Jetspeed
> Subject: XSLT
>
>
> Hello all,
> My goal, with all my custom portlets is to dynamically
> create an XML string, or stream, that has an
> associated dtd, then merge that with a predefined XSL
> file and output that in HTML. I dont want to have to
> output all my XML to files. All I've found in the
> Mail Archives is how to use an XML file and XSL, or
> XSL and JSP. I want to skip all that and do all my
> XSLT transforming on the server side quickly for each
> request and output that to the browser. Can anyone
> help me with this?
>
> Sergio
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! - Official partner of 2002 FIFA World Cup
> http://fifaworldcup.yahoo.com
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>