Project

Profile

Help

Passing XML to an external Java method

Added by Anonymous over 16 years ago

Legacy ID: #4938356 Legacy Poster: Dr Matthew Graham (mjgraham)

Hi, I have an XML document that I want to pass to an external Java method which will then HTTP POST it to a RESTful endpoint. My stylesheet has: <xsl:value-of select="java:putFile($record, $endpoint)"/> However just the text version (no XML <>, etc) of the document seems to be passed and not the full XML. How do I get an XML output to by external method? Cheers, Matthew


Replies (1)

RE: Passing XML to an external Java method - Added by Anonymous over 16 years ago

Legacy ID: #4938414 Legacy Poster: Michael Kay (mhkay)

What is in $record and $endPoint, and what types is the Java method expecting? If the method is expecting a string and you supply a node, then Saxon will apply the standard conversion from a node to a string, which is to extract the string value of the node. If you want to do the conversion by serializing the node as lexical XML, use saxon:serialize(). Michael Kay http://www.saxonica.com/

    (1-1/1)

    Please register to reply