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

RE: support for namespace axis?

Subject: RE: support for namespace axis?
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Thu, 2 Dec 1999 17:14:07 -0000
RE: support for namespace axis?
> 	IMHO, the stylesheet, which obviously knows the vocabulary that
> includes city, should be able to process documents that reference such
> elements irregardless of the namespace given to that vocabulary in the
> source document, i.e. it shouldn't matter to the match 
> expression whether
> the source contains city elements or blah:city elements. I thought the
> namespace axis was the lever I needed to accomplish this.

No, you don't need namespace axes. You need to specify a prefix on the
"//city" pattern that matches the namespace used for this element in the
source document, thus:

<template match="//po:city" 
xmlns:po="urn:schemas-biztalk.org:your-namespace/purchaseorder.xml">Found a

It's not easy to write a stylesheet that processes all elements with local
name CITY regardless of namespace. That's intentional: the thinking is that
CITY has a completely different meaning in one namespace from its meaning in
another. (Unfortunately the XHTML guys blew this out of the window by having
three different namespaces for HTML, so there goes a good idea). If biztalk
hasn't followed this convention, the way I would tackle it would be to write
a preprocessing stylesheet that strips the namespace prefixes off, by using
<xsl:element name="local-part()">

Incidentally, it's far from obvious from its description in the spec, but
<xsl:copy-of> is a much easier way of doing a deep copy from source to
output than <xsl:copy>.

Mike Kay

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

Current Thread


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.
First Name
Last Name
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.