Re: support for namespace axis?

Subject: Re: support for namespace axis?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 2 Dec 1999 16:25:24 GMT
you have set the default namespace in your stylesheet to be xsl.

	<template match="//city">

would match all city elements from the xsl namespace.

This is not what you want.

> I thought the
> namespace axis was the lever I needed to accomplish this.

No all you need do is declare the namespaces that appear in your source
in your stylesheet, with perhaps differing prefixes.

city is in the namespace 

so if you declare that namespace to be prefix x: in your stylesheet
then what you want is

	<template match="//x:city">Found a city

If you really don't care about the second namespace in your source
document then....

XSL does not let you wildcard on namespaces, so you can not
do *:city however you can get the same effect by wildcarding on all
element nodes and then filtering on local-name

	<template match="//*[local-name(.)='city']">Found a city


 XSL-List info and archive:

Current Thread