Thomas: XSLT-Elemente für Formulare

Ich versuche gerade in XML ein Standard-Formular zu entwerfen.
Überschriften und normaler Text werden der XSL-Datei entsprechend angezeigt, nicht aber die Formulardefinitionen.
Hier mal ein Auszug der XSL-datei:

<xsl:template match="Formular">
 <form>
 xsl:choose
 <xsl:when test="@Methode='get'">
  <xsl:attribute name="method">get</xsl:attribute>
 </xsl:when>
 xsl:otherwise
  <xsl:attribute name="method">post</xsl:attribute>
 </xsl:otherwise>
 </xsl:choose>
 <xsl:attribute name="action">
  <xsl:value-of select="Adresse" />
 </xsl:attribute>
 </form>
</xsl:template>

<xsl:template match="Angabe">
 <table style="border-width:1; border-style:solid; border-color:#FFFF00; width:99%;">
 <tr>
 <xsl:apply-templates />
 </tr>
 </table>
</xsl:template>

<xsl:template match="Feld">
 <td style="color:#FFFFFF">
 <xsl:value-of select="." />
 </td>
</xsl:template>

<xsl:template match="Eingabe">
 <td style="color:#FFFFFF">
 <input type="text" size="40">
 <xsl:attribute name="name">
  <xsl:value-of select="Name" />
 </xsl:attribute>
 </input>
 </td>
</xsl:template>

<xsl:template match="Selektion">
 <td style="color:#FFFFFF">
 <selection>
 <xsl:attribute name="name">
  <xsl:value-of select="Name" />
 </xsl:attribute>
 </selection>
 </td>
</xsl:template>

<xsl:template match="Option">
 <option>
 <xsl:value-of select="Name" />
 </option>
</xsl:template>

Vielen Dank im Voraus für alle hilfreichen Beiträge,
Thomas

  1. Hallo,

    Ich versuche gerade in XML ein Standard-Formular zu entwerfen.
    Überschriften und normaler Text werden der XSL-Datei entsprechend angezeigt, nicht aber die Formulardefinitionen.
    Hier mal ein Auszug der XSL-datei:

    <xsl:template match="Formular">
    <form>
    xsl:choose
    <xsl:when test="@Methode='get'">
      <xsl:attribute name="method">get</xsl:attribute>
    </xsl:when>
    xsl:otherwise
      <xsl:attribute name="method">post</xsl:attribute>
    </xsl:otherwise>
    </xsl:choose>
    <xsl:attribute name="action">
      <xsl:value-of select="Adresse" />
    </xsl:attribute>
    </form>
    </xsl:template>

    In deinem Template für "Formular" steht nichts was die anderen Templates für die Formularelemente aktivieren würde. Also wird auch nichts angezeigt.

    <xsl:attribute name="action">
      <xsl:value-of select="Adresse" />
    </xsl:attribute>

    <xsl:apply-templates />

    </form>
    </xsl:template>

    Grüße
    Thomas

    1. Danke, ich hab <xsl:apply-templates /> am Ende der Formular-Definitionen eingefügt, dann hat es funktioniert.