xsl-list
[Top] [All Lists]

RE: [xsl] xmlns attr for element nodes creating problem with xslt

2007-04-23 05:08:39
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(_dot_)u(_at_)gmail(_dot_)com] 
Sent: 23 April 2007 12:40
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] 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>

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>