AW: [xsl] Wrong XML-element being displayed after Transformation

Subject: AW: [xsl] Wrong XML-element being displayed after Transformation
From: Costantino.Sertorio@xxxxxxxxxxxx
Date: Wed, 17 Jul 2002 18:03:10 +0200
Hi Jochen,
that's because if no template matches a part of your document (as is for foo
in your case), the content of that part is simply written to the output by
default.
To avoid this, just add an empty template, like:
<xsl:template match="foo"/>

Costantino

-----Ursprüngliche Nachricht-----
Von: Jochen Metzger [mailto:j.metzger@xxxxxxxxxxxx]
Gesendet am: Mittwoch, 17. Juli 2002 17:36
An: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
Betreff: [xsl] Wrong XML-element being displayed after Transformation

Hi folks,

I'm new to XSLT and XML and have been implementing a lot of that stuff
already in two past weeks.

Now I'm having a problem.

I wonder why a part of the XML-Tree is displayed in the transformed
document, although I have no expression
in the XSL-stylesheet.

I know it something to do which match, but how can I
avoid it?

==> I wonder why he's outputting "TESTTEXT" ??????

Someone having an idea?

Jochen Metzger
Berlin

Here are my XML / XSL - document:

XML ......->
=========
<?xml version="1.0"?>
<module>
 <required>
    <recordset>
      <element name="advertnr" sourcetype="AUTOCREATE">hallo du</element>
       <element name="domains/self_uri"
sourcetype="SETTINGS">http://debug.steptown.home/jmetzger/admin/admin.php
      </element>
    </recordset>
  </required>
  <foo>
   <recordset>
     <element name="hallo">TESTTEXT</element>
   </recordset>
  </foo>
</module>

XSL->
======
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns=http://www.w3.org/TR/REC-html>
   <xsl:output method="html"/>

   <xsl:template match="/">
      <xsl:apply-templates />
   </xsl:template>

   <!-- not complete for testing only -->
   <xsl:template match="module/required/recordset">
     <form action="foo.html" method="post">
        advertnr<input type="Text" readonly="readonly" name="advertnr"
value="{element[@name='advertnr']}" class="readonly" />

     </form>
   </xsl:template>

</xsl:stylesheet>





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

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


Current Thread