|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








