So I am not understanding how to setup the XML input source here. Here is what I have:
// XSL ----------------------------------------------- <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text" encoding="UTF-8"/> <!-- simply copy the message to the result tree --> <xsl:template match="/"> A message should be below. <xsl:value-of select="message"/> below is above here </xsl:template> </xsl:stylesheet> // JAVA ------------------------------------------ MarkupContainer<?> report = new MarkupContainer<String>("ReportPanel"); report.setModel(new Model("<?xml version=\"1.0\" encoding=\"UTF-8\"?><message>Yep, it worked!</message>")); add(report); XsltTransformerBehavior trans = new XsltTransformerBehavior(); report.add(trans); I can see that the associated XSL file is being used, but I am not seeing the message. I thought is might be bad xpath, so I essentially copied XsltTransformerBehavior and printed out the XML input like so: @Override public CharSequence transform(final Component< ? > component, final CharSequence output) throws Exception { System.out.println(output); return new XsltTransformer(xslFile).transform(component, output); } What I saw was: What I expected was: <message>Yep, it worked!</message> What am I doing wrong? This should be simple and I am sure there is an easy fix. jeredm wrote: > > I believe that is what I am looking for; however, I am not able to get the > objects to work. Are there any "Hello World" examples of those objects in > action? > > > igor.vaynberg wrote: >> >> see XsltTransformer and XsltTransformerBehavior >> >> -igor >> >> On Mon, Jan 5, 2009 at 4:08 PM, jeredm <[email protected]> >> wrote: >>> >>> I have a rather extensive report that is done in an application that I >>> am >>> porting to a Wicket application. This report relies on a SQL Server XML >>> select (for xml explicit) that nests data so that I don't know how to do >>> a >>> single database select that will give me all the data I need in a flat >>> format. The application I am porting from uses a simple xsl transform >>> to >>> handle the display of the report. Is there a way that I can make a >>> Wicket >>> Panel using an xsl transform that is nested inside a generic wicket >>> panel? >>> I want to keep the transform portable, so that I can use is only in a >>> panel >>> that needs it and do not have to manipulate how the application handles >>> mounting of pages, for example. Here is the sort of code I am looking >>> for: >>> >>> public class ReportPanel extends Panel { >>> ... >>> >>> public ReportPanel(String id){ >>> super(id); >>> layoutPanel(); >>> } >>> >>> private void layoutPanel(){ >>> // Most are not real objects here, but this is what I would like to >>> do >>> ObjectThatHoldsXML myXML = ... >>> XSLFilePointerObject myXSL = ... >>> TransformedComponent mySPANTag = new >>> TransformedComponent("reportPanel", >>> new Model(XSLTHTMLTransformerObject.transform(myXML, myXSL)); >>> ... >>> add(mySpanTag); >>> } >>> >>> } >>> >>> If anybody has a short "Hello World" example that would be great. I >>> looked >>> through http://www.wicket-library.com/wicket-examples/staticpages/ and I >>> don't think that the implementation is what I need (I could very likely >>> be >>> understanding it incorrectly). Thanks for the help! >>> >>> Jered >>> -- >>> View this message in context: >>> http://www.nabble.com/XSLT-in-a-Panel-tp21301555p21301555.html >>> Sent from the Wicket - User mailing list archive at Nabble.com. >>> >>> >>> --------------------------------------------------------------------- >>> 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] >> >> >> > > -- View this message in context: http://www.nabble.com/XSLT-in-a-Panel-tp21301555p21332963.html Sent from the Wicket - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
