[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: exclude-result-prefixes issue

Subject: RE: exclude-result-prefixes issue
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Thu, 27 May 2004 00:13:44 +0100
exclude result prefixes
> I am having a small problem with prefixes.  I am trying to 
> build a soap
> envelope and am having trouble eliminating namespaces for 
> elements that
> include a prefix.
> 
> I have a very simple stylesheet seen below:
> 
> <?xml version = "1.0" encoding = "UTF-8"?>
> <xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform"
> version = "1.0" xmlns:SOAP-ENV =
> "http://schemas.xmlsoap.org/soap/envelope" exclude-result-prefixes =
> "SOAP-ENV">
> 	<xsl:template match = "/">
> 		<xsl:element name = "SOAP-ENV:Envelope">
> 			<xsl:element name = "SOAP-ENV:Body"/>
> 		</xsl:element>
> 	</xsl:template>
> </xsl:stylesheet>

exclude-result-prefixes only affects literal result elements. Your
stylesheet doesn't contain any literal result elements, so it has no effect.
> 
> The current output is:
> 
> <?xml version = "1.0" encoding = "UTF-8"?>
> <SOAP-ENV:Envelope xmlns:SOAP-ENV =
> "http://schemas.xmlsoap.org/soap/envelope">
> 	<SOAP-ENV:Body/>
> </SOAP-ENV:Envelope>
> 
> I would like the output to be
> 
> <?xml version = "1.0" encoding = "UTF-8"?>
> <SOAP-ENV:Envelope>
> 	<SOAP-ENV:Body/>
> </SOAP-ENV:Envelope>
> 

That is not a namespace-well-formed XML document, so it cannot be produced
using XSLT.

Michael Kay

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.