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

RE: elements in a namespace

Subject: RE: elements in a namespace
From: Mike Brown <mbrown@xxxxxxxxxxxxx>
Date: Sun, 6 Jun 1999 15:08:08 -0600
RE: elements in a namespace
Steve Dahl was quite helpful. Here is a summary of what he told me in
private email. Hopefully my interpretation is correct: 

1. Once a namespace is defined for an element, you must identify that
element by the combination of its namespace prefix and the element name;
simply referring to the element name by itself means "element with this name
and with no namespace".

Example:
If element <Department> contains <Employee> contains <FirstName>, and all
are in the namespace assigned to prefix "mine", a variable could be bound to
the value of the content of <FirstName> like this:

<xsl:variable name="Some_First_Name"
expr="/mine:Department/mine:Employee/mine:FirstName"/>

2. There's no way to define a default namespace to make the above any
easier.

3. The binding of an element to a namespace doesn't affect its attributes.
Attributes only need to be referenced with a prefix if they are specifically
bound to a namespace themselves. Example:

<!-- attribute 'src' of element <img>, where <img>
     is in namespace bound to prefix 'xhtml' -->
<value-of select="xhtml:img/@src"/>

<!-- same, but with 'src' in namespace bound to prefix
     'myAttributes' -->
<value-of select="xhtml:img/@myAttributes:src"/>



 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.