Re: [xsl] Namespaces

Subject: Re: [xsl] Namespaces
From: Jarkko.Moilanen@xxxxxx
Date: Tue, 11 Nov 2003 13:40:47 +0200
Lainaus Ricardo Saraiva <rss@xxxxxxxxxxxxxx>:


To get the ns from the result can be avoided, look below:

<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
    xmlns:fo="http://www.w3.org/1999/XSL/Format";
    xmlns:e="http://schemas.xmlsoap.org/soap/envelope/";
    xmlns:d="http://www.w3.org/2001/XMLSchema";
    xmlns:i="http://www.w3.org/2001/XMLSchema-instance";
    xmlns:wn0="http://systinet.com/xsd/SchemaTypes/";
        exclude-result-prefixes="fo e d i wn0"> <<<<<<<<< here
                                                                              
              
    <xsl:template match="/">
    <html>
        <body>
                <xsl:apply-templates select="e:Envelope"/>
        </body>
    </html>
    </xsl:template>
                                                                              
              
    <xsl:template match="e:Envelope">
            <xsl:apply-templates select="e:Body"/>
    </xsl:template>
                                                                              
              
    <xsl:template match="e:Body">
             <xsl:element name="img">
                            <xsl:attribute name = "src">
                                    <xsl:value-of select = "wn0:r/@href"/>
                            </xsl:attribute>
            </xsl:element>
    </xsl:template>
                                                                              
              
</xsl:stylesheet>



<!-- Hello,
<!-- 
<!-- I have the following xml file:
<!-- 
<!-- <e:Envelope xmlns:e="http://schemas.xmlsoap.org/soap/envelope/"; 
<!--  			  xmlns:d="http://www.w3.org/2001/XMLSchema"; 
<!--  
<!-- xmlns:i="http://www.w3.org/2001/XMLSchema-instance"; 
<!--  
<!-- xmlns:wn0="http://systinet.com/xsd/SchemaTypes/";>
<!--  	<e:Body>
<!--  		<wn0:string_Response
<!-- i:type="d:string">Hello</wn0:string_Response>
<!--  		<wn0:r href="C:/Documents and Settings/Ricardo
<!-- Saraiva/Desktop/doc.jpg"/>
<!--  	</e:Body>
<!--  </e:Envelope>
<!-- 
<!-- I want to diplay the image on html.
<!-- From the xsl I've created:
<!-- 
<!-- <xsl:stylesheet version="1.0"
<!--     xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
<!--     xmlns:fo="http://www.w3.org/1999/XSL/Format";
<!--     xmlns:e="http://schemas.xmlsoap.org/soap/envelope/"; 
<!--     xmlns:d="http://www.w3.org/2001/XMLSchema"; 
<!--     xmlns:i="http://www.w3.org/2001/XMLSchema-instance";
<!--     xmlns:wn0="http://systinet.com/xsd/SchemaTypes/";>
<!-- 
<!--     <xsl:template match="/">
<!--     <html>
<!--         <body>
<!--         	<xsl:apply-templates select="e:Envelope"/>
<!--         </body>
<!--     </html>
<!--     </xsl:template>
<!--     
<!--     <xsl:template match="e:Envelope">
<!--     	<xsl:apply-templates select="e:Body"/>
<!--     </xsl:template>
<!--     
<!--     <xsl:template match="e:Body">
<!-- 	     <xsl:element name="img">
<!--             		<xsl:attribute name = "src">
<!--             			<xsl:value-of select = "wn0:r/@href"/>
<!--             		</xsl:attribute>
<!--             </xsl:element> 	   	
<!--     </xsl:template>
<!--     
<!-- </xsl:stylesheet>
<!-- 
<!-- 
<!-- I get the ouput with the namespaces on the html tag. 
<!-- <html xmlns:fo="http://www.w3.org/1999/XSL/Format";
<!-- xmlns:e="http://schemas.xmlsoap.org/soap/envelope/";
<!-- xmlns:d="http://www.w3.org/2001/XMLSchema";
<!-- xmlns:i="http://www.w3.org/2001/XMLSchema-instance";
<!-- xmlns:wn0="http://systinet.com/xsd/SchemaTypes/";>
<!-- <body>
<!-- 	<img src="C:/Documents and Settings/Ricardo
<!-- Saraiva/Desktop/doc.jpg">
<!-- </body>
<!-- </html>
<!-- 
<!-- Why? Is it correct? How can I get free of the namespaces?
<!-- 
<!-- Thanks in advance,
<!-- 
<!-- Ricardo Saraiva.
<!-- 
<!-- 
<!-- 
<!--  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
<!-- 
<!-- 


***************************************************
* Jarkko Moilanen                                 *
* Project Manager, ITCM (www.itcm.org)            *
* Profound XML technology Expert                  *
* University of Tampere                           *
* Hypermedia Laboratory                           *
***************************************************

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread