Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 20th, 2005, 07:09 AM
Kevin Dean
Guest
 
Posts: n/a
Default 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.


  #2  
Old July 20th, 2005, 07:09 AM
vin sharma
Guest
 
Posts: n/a
Default Re: XSL transformation not finding template

Kevin Dean wrote:
[color=blue]
> 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">[/color]
....
[color=blue]
> </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" />
>[/color]
....
[color=blue]
> </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.
>[/color]

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

  #3  
Old July 20th, 2005, 07:09 AM
Kevin Dean
Guest
 
Posts: n/a
Default Re: XSL transformation not finding template

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" <vin.sharma@NOSPAM.hp.com> wrote in message
news:70q7b.4354$3A6.1068@news.cpqcorp.net...[color=blue]
> Kevin Dean wrote:
>[color=green]
> > I'm trying to create an XSL transformation that will strip out
> > development-specific attributes from deployment descriptors and other[/color][/color]
XML[color=blue][color=green]
> > 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">[/color]
> ...
>[color=green]
> > </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" />
> >[/color]
> ...
>[color=green]
> > </xsl:stylesheet>
> >
> > Basically, I want the XSL transformation to remove the
> > /deployment/globalConfiguration/requestFlow and
> > /deployment/globalConfiguration/responseFlow paths. As I said earlier,[/color][/color]
I[color=blue][color=green]
> > have done this quite successfully in web.xml (stripping out Axis
> > administration servlet) but I'm stumped as to why this wouldn't be[/color][/color]
working[color=blue][color=green]
> > in this instance.
> >
> > Any help would be most appreciated.
> >[/color]
>
> 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
>[/color]


  #4  
Old July 20th, 2005, 07:09 AM
Marrow
Guest
 
Posts: n/a
Default Re: XSL transformation not finding template

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" <NkOdSePaAnM@datadevelopment.com> wrote in message
news:zXp7b.1598$Gr.60181@read1.cgocable.net...[color=blue]
> 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.
>
>[/color]


  #5  
Old July 20th, 2005, 07:10 AM
Kevin Dean
Guest
 
Posts: n/a
Default Re: XSL transformation not finding template

Perfect, thank you.

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


"Marrow" <marrow-NO-@-SPAM-marrowsoft.com> wrote in message
news:OzR7b.1172$lj5.923507@newsfep2-win.server.ntli.net...[color=blue]
> 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[/color]
by[color=blue]
> their URI rather than prefix). Then use that arbitrary prefix in your[/color]
match[color=blue]
> 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" <NkOdSePaAnM@datadevelopment.com> wrote in message
> news:zXp7b.1598$Gr.60181@read1.cgocable.net...[color=green]
> > I'm trying to create an XSL transformation that will strip out
> > development-specific attributes from deployment descriptors and other[/color][/color]
XML[color=blue][color=green]
> > 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,[/color][/color]
I[color=blue][color=green]
> > have done this quite successfully in web.xml (stripping out Axis
> > administration servlet) but I'm stumped as to why this wouldn't be[/color][/color]
working[color=blue][color=green]
> > in this instance.
> >
> > Any help would be most appreciated.
> >
> > --
> > Remove NOSPAM woven into e-mail address to reply directly.
> >
> >[/color]
>
>[/color]


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles