-
1. Re: Smooks Transform outputs same XML
tfennelly Sep 21, 2007 11:12 AM (in response to tobysaville)I'd guess your issue is re the paramater is-xslt-templatelet=true. Looks as though you're not using a templatelet, but instead using a full stylesheet.
-
2. Re: Smooks Transform outputs same XML
tobysaville Sep 21, 2007 11:29 AM (in response to tobysaville)thanks Tom,
it doesnt seem to change anything - if its true, false, or removed completely.
cheers,
tobes -
3. Re: Smooks Transform outputs same XML
tfennelly Sep 21, 2007 11:36 AM (in response to tobysaville)OK Toby, nothing further to suggest - I'd need everything you've got here in front of me. You could try turning on debug logging on the Smooks stuff - will tell you (in detail) what is and is not getting applied and why. You could also try taking one of the working examples from http://milyn.codehaus.org/Tutorials and modifying it.
-
4. Re: Smooks Transform outputs same XML
burrsutter Sep 21, 2007 2:58 PM (in response to tobysaville)Hey Toby,
I've not been following this thread completely but is it possible that Smooks did the job but then stuck the transformed message into some odd place into the Message object. You might use the SystemPrintln action printfull option to see if you can find the results hidden away some place. The SystemPrintln action is used in helloworld_file_action and is documented in the MessageActionGuide.<action name="dump" class="org.jboss.soa.esb.actions.SystemPrintln"> <property name="printfull" value="true"/> </action>
-
5. Re: Smooks Transform outputs same XML
tobysaville Sep 24, 2007 9:14 AM (in response to tobysaville)Hi Tom, Burr,
thanks again for your help with this.
As it turns out, smooks didnt like the "/" in my xsl:template tag. The following didnt work:<xsl:template match="/Order"> <!-- OR --> <xsl:template match="/">
However the following did<xsl:template match="Order">
So it was just my lack of understanding of Smooks. I assume this means that $document in smooks-res.xml refers to the root XPath ("/") of the XML being parsed. Is that correct?
Thanks again!
- tobes -
6. Re: Smooks Transform outputs same XML
tfennelly Sep 24, 2007 11:50 AM (in response to tobysaville)"tobysaville" wrote:
I assume this means that $document in smooks-res.xml refers to the root XPath ("/") of the XML being parsed. Is that correct?
Basically, yes. selector="$document" targets the resource at the "document fragment", which is basically the root node in the document. Check out the Smooks FAQs. -
7. Re: Smooks Transform outputs same XML
tobysaville Sep 24, 2007 12:59 PM (in response to tobysaville)nice, thanks again Tom.
i have another question, but im not sure if i should start a new thread, or even post this to a smooks specific forum, but seeing as your a Smooks developer too, Tom, i thought i would start here.
Can you tell me why the variable below called $install would have a value of 2 when processed with Xalan, and a value of 0 when using Smooks (xalan indirectly, i believe?)<xsl:param name="installs" select="//Service/customer"/> <xsl:param name="install" select="count($installs)"/>
However, if i do the following, the value of $install is 2 using Xalan or Smooks:<xsl:param name="services" select="//Service"/> <xsl:param name="install" select="count($services/customer)"/>
i have also tried using <xsl:variable/> instead of <xsl:param/>
thanks again,
- tobes -
8. Re: Smooks Transform outputs same XML
tfennelly Sep 25, 2007 4:56 AM (in response to tobysaville)"tobysaville" wrote:
i have another question, but im not sure if i should start a new thread, or even post this to a smooks specific forum
Sure. These are Smooks specific questions, so perhaps it's better to address them on the Smooks Users mailing list."tobysaville" wrote:
Can you tell me why the variable below called $install would have a value of 2 when processed with Xalan, and a value of 0 when using Smooks (xalan indirectly, i believe?)<xsl:param name="installs" select="//Service/customer"/> <xsl:param name="install" select="count($installs)"/>
However, if i do the following, the value of $install is 2 using Xalan or Smooks:<xsl:param name="services" select="//Service"/> <xsl:param name="install" select="count($services/customer)"/>
i have also tried using <xsl:variable/> instead of <xsl:param/>
thanks again,
- tobes
This is most likely down to the Smooks processing model again i.e. the fact that it's fragment based. The difference is that Smooks applies XSL transforms by targeting them at DOM Element nodes (even if that node is the root node ala "$document") Vs the whole Document (DOM Document node). It should obviously try to be more consistent with applying XSL standalone, so we should log this as a bug. It could be fixed by making a special case of XSL targeted at the "$document" node. -
9. Re: Smooks Transform outputs same XML
tobysaville Sep 26, 2007 7:16 AM (in response to tobysaville)Hi Tom,
thanks again for your help, ill take these issues to the smooks mailing list.
see you there :)
- tobes