RE: [xsl] xPath and default namespaces.

Subject: RE: [xsl] xPath and default namespaces.
From: dwight funk <dfunk@xxxxxxxxxxxxxxx>
Date: Wed, 11 Apr 2001 17:19:15 -0500
Is it legal XHTML to give an alias to the XHTML name space ?
I don't include the XHTML DTD because the parser doesn't seem to like it.

Dwight


-----Original Message-----
From: David Carlisle [mailto:davidc@xxxxxxxxx]
Sent: Wednesday, April 11, 2001 4:03 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] xPath and default namespaces.



> 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="http://www.w3.org/1999/xhtml";

is an element with local name html in the XHTML  namespace 

and

 "//body"
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
xmlns:h="http://www.w3.org/1999/xhtml"; 

to your xsl:stylesheet then match on

h:body rather than body.

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered
through the MessageLabs Virus Control Centre. For further information visit
http://www.star.net.uk/stats.asp

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
MESSAGE IS INTENDED ONLY FOR THE USE OF THE INDIVIDUAL OR ENTITY TO WHICH IT
IS ADDRESSED AND MAY CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL
AND EXEMPT FROM DISCLOSURE. If the reader of this message is not the
recipient or an employee or agent responsible  for delivering the message to
the intended recipient, you are hereby notified that any dissemination,
distribution, or copying of this communication is strictly prohibited.  If
you have received this communication in error, please notify the sender
immediately by E-Mail and return the original message to the sender.  Thank
you.

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


Current Thread