|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Add namespaces to a soap xml output
> I need to add one namespaces to all node and remove all tag that not > contains any data from a soap envolpe request : It seems that you don't want to add a namespace, just change the prefix for the namespace from the default (no prefix) to cup: Which is slightly odd as it makes no difference to any namespace aware system which prefix is used, but anyway, something like this: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:cup="some.url"> <xsl:strip-space elements="*"/> <xsl:output indent="yes"/> <!-- most stuff you want to copy: --> <xsl:template match="*"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:apply-templates/> </xsl:copy> </xsl:template> <!-- stuff in cup namespace you want to prefix (why?) --> <xsl:template match="cup:*"> <xsl:element name="cup:{local-name()}"> <xsl:copy-of select="@*"/> <xsl:apply-templates/> </xsl:element> </xsl:template> <!-- zap empty stuff --> <xsl:template match="*[not(node())]" priority="2"/> </xsl:stylesheet> $ saxon cup.xml cup.xsl <?xml version="1.0" encoding="utf-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <cup:RICHIESTA_INFORMAZIONI_ASSISTITO xmlns:cup="some.url" DataOra="200603072355" idCup="150103" idOperatore="df"> <cup:ASSISTITO> <cup:CodFiscale>CRDLCN73L04F839J</cup:CodFiscale> </cup:ASSISTITO> </cup:RICHIESTA_INFORMAZIONI_ASSISTITO> </soapenv:Body> </soapenv:Envelope>
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Cast Your Vote
We need your help – Vote for DataDirect XML Products!
Winners and finalists announced at SOA World Conference in November. Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|







