Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
- <soapenv:Body>
- <root>
- <MyElement>content</MyElement>
- </root>
- </soapenv:Body>
- </soapenv:Envelope>
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
- <soapenv:Body>
- <root>
- <NEW xmlns="http://ws.apache.org/ns/synapse">content</NEW>
- </root>
- </soapenv:Body>
- </soapenv:Envelope>
- <xsl:stylesheet xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:avintis="http://www.avintis.com/esb" extension-element-prefixes="avintis" version="2.0" exclude-result-prefixes="#all" xpath-default-namespace="">
- <xsl:output method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/>
- <xsl:template match="/soapenv:Envelope|soapenv:Body">
- <xsl:copy>
- <xsl:apply-templates select="*|text()|@*"/>
- </xsl:copy>
- </xsl:template>
- <xsl:template match="root">
- <xsl:copy>
- <!-- FIRST METHOD - THE METHOD I want to use! this will receive the xmlns="http://ws.apache.org/ns/synapse" -->
- <NEW>
- <xsl:value-of select="MyElement"/>
- </NEW>
- <!-- Second methodworks - but I need to add xmlns="" to every element and there are a lot-->
- <NEW xmlns="">
- <xsl:value-of select="MyElement"/>
- </NEW>
- <!-- Third method works: But not very readable - I would prefer the first method -->
- <xsl:element name="NEW">
- <xsl:value-of select="MyElement"/>
- </xsl:element>
- </xsl:copy>
- </xsl:template>
- </xsl:stylesheet>
- <xsl:stylesheet xmlns="" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:avintis="http://www.avintis.com/esb" extension-element-prefixes="avintis" version="2.0" exclude-result-prefixes="#all" xpath-default-namespace="">
- <xsl:output method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/>
- <xsl:template match="/soapenv:Envelope|soapenv:Body">
- <xsl:copy>
- <xsl:apply-templates select="*|text()|@*"/>
- </xsl:copy>
- </xsl:template>
- <xsl:template match="root">
- <xsl:copy>
- <!-- FIRST METHOD - THE METHOD I want to use! this will receive the xmlns="http://ws.apache.org/ns/synapse" -->
- <NEW>
- <xsl:value-of select="MyElement"/>
- </NEW>
- <!-- Second methodworks - but I need to add xmlns="" to every element and there are a lot-->
- <NEW xmlns="">
- <xsl:value-of select="MyElement"/>
- </NEW>
- <!-- Third method works: But not very readable - I would prefer the first method -->
- <xsl:element name="NEW">
- <xsl:value-of select="MyElement"/>
- </xsl:element>
- </xsl:copy>
- </xsl:template>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement