Re: Is there any easy way to provide XdmValue as a source for the standard XsltTransformer?

Michael Kay <mike-JkSD5nQpfvpWk0Htik3J/[email protected]> Mon, 28 Jun 2021 07:49:11 +0100
Newsgroups gmane.text.xml.saxon.help
Message-ID <[email protected]>
If you can organise it so the XdmValue is passed as a stylesheet parameter, rather than as the initial context item / match selection, then there should be no problem using the XsltTransformer.

Michael Kay
Saxonica

> On 27 Jun 2021, at 21:03, Alan Painter <[email protected] <mailto:[email protected]>> wrote:
> 
> Hi Michael,
> 
> In fact, that's the objective of this exercise, to avoid deserializing/reserializing from XdmValues that are the source/results of cascading transformations orchestrated within Spring Integration.  
> 
> Spring Integration has a message payload that is passed around within it.  I am shooting for an XdmValue message payload that can be transformed without serialization.
> 
> This may well mean that I must forego the XsltTransformer for the Xslt30Transformer, but I was hoping that there could be a simpler solution since there is already a lot of implementation dependency on XsltTransformer.
> 
> thanks for your help and best regards
> 
> -alan
> 
> 
> 
> 
> On Sun, Jun 27, 2021 at 9:25 PM Michael Kay <[email protected] <mailto:[email protected]>> wrote:
> If the XdmValue represents an XML node, then it will (probably) be an XdmNode, and the NodeInfo can be obtained using XdmNode.getUnderlyingValue().
> 
> However, if the XdmValue is an XdmMap or XdmArray (representing a JSON input), then the XsltTransformer isn't really set up for this. You would probably want to pass it in as a string-valued parameter and parse it from within the stylesheet.
> 
> Michael Kay
> Saxonica
> 
> > On 27 Jun 2021, at 16:48, Alan Painter <[email protected] <mailto:[email protected]>> wrote:
> > 
> > Hello fellow XML knowledge workers,
> > 
> > I'm trying to reuse the implementations in Spring Integration that do XSLT transformations using the XsltTransformer.
> > 
> > I'd like to be able to pass an XdmValue as a source for transformations so that the source could be JSON or XML, writing output to a RawDestination or XdmDestination. I understand that this is possible using Xslt30Transformer, but since the tooling that I'd like to reuse is based upon the older XsltTransformer, I'm a bit stuck.
> > 
> > I see that it's possible to provide a NodeInfo source value.  Could it be relatively easy to have an XdmValue presented as NodeInfo?
> > 
> > thanks for any pointers and best regards
> > 
> > -alan
> > 
> > _______________________________________________
> > saxon-help mailing list archived at http://saxon.markmail.org/ <http://saxon.markmail.org/>
> > [email protected] <mailto:[email protected]>
> > https://lists.sourceforge.net/lists/listinfo/saxon-help <https://lists.sourceforge.net/lists/listinfo/saxon-help>
> 
> 
> 
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/ <http://saxon.markmail.org/>
> [email protected] <mailto:[email protected]>
> https://lists.sourceforge.net/lists/listinfo/saxon-help <https://lists.sourceforge.net/lists/listinfo/saxon-help> 
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/ <http://saxon.markmail.org/>
> [email protected] <mailto:[email protected]>
> https://lists.sourceforge.net/lists/listinfo/saxon-help

_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[email protected]
https://lists.sourceforge.net/lists/listinfo/saxon-help