[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Matching all elements in a 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
|
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
|