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

Re: Matching all elements in a namespace

Subject: Re: Matching all elements in a namespace
From: Kjetil Kjernsmo <kjetil@xxxxxxxxxxxx>
Date: Sat, 7 Feb 2004 23:39:45 +0100
xsl match on namespace
On Saturday 07 February 2004 22:42, Michael Kay wrote:
> > So, the obvious thing felt like something like...:
> > <xsl:template match="namespace-uri() =
> > 'http://www.w3.org/TR/xhtml1/strict'">
> > 	      <xsl:copy-of select="."/>
> > </xsl:template>
> >
> > ...and I've tried numerous variations over this theme over the past
> > couple of weeks, but it doesn't "work".
>
> When the obvious thing doesn't work, the time has come to read the
> spec.

Uhm, well, yeah, I know. Sort of did that... And I often enjoy reading 
specs. And I have this big book. But you know, when you're confused 
from the outset, details often slip by...

> You can match all elements in a namespace by writing
>
> <xsl:template
> match="*[namespace-uri()='http://www.w3.org/TR/xhtml1/strict']"

Aha, pling, that makes sense!

> or by
>
> <xsl:template match="xhtml:*"
> xmlns:xhtml="http://www.w3.org/TR/xhtml1/strict">

Right. OK, when you say that, some points that were unclear from the faq  
(matching namespaces in source document), makes a whole lot more sense 
in light of this. 

> Whether <xsl:copy-of> is really what you want to do inside the
> template rather depends on details of the requirement, which you
> haven't explained very fully.

Probably because the requirements are not very clear to me at this 
point... :-) I'm having a steep learning curve... I didn't choose XSLT 
because I knew how to write it, but because it looked like an 
interesting approach. So your help is highly appreciated. I'll try to 
ask more intelligently the next time! :-)

Thanks a lot, I'll try these suggestions out tomorrow!

Best,

Kjetil
-- 
Kjetil Kjernsmo
Astrophysicist/IT Consultant/Skeptic/Ski-orienteer/Orienteer/Mountaineer
kjetil@xxxxxxxxxxxx  webmaster@xxxxxxxxxx  editor@xxxxxxxxxxxxxxxxxxxxxx
Homepage: http://www.kjetil.kjernsmo.net/        OpenPGP KeyID: 6A6A0BBC


 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.