XML Literal text in a SOAP message

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

XML Literal text in a SOAP message

Tom Ferdinande
Hi there,

I would like to construct a SOAP call where the first parameter contains the
XML model in a string "soapenc:string". I'm using a XSLT processor to
construct the delegation part (see code below). How do I tell the XSLT
processor that <xsl:copy-of select="."/> needs to be escaped as a literal
string ?

Thanks in advance,

Tom

   <!-- Make a soap call naar de ISA4ALL service -->
    <p:processor name="oxf:xslt">
        <p:input name="data" href="#instance" debug="true"/>
        <p:input name="config">
            <!-- kvk nummer invullen -->
            <xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
                <xsl:template match="/">
                    <delegation:execute service="isa"
operation="verwerkAanvraag" xsl:version="2.0"><arg0
xsi:type="soapenc:string"><xsl:text
disable-output-escaping="no"><xsl:copy-of
select="."/></xsl:text></arg0></delegation:execute>
                </xsl:template>
            </xsl:stylesheet>
        </p:input>
        <p:output name="data" id="isa_call"  debug="true"/>
    </p:processor>





--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: XML Literal text in a SOAP message

Florent Georges
Tom Ferdinande wrote:

  Hi

> How do I tell the XSLT processor that <xsl:copy-of
> select="."/> needs to be escaped as a literal string ?

  So you want to serialize XML from within XSLT.  You can
use an extension povided by your processor (Saxon provides
saxon:serialize()), or use a serializer implemented directly
in XSLT, either write your own or use the Evan Lenz's
xml-to-string.xsl (there is a link to his page and a copy at
http://users.skynet.be/fgeorges/xslt-unit/xslt-unit.html).

  Dig the Mulberry Tech. XSL List archives for details.

  Regards,

--drkm























       
 p5.vert.ukl.yahoo.com uncompressed/chunked Wed Aug 30 07:13:39 GMT 2006
       
               
___________________________________________________________________________
Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet !
Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos expériences.
http://fr.answers.yahoo.com 




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: XML Literal text in a SOAP message

Henrik Pettersen
In reply to this post by Tom Ferdinande
Tom,

check out the xpath 2.0 function fn:escape-uri(stringURI,esc-res) here:
http://www.w3schools.com/xpath/xpath_functions.asp

Henrik

On 8/30/06, Tom Ferdinande <[hidden email]> wrote:
Hi there,

I would like to construct a SOAP call where the first parameter contains the
XML model in a string "soapenc:string". I'm using a XSLT processor to
construct the delegation part (see code below). How do I tell the XSLT
processor that <xsl:copy-of select="."/> needs to be escaped as a literal
string ?

Thanks in advance,

Tom

   <!-- Make a soap call naar de ISA4ALL service -->
    <p:processor name="oxf:xslt">
        <p:input name="data" href="#instance" debug="true"/>
        <p:input name="config">
            <!-- kvk nummer invullen -->
            <xsl:stylesheet version=" 2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
                <xsl:template match="/">
                    <delegation:execute service="isa"
operation="verwerkAanvraag" xsl:version="2.0"><arg0
xsi:type="soapenc:string"><xsl:text
disable-output-escaping="no"><xsl:copy-of
select="."/></xsl:text></arg0></delegation:execute>
                </xsl:template>
            </xsl:stylesheet>
        </p:input>
        <p:output name="data" id="isa_call"  debug="true"/>
    </p:processor>






--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws





--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: XML Literal text in a SOAP message

Tom Ferdinande
In reply to this post by Florent Georges
Thanks a lot guys!

saxon:serialize(.,'') did the trick for me. I spent a more than a day
looking for a NullPointerException in the pipeline after inserting this
function. The reason it did not work was that I forgot to put
xmlns:saxon="http://saxon.sf.net/" in my p:config tag.

I love Orbeon, but sadly the error reporting is not very self explanatory.
This has already cost me many hours of troubleshooting interleaved by some
Eureka moments.

Thanks,

Tom

The solution:

<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
          xmlns:oxf="http://www.orbeon.com/oxf/processors"
          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
          xmlns:delegation="http://orbeon.org/oxf/xml/delegation"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:saxon="http://saxon.sf.net/">

<!-- doe een soap call naar de ISA4ALL service -->
    <p:processor name="oxf:xslt">
        <p:input name="data" href="#instance" debug="true"/>
        <p:input name="config">
            <xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
                <xsl:template match="/">
                    <delegation:execute service="isa"
operation="verwerkAanvraag" xsl:version="2.0"><arg0
xsi:type="soapenc:string"><xsl:value-of
select="saxon:serialize(.,'')"/></arg0><arg1 xsi:nil="true"/><arg2
xsi:nil="true"/><arg3 xsi:nil="true"/><arg4 xsi:nil="true"/><arg5
xsi:nil="true"/></delegation:execute>
                </xsl:template>
            </xsl:stylesheet>
        </p:input>
        <p:output name="data" id="isa_call"  debug="true"/>
    </p:processor>


-----Original Message-----
From: Florent Georges [mailto:[hidden email]]
Sent: woensdag 30 augustus 2006 11:24
To: [hidden email]
Subject: Re: [ops-users] XML Literal text in a SOAP message


Tom Ferdinande wrote:

  Hi

> How do I tell the XSLT processor that <xsl:copy-of
> select="."/> needs to be escaped as a literal string ?

  So you want to serialize XML from within XSLT.  You can
use an extension povided by your processor (Saxon provides
saxon:serialize()), or use a serializer implemented directly
in XSLT, either write your own or use the Evan Lenz's
xml-to-string.xsl (there is a link to his page and a copy at
http://users.skynet.be/fgeorges/xslt-unit/xslt-unit.html).

  Dig the Mulberry Tech. XSL List archives for details.

  Regards,

--drkm
























 p5.vert.ukl.yahoo.com uncompressed/chunked Wed Aug 30 07:13:39 GMT 2006


___________________________________________________________________________
Découvrez un nouveau moyen de poser toutes vos questions quelque soit le
sujet !
Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et
vos expériences.
http://fr.answers.yahoo.com







--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws