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

RE: xmlns attr for element nodes creating problem with

Subject: RE: xmlns attr for element nodes creating problem with xslt
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 23 Apr 2007 13:08:17 +0100
RE:  xmlns attr for element nodes creating problem with
It's rather unorthodox to treat the presence of a namespace declaration as
significant if there are no elements or attributes in your document actually
using that namespace: this isn't the way namespaces were intended to be
used. However, it can be done:

<xsl:copy-of select="//INDEX[namespace::doc='http://xmlns.oracle.com/ku']"/>

What you can't do is to treat namespace declarations as attributes. In the
XPath data model, namespaces and attributes are quite different things, that
just happen to share a similar surface syntax.

Also: who allocated the namespace "http://xmlns.oracle.com/ku" and what does
it mean? Namespaces in "oracle.com" should (as a matter of etiquette and
good design practice) be allocated only by Oracle Corp as the owner of the
domain name.

Michael Kay
http://www.saxonica.com/ 


> -----Original Message-----
> From: Dhanu Ubale [mailto:dhanu.u@xxxxxxxxx] 
> Sent: 23 April 2007 12:40
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  xmlns attr for element nodes creating problem with xslt
> 
>  Hi all,
> I m facing a small issue. I have a xml file for which i have 
> written a xsl file to transform to another xml(demo.xml).I am 
> not able to select the nodes which have xmlns attribute. Can 
> u tell me what has to be done.Snapshot of files:
> xml file:
> <ROWSET>
> <ROW>
> <INDEX version="1.0" >
> <SCHEMA>AD Design</SCHEMA>
> <NAME>AD_FILES_N1I</NAME>
> </INDEX>
> <INDEX version="1.0" xmlns:doc="http://xmlns.oracle.com/ku">
> <SCHEMA>AD Design</SCHEMA>
> <NAME>AD_FILES_N1I</NAME>
> </INDEX>
> </ROWSET>
> </ROW>
> 
> xsl File
> 
> <?xml version='1.0' encoding='utf-8' ?>
> <xsl:stylesheet 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
> version="1.0"> <xsl:output method="xml"/> <xsl:template 
> match="/ROWSET"> <xsl:apply-templates select="ROW/INDEX"/> 
> </xsl:template> <xsl:template match="ROW/INDEX"> <xsl:copy-of 
> select="."/> </xsl:template> </xsl:stylesheet>
> 
> 
> O/P xml:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <INDEX version="1.0" >
> <SCHEMA>AD Design</SCHEMA>
> <NAME>AD_FILES_N1I</NAME>
> </INDEX>

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.