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

RE: XMLNS attribute in the XML source file

Subject: RE: XMLNS attribute in the XML source file
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Tue, 1 Jul 2003 22:40:58 +0100
xslt xmlns attribute
When you refer in your stylesheet to an element such as
{http:\\nowhere\schema\test}test (using the notation {uri}local-name)
then you must use a prefixed QName such as nowhere:test, where nowhere
is a namespace prefix bound to the URI http:\\nowhere\schema\test.

Incidentally, http:\\nowhere\schema\test is not a valid URI, but
namespace names in practice don't have to be valid URIs. URIs always use
forwards slashes.

Michael Kay


> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Bob Jones
> Sent: 01 July 2003 20:43
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  XMLNS attribute in the XML source file
> 
> 
> I'm trying to figure something out.  I have the following XML file:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <?xml-stylesheet type='text/xsl' href='test.xslt'?>
> <test xmlns="http:\\nowhere\schema\test">
> 	<test2>This is a test</test2>
> </test>
> 
> ...with the following XSL stylesheet:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet version="1.0" 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
>     <xsl:template match="/">
>         <html>
>             <head />
>             <body>
>                 <xsl:for-each select="test">
>                     <xsl:for-each select="test2">
>                         <xsl:apply-templates />
>                     </xsl:for-each>
>                 </xsl:for-each>
>             </body>
>         </html>
>     </xsl:template>
> </xsl:stylesheet>
> 
> ...I can't get the stylesheet to work unless I drop the XMLNS 
> attribute from 
> the XML file (which I really don't want to do).  What do I 
> change in the 
> XSLT to make it work correctly?
> 
> Thanks!
> 
> _________________________________________________________________
> Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
> http://join.msn.com/?page=features/featuredemail
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


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


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.