[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Trying to understand XSLT processing

Subject: Re: Trying to understand XSLT processing
From: <ohaya@xxxxxxx>
Date: Mon, 14 Dec 2009 21:49:19 -0500
Re:  Trying to understand XSLT processing
---- ohaya@xxxxxxx wrote: 
> Hi,
> 
> I have an XML file:
> 
> <SOAP:Envelope xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
>     <SOAP:Header>
>         <wsse:Security SOAP:mustUnderstand="1">
>         </wsse:Security></SOAP:Header>
>     <SOAP:Body>
>         <m:hello xmlns:m="http://services">
>             <m:x>123</m:x>
>         </m:hello>
>     </SOAP:Body>
> </SOAP:Envelope>
> 
> and I just want to output the <SOAP:Body> to a message, so I have an XSLT that looks like this:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"        
>     xmlns:SOAP="http://www.w3.org/2003/05/soap-envelope"
>     xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
>     <xsl:output method="xml" /> 
>     
>     <xsl:template match="/">
>         <xsl:message>*****you just hit the XSLT ******</xsl:message>
>         <xsl:message>*****BODY CONTENTS****[<xsl:copy-of select="."/>]</xsl:message>
>     </xsl:template>
>     
> </xsl:stylesheet>
> 
> However, when I execute that XSLT, I'm getting an empty nodeset for the output:
> 
> *****you just hit the XSLT ******
> *****BODY CONTENTS****[]
> 
> So, I was wondering if someone can explain what I am doing wrong with that XSLT above?  Why doesn't the <xsl:copy-of> give me the <Body>?
> 
> Thanks, and sorry if this is probably a really dumb question :(...
> 
> Jim
> 


Hi,

Sorry for the confusion, but the XSLT I've been trying is:

<?xml version="1.0" encoding="UTF-8"?> 
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"        
    xmlns:SOAP="http://www.w3.org/2003/05/soap-envelope" 
    xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"> 
    <xsl:output method="xml" /> 
    
    <xsl:template match="/"> 
        <xsl:message>*****you just hit the XSLT ******</xsl:message> 
        <xsl:message>*****BODY CONTENTS****[<xsl:copy-of 
select="//Body"/>]</xsl:message> 
    </xsl:template> 

I've also tried various other things for the 'select', i.e.:

//SOAP:Body

/SOAP:Envelope/SOAP:Body

etc.

but, I always get an "empty" output for the <xsl:message> :(...

Again, my apologies for any confusion.

Jim

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.