468,140 Members | 1,165 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,140 developers. It's quick & easy.

XSL transformation not finding template

I'm trying to create an XSL transformation that will strip out
development-specific attributes from deployment descriptors and other XML
files. I have already successfully done so with web.xml but I'm at a
complete loss as to what is wrong with the one below. This is a very
abbreviated server-config.wsdd:

<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<globalConfiguration>
<parameter name="adminPassword" value="admin"/>
<parameter name="sendXsiTypes" value="true"/>
<parameter name="sendMultiRefs" value="true"/>
<parameter name="sendXMLDeclaration" value="true"/>
<parameter name="axis.sendMinimizedElements" value="true"/>
<requestFlow>
<handler type="java:org.apache.axis.handlers.JWSHandler">
<parameter name="scope" value="session"/>
</handler>
<handler type="java:org.apache.axis.handlers.JWSHandler">
<parameter name="scope" value="request"/>
<parameter name="extension" value=".jwr"/>
</handler>
<handler type="java:org.apache.axis.handlers.SOAPMonitorHan dler"/>
</requestFlow>
<responseFlow>
<handler type="java:org.apache.axis.handlers.SOAPMonitorHan dler"/>
</responseFlow>
</globalConfiguration>
</deployment>

What I'd like to do is copy the entire file but filter out the global
request and response flow elements. To that end, I have created the
following XSL:

<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml" version="1.0" />

<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>

<xsl:template match="/deployment/globalConfiguration/requestFlow" />

<xsl:template match="/deployment/globalConfiguration/responseFlow" />
</xsl:stylesheet>

Basically, I want the XSL transformation to remove the
/deployment/globalConfiguration/requestFlow and
/deployment/globalConfiguration/responseFlow paths. As I said earlier, I
have done this quite successfully in web.xml (stripping out Axis
administration servlet) but I'm stumped as to why this wouldn't be working
in this instance.

Any help would be most appreciated.

--
Remove NOSPAM woven into e-mail address to reply directly.
Jul 20 '05 #1
4 2210
Kevin Dean wrote:
I'm trying to create an XSL transformation that will strip out
development-specific attributes from deployment descriptors and other XML
files. I have already successfully done so with web.xml but I'm at a
complete loss as to what is wrong with the one below. This is a very
abbreviated server-config.wsdd:

<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"> ....
</deployment>

What I'd like to do is copy the entire file but filter out the global
request and response flow elements. To that end, I have created the
following XSL:

<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml" version="1.0" />
....
</xsl:stylesheet>

Basically, I want the XSL transformation to remove the
/deployment/globalConfiguration/requestFlow and
/deployment/globalConfiguration/responseFlow paths. As I said earlier, I
have done this quite successfully in web.xml (stripping out Axis
administration servlet) but I'm stumped as to why this wouldn't be working
in this instance.

Any help would be most appreciated.


Try specifying the source namespace in the stylesheet:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://xml.apache.org/axis/wsdd/"
version="1.0">

-vin

Jul 20 '05 #2
No good. I still get the identity transformation back. Here's an even
simpler version of the XSL that should return an empty transformation but
doesn't:

<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://xml.apache.org/axis/wsdd/" version="1.0">
<xsl:output method="xml" version="1.0" />

<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>

<xsl:template match="/deployment" />
</xsl:stylesheet>

--
Remove NOSPAM woven into e-mail address to reply directly.

"vin sharma" <vi********@NOSPAM.hp.com> wrote in message
news:70*****************@news.cpqcorp.net...
Kevin Dean wrote:
I'm trying to create an XSL transformation that will strip out
development-specific attributes from deployment descriptors and other XML files. I have already successfully done so with web.xml but I'm at a
complete loss as to what is wrong with the one below. This is a very
abbreviated server-config.wsdd:

<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">

...
</deployment>

What I'd like to do is copy the entire file but filter out the global
request and response flow elements. To that end, I have created the
following XSL:

<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml" version="1.0" />

...
</xsl:stylesheet>

Basically, I want the XSL transformation to remove the
/deployment/globalConfiguration/requestFlow and
/deployment/globalConfiguration/responseFlow paths. As I said earlier, I have done this quite successfully in web.xml (stripping out Axis
administration servlet) but I'm stumped as to why this wouldn't be working in this instance.

Any help would be most appreciated.


Try specifying the source namespace in the stylesheet:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://xml.apache.org/axis/wsdd/"
version="1.0">

-vin

Jul 20 '05 #3
Hi Kevin,

Because the elements you are trying to filter out are bound to the default
namespace (i.e. xmlns="http://xml.apache.org/axis/wsdd/" ) in your input
XML.

So to match those elements - you need to declare that namespace in your
stylesheet with an arbitrary prefix (remember that namespaces are matched by
their URI rather than prefix). Then use that arbitrary prefix in your match
patterns, e.g.

<?xml version="1.0" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ws="http://xml.apache.org/axis/wsdd/">
<xsl:output method="xml" version="1.0" />

<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>

<xsl:template match="ws:requestFlow | ws:responseFlow" />

</xsl:stylesheet>

Hope this helps
Marrow
http://www.marrowsoft.com - home of Xselerator (XSLT IDE and debugger)
http://www.topxml.com/Xselerator
"Kevin Dean" <Nk*********@datadevelopment.com> wrote in message
news:zX*****************@read1.cgocable.net...
I'm trying to create an XSL transformation that will strip out
development-specific attributes from deployment descriptors and other XML
files. I have already successfully done so with web.xml but I'm at a
complete loss as to what is wrong with the one below. This is a very
abbreviated server-config.wsdd:

