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

Why doesn't this simple XSLT (Identity transform) work

Subject: Why doesn't this simple XSLT (Identity transform) work?
From: <ohaya@xxxxxxx>
Date: Tue, 1 Dec 2009 19:43:21 -0500
 Why doesn't this simple XSLT (Identity transform) work

It's been awhile since I've worked with XSLT, but I'm having to implement one that removes an element (<Signature>) from the incoming (SOAP) message.  I know that this should be simple, and I know that I have written similar XSLT before, but for some reason, I can get this to work.

Here's an example SOAP message:

<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/">
        <wsse:Security SOAP:mustUnderstand="1">
            <saml:Assertion MajorVersion="1" MinorVersion="1" AssertionID="ID46a342be-9d3a-437a-8a26-85fcd72a723d" Issuer="http://foo.com" IssueInstant="2009-12-01T21:55:13Z">
                <saml:Conditions NotBefore="2009-12-01T21:54:58Z" NotOnOrAfter="2009-12-01T22:10:28Z"/>
                <saml:AuthenticationStatement AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:unspecified" AuthenticationInstant="2009-12-01T21:55:13Z">
             <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
        <m:hello xmlns:m="http://services">

It's a SOAP message with a SAML assertion...

And, here's the XSLT that I'm using:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"  xmlns:dp="http://www.datapower.com/extensions" 
    <xsl:output method="xml"/>
    <xsl:template match="node()|@*">
            <xsl:apply-templates select="node()|@*"/>
    <xsl:template match="//Signature">

What the XSLT seems to be doing is just doing the Identity transform, and copying everything from the input message to the output, i.e., the "<xsl:template match="//Signature">" is not getting processed at all.

I've tried different things for that template match, including just "Signature", a "fully-qualified" match term, etc.  

I have the impression that the XSLT processing should always use the more specific match (i.e., the one above, and not the Identity transform), but it doesn't seem to be working :(...

I've tried running this under an XSLT debugger (in oXygen), and I can see that it never gets to that template match.

I'm sure that I am missing something really obvious here, but I've been staring at  this for awhile, and can't see it, so I hope that someone can help :(!!

Thanks in advance!!


Current Thread


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.
First Name
Last Name
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.