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

Re: filtering elements using identity transform

Subject: Re: filtering elements using identity transform
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 31 Mar 2005 15:39:43 +0100
using local name
> An article I read on the web 
Not a good article I would guess.

> discouraged using local-name b'cos it strips the prefixes.

using local-name makes sense iff you want to just match on the local
name, ignoring namespaces, which you would want to do here, if you can't
change your input format. So this is a possibility.

> The recommended one was
> <xsl:template match="node()[not(starts-with(name(), "b:"))].

No, that form is almost always (actually I would say always) a bad idea
as it is matching on a specific prefix rather than the namespace name
(ie the URI associated with the namespace).

Really, if you have control over your input format you would be in a
much better position if you used xhtml for the html elements 
and the v3 namespace for the v3 elements, used like this

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v3="urn:hl7-org/v3">

          <v3:slideshow author="Yours Truly" title="Sample Slide Show" date
="Date of publication"  >

By using a v3: prefix on the slideshow element uyou avoid polluting the
nested elements into that namespace so they are still xhtml.

In the XSLT you then no longer needs separate templates for all the html
elements you can simply do

<xsl:template match="h:*" >
 an xhtml element was here

<xsl:template match="v3:*">
 an v3 element is copied
 <xsl:copy-of select="@*"/>

so long as you have


on your xsl:stylesheet so these namespaces are in scope in the


This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:

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.