Re: Input Fields in XML

Subject: Re: Input Fields in XML
From: anette.engel@xxxxxxxx
Date: Fri, 4 Dec 1998 18:05:21 +0100
Aneel Nazareth wrote the appended text

Do I understand it right:
You are creating an HTML-File including Input Fields from a XML-File
using XSL:
file.xml + file.xsl => file.html with Input Fields

Is there a way of creating an XML-File from a HTML-File containing
and the vlaue of these input fields?

file.html with value in Input Fields => file.xml

Anette Engel
(just another XSL Newbie)

Aneel Nazareth <anazaret@xxxxxxxxxxxx> on 12/02/98 05:26:44 PM

Please respond to xsl-list@xxxxxxxxxxxxxxxx

To:   xsl-list@xxxxxxxxxxxxxxxx
cc:    (bcc: Anette Engel/crmm)
Subject:  Re: Input Fields in XML

> does anyone has an idea to generate an XML-File that contains the
> Input.Value from an HTML Input Field?
I've played around with this a little bit, and been pretty successful with
just encoding the entire XML document in the HTML document. I've used XSL
stylesheets to write the HTML pages directly from the XML. This has the
benefit of being easy and the drawback of being big. Add some storage
mechanism, and <poof/>! instant web database! (Ok, there are some other
I've added a sample below of the HTML, the XML, and the XSL. If you look at
the XSL, you'll notice that the two different fields require two different
rules to create. This would not be the case if there were a standard XSL
mechanism for extracting the names of tags.
Caveats: there's a piece missing here, the CGI backend. I'm using a Java
servlet that just concatenates the contents of the "xml" CGI parameter
together and runs it through the XSL styler, but your CGI engine may deal
differently with multiple values with the same name (Like concatenate with
commas, for example). Also, I've only tested this stylesheet with my own
processor. If you're using XT or Koala or something YMMV.

<TITLE>XSL Form Styler</TITLE>
<FORM METHOD="POST" ACTION=" the action goes here... ">
<H1>CD Collection: Disc View</H1>
<INPUT VALUE="&lt;CD&gt;
" TYPE="HIDDEN" NAME="xml"/>
<P> Artist: <INPUT VALUE="&lt;ARTIST&gt;" TYPE="HIDDEN" NAME="xml"/>
<INPUT SIZE="60" VALUE=" Peter Gabriel " TYPE="TEXT" NAME="xml"/>
" TYPE="HIDDEN" NAME="xml"/>
<P> Album Title: <INPUT VALUE="&lt;TITLE&gt;" TYPE="HIDDEN" NAME="xml"/>
<INPUT SIZE="60" VALUE=" Shaking The Tree: Sixteen Golden Greats "
TYPE="TEXT" NAME="xml"/>
" TYPE="HIDDEN" NAME="xml"/>
<INPUT VALUE="&lt;/CD&gt;" TYPE="HIDDEN" NAME="xml"/>

<CD> <ARTIST> Peter Gabriel </ARTIST><TITLE> Shaking The Tree: Sixteen
Greats </TITLE></CD>

<INPUT TYPE="TEXT" SIZE="60" NAME="style" VALUE=""/>
<H1>CD Collection: Disc View</H1>
<INPUT TYPE="HIDDEN" NAME="xml" VALUE="&#38;lt;CD&#38;gt;
<INPUT TYPE="HIDDEN" NAME="xml" VALUE="&#38;lt;/CD&#38;gt;"/>
<xsl:template match="ARTIST" xsl:space="preserve">
<INPUT TYPE="HIDDEN" NAME="xml" VALUE="&#38;lt;ARTIST&#38;gt;"/>
<INPUT TYPE="TEXT" SIZE="60" NAME="xml" VALUE="{.}"/>
<INPUT TYPE="HIDDEN" NAME="xml" VALUE="&#38;lt;/ARTIST&#38;gt;
<xsl:template match="TITLE" xsl:space="preserve">
Album Title:
<INPUT TYPE="HIDDEN" NAME="xml" VALUE="&#38;lt;TITLE&#38;gt;"/>
<INPUT TYPE="TEXT" SIZE="60" NAME="xml" VALUE="{.}"/>
<INPUT TYPE="HIDDEN" NAME="xml" VALUE="&#38;lt;/TITLE&#38;gt;

 XSL-List info and archive:

 XSL-List info and archive:

Current Thread