472,789 Members | 1,023 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,789 software developers and data experts.

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 2378
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Sergio del Amo | last post by:
Hi, I use the xslt functions provided by php. I am running in my computer the package xampp(www.apachefriends.org) which includes php/apache/mysql .. In this package the php includes the sablotron...
3
by: pradeep gummi | last post by:
I have an XML FILE that is to be converted to Plain Text using an XSL file. Since I just want plain text, I do not want to set any root element during transformation.And if I do not any root...
8
by: Will | last post by:
I was thrust into XML about 2 weeks ago and don't know much yet. From another department in the corp I am receiving an XML file which concatenates nodes all on one line i.e....
4
by: Mike Conmackie | last post by:
Hi Folks, I've probably omitted something very basic but I have no idea what it might be. The results of my transformation _should_ be an xml file but all I get is the xml declaration...
1
by: Chris Bedford | last post by:
Hi: this question has been driving me crazy. would be grateful for any help. I am writing a version of the identity transformation to filter some documents (they happen to be wsdl docs)....
6
by: dave | last post by:
I really have 2 questions regarding the following xml snippet. The xml is a directory representation. <?xml version="1.0" standalone="yes"?> <FileSystem> <Row> <ID>1</ID> <Name>Root</Name>...
1
by: sommarlov | last post by:
Hi everyone >From one of our systems an xml file is produced. I need to validate this file before we send it to an external system for a very lenghty process. I cannot change the xml file layout....
7
by: Bilal | last post by:
Hello, I'm attempting to "populate" an template XML file with some data using identity transform (approach suggested by Joe K.; Thanks! :-) and have come across some strange behaviour using...
4
by: =?Utf-8?B?REZC?= | last post by:
Within an XSLT transformation, I'm trying to switch the default namespace within a section of the generated XML document to a shared namespace. This way, the content of this section does not have...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.