<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<globalConfiguration>
<parameter name="adminPassword" value="admin"/>
<parameter name="sendXsiTypes" value="true"/>
<parameter name="sendMultiRefs" value="true"/>
<parameter name="sendXMLDeclaration" value="true"/>
<parameter name="axis.sendMinimizedElements" value="true"/>
<requestFlow>
<handler type="java:org.apache.axis.handlers.JWSHandler">
<parameter name="scope" value="session"/>
</handler>
<handler type="java:org.apache.axis.handlers.JWSHandler">
<parameter name="scope" value="request"/>
<parameter name="extension" value=".jwr"/>
</handler>
<handler type="java:org.apache.axis.handlers.SOAPMonitorHan dler"/>
</requestFlow>
<responseFlow>
<handler type="java:org.apache.axis.handlers.SOAPMonitorHan dler"/>
</responseFlow>
</globalConfiguration>
</deployment>

What I'd like to do is copy the entire file but filter out the global
request and response flow elements. To that end, I have created the
following XSL:

<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml" version="1.0" />

<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>

<xsl:template match="/deployment/globalConfiguration/requestFlow" />

<xsl:template match="/deployment/globalConfiguration/responseFlow" />
</xsl:stylesheet>

Basically, I want the XSL transformation to remove the
/deployment/globalConfiguration/requestFlow and
/deployment/globalConfiguration/responseFlow paths. As I said earlier, I
have done this quite successfully in web.xml (stripping out Axis
administration servlet) but I'm stumped as to why this wouldn't be working
in this instance.

Any help would be most appreciated.

--
Remove NOSPAM woven into e-mail address to reply directly.

Jul 20 '05 #4
Perfect, thank you.

--
Remove NOSPAM woven into e-mail address to reply directly.
"Marrow" <marrow-NO-@-SPAM-marrowsoft.com> wrote in message
news:Oz*******************@newsfep2-win.server.ntli.net...
Hi Kevin,

Because the elements you are trying to filter out are bound to the default
namespace (i.e. xmlns="http://xml.apache.org/axis/wsdd/" ) in your input
XML.

So to match those elements - you need to declare that namespace in your
stylesheet with an arbitrary prefix (remember that namespaces are matched by their URI rather than prefix). Then use that arbitrary prefix in your match patterns, e.g.

<?xml version="1.0" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ws="http://xml.apache.org/axis/wsdd/">
<xsl:output method="xml" version="1.0" />

<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>

<xsl:template match="ws:requestFlow | ws:responseFlow" />

</xsl:stylesheet>

Hope this helps
Marrow
http://www.marrowsoft.com - home of Xselerator (XSLT IDE and debugger)
http://www.topxml.com/Xselerator
"Kevin Dean" <Nk*********@datadevelopment.com> wrote in message
news:zX*****************@read1.cgocable.net...
I'm trying to create an XSL transformation that will strip out
development-specific attributes from deployment descriptors and other XML files. I have already successfully done so with web.xml but I'm at a
complete loss as to what is wrong with the one below. This is a very
abbreviated server-config.wsdd:

<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<globalConfiguration>
<parameter name="adminPassword" value="admin"/>
<parameter name="sendXsiTypes" value="true"/>
<parameter name="sendMultiRefs" value="true"/>
<parameter name="sendXMLDeclaration" value="true"/>
<parameter name="axis.sendMinimizedElements" value="true"/>
<requestFlow>
<handler type="java:org.apache.axis.handlers.JWSHandler">
<parameter name="scope" value="session"/>
</handler>
<handler type="java:org.apache.axis.handlers.JWSHandler">
<parameter name="scope" value="request"/>
<parameter name="extension" value=".jwr"/>
</handler>
<handler type="java:org.apache.axis.handlers.SOAPMonitorHan dler"/>
</requestFlow>
<responseFlow>
<handler type="java:org.apache.axis.handlers.SOAPMonitorHan dler"/>
</responseFlow>
</globalConfiguration>
</deployment>

What I'd like to do is copy the entire file but filter out the global
request and response flow elements. To that end, I have created the
following XSL:

<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml" version="1.0" />

<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>

<xsl:template match="/deployment/globalConfiguration/requestFlow" />

<xsl:template match="/deployment/globalConfiguration/responseFlow" />
</xsl:stylesheet>

Basically, I want the XSL transformation to remove the
/deployment/globalConfiguration/requestFlow and
/deployment/globalConfiguration/responseFlow paths. As I said earlier, I have done this quite successfully in web.xml (stripping out Axis
administration servlet) but I'm stumped as to why this wouldn't be working in this instance.

Any help would be most appreciated.

--
Remove NOSPAM woven into e-mail address to reply directly.


Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Sergio del Amo | last post: by
3 posts views Thread by pradeep gummi | last post: by
8 posts views Thread by Will | last post: by
4 posts views Thread by Mike Conmackie | last post: by
1 post views Thread by sommarlov | last post: by
7 posts views Thread by Bilal | last post: by
4 posts views Thread by =?Utf-8?B?REZC?= | last post: by
27 posts views Thread by didacticone | last post: by
1 post views Thread by gcdp | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.