Hi Folks,
I have two questions:
1). How to escape CDATA in your xslt script?
<xsl:template match="/">
<![CDATA[
<xsl:apply-templates select="node()"/>
]]>
</xsl:template>
In the above code, the template inside CDATA does not get executed. What I actually want is the result from this template (<xsl:apply-templates select="node()"/>) to be returned as CDATA. For example, if the apply template returns....
<request code=10 type="2"/>
then i want the final output to be
<![CDATA[<request code=10 type="2"/>]]>
. But at the moment apply template is not getting executed.
2). My second question is regarding the response to be transformed/decoded to CDATA or proper xml.
I'm getting a response from a webservice for example:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<ForwardRequestResponse xmlns="http://webservices.kuoni.ch">
<ForwardRequestResult><?xml version="1.0" encoding="windows-1252"?><Response Version="2.5" From="KUEKA0" To="EBOOKERS" TermId="EB0001" Window="A" Date="04082009" Time="095322" Type="ERROR" Confirm="YES" Agent="541406" Lang="DE" UserCode="EBOO" UserType="M" UserName="EBOOKERS" UserFirstName="CH" Mode="Test"><Err SegRef="001"><ErrorNr>3706</ErrorNr><ErrorText>Datum für Flug/Transport überprüfen</ErrorText></Err></Response></ForwardRequestResult>
</ForwardRequestResponse>
</soap:Body>
</soap:Envelope>
Now if you look inside, <ForwardRequestResult> element the text is encoded, how can I decode it to a proper xml form i.e. without these < ? > ect ??
Thanks.