[xsl] [text nodes] Unmatching text nodes wrongly inserted

Subject: [xsl] [text nodes] Unmatching text nodes wrongly inserted
From: Chizzolini Stefano <chist@xxxxxx>
Date: Wed, 22 Sep 2004 18:15:16 +0200
Hi all,

I tried to render this xml:

<?xml version="1.0" encoding="ISO-8859-1"?>
<documents xmlns="http://www.aaa.it/consulta/xdmModel";>
 <document id="2003722011924">
   <caption>Fattura 1924/2003 di AAAAAA SpA</caption>
  <body format="pdf" base="fatture/">
    <page template="FTNORM.pdf">
      <field name="CSBFT242">FATTURA DI VENDITA</field>
      <field name="CSBFT009">1</field>
      <field name="CSBFT010">2003-12-18</field>

transforming it with this ridiculous XSLT stylesheet:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0" xmlns:xdm="http://www.aaa.it/consulta/xdmModel";>
 <xsl:template match="xdm:fields">
  <map font-family="Courier" font-size="10pt" height="1" x-unit="in/10"
 <xsl:template match="xdm:field[@name='CSBFT242']">
  <label x="20" y="56" width="12">
   <xsl:value-of select="."/>

but the result was quite horrific:

<?xml version="1.0"?>
Fattura 1924/2003 di AAAAAA SpA
<map font-family="Courier" font-size="10pt" height="1" x-unit="in/10"
y-unit="in/6" xmlns:xdm="http://www.aaa.it/consulta/xdmModel";>
 <label x="20" y="56" width="12">FATTURA DI VENDITA</label>

As you can see, the core transformation is right, but the XSLT processor
inserted also all the unwanted text node values!
I checked all the above code, but I'm really puzzled.

What's wrong in my stylesheet?

Many thanks


Current Thread