[prev in list] [next in list] [prev in thread] [next in thread]
List: turbine-user
Subject: Fw: Turbine and XML / XSLT (again)
From: "Sanjeev Tiwari" <sanjeevt () cybage ! com>
Date: 2003-05-27 13:49:08
[Download RAW message or body]
----- Original Message -----
From: "Sanjeev Tiwari" <sanjeevt@cybage.com>
To: "Sanjeev Tiwari" <sanjeevt@cybage.com>
Sent: Tuesday, May 27, 2003 7:18 PM
Subject: Fw: Turbine and XML / XSLT (again)
>
> ----- Original Message -----
> From: "brian janaszek" <janaszek@collaborativefusion.com>
> To: <Jason.Baragry@nr.no>
> Cc: <turbine-user@jakarta.apache.org>
> Sent: Tuesday, May 27, 2003 7:08 PM
> Subject: Re: Turbine and XML / XSLT (again)
>
>
> > > Solutions 2.
> > > - Use Velocity XML templates.
> > > - pull in the XML
> > > - transform using XSLT on the way back to the user.
> >
> > The Turbine XSLT service works well. The documentation is a little
> > sparse, but here's a little code snippet from a screen class:
> >
> > // Get your XML. I'm using a String, but
> > // but you could simply create a FileReader instead
> > String xmlSchema = getXMLSchema();
> >
> > // This is just a filename. The location for the
> > // templates is defined in TurbineResources.properties
> > String xslTemplate = "MyTemplate.xsl";
> >
> > // Set up a StringReader for the XML String:
> > Reader reader = new StringReader(xmlSchema);
> >
> > // Send the XML and the XSL template to the transformer:
> > TurbineXSLTService xslt = new TurbineXSLTService();
> > xslt.init();
> >
> > String sOutput = xslt.transform(xslTemplate, reader);
> >
> > context.put("formOutput", sOutput);
> >
> > I'm just writing the HTML output from the XSL transformation to a
> > String, and accessing it in the Velocity template via the Context. I'm
> > sure there are better ways to do this, but this is working just fine
> > (the XSL is generating HTML forms based on the contents of the XML).
> >
> > HTH
> > b
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic