W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2002

Re: I am having a problem with using XSD & XSL in the same document

From: Jeni Tennison <jeni@jenitennison.com>
Date: Wed, 23 Oct 2002 10:00:14 +0100
Message-ID: <151123188960.20021023100014@jenitennison.com>
To: xmlschema-dev@w3.org, "vze3y7w8" <boris.kortiak@verizon.net>
CC: boris@kortiak.com

Hi Boris,

> If you look at the XML source, about the third line down, you will
> see a commented out root declaration with information about the CSD
> as generated by XMLSPY.
> The problem I am having is that if I restore that line and comment
> out the other root declaration I only get the data contents of the
> XML document and no XSL formatting is performed.

(Instead of "root declaration", you should say "document element start
tag" -- the thing that you are switching in and out is the start tag
of the document element.)

The problem that you are encountering is due to the fact that the
start tag generated by XMLSpy includes a default namespace


Read up on namespaces at:


When the default namespace is included (i.e. when you use the XMLSpy
start tag) all the elements in your XML document are in your
In XPath, which you're using in your XSLT, when you select an element
using only its local name (i.e. without a prefix to indicate a
namespace) then you're always referring to an element *in no
namespace*. For example:

<xsl:template match="/FamilyTree">

will only match FamilyTree elements in no namespace.

If you want to make it match FamilyTree elements in your namespace
then you must declare that namespace, with a prefix, in your
stylesheet, and use that prefix for every element name that you refer
to in your stylesheet. Something like:

<xsl:stylesheet version="1.0"

<xsl:template match="/ft:FamilyTree">

Read more in the XSL FAQ at:


By the way, this has nothing to do with using XML Schema. Questions
about XSLT are best sent to XSL-List



Jeni Tennison
Received on Wednesday, 23 October 2002 05:00:20 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:58 UTC