473,378 Members | 1,523 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 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 2408
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.