Re: [xsl] xPath and default namespaces.

Subject: Re: [xsl] xPath and default namespaces.
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 11 Apr 2001 22:02:52 +0100
> I'm having some problems with resolving an xPath expression on some XML that
> sets a default namespace like this XHTML code.

this is a FAQ, but basically 

<html xmlns="";

is an element with local name html in the XHTML  namespace 


is a (very inefficient) XPath looking for all instances of an element
with local name body in no namespace. In particular this does not match
any element in the XHTML namespace.

You want to add

to your xsl:stylesheet then match on

h:body rather than body.


This message has been checked for all known viruses by Star Internet delivered
through the MessageLabs Virus Control Centre. For further information visit

 XSL-List info and archive:

Current Thread