[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
RE: [xsl] I have the XSLT, now need to make it usable as user-inp ut form?
Subject: RE: [xsl] I have the XSLT, now need to make it usable as user-inp ut form?
From: "Kathy Burke" <Kathy_Burke@xxxxxxxxx>
Date: Tue, 22 Apr 2003 14:34:04 -0400
|
Tom, I can see what your javascript would accomplish (exactly what I need).
Would I need to create a var for EACH element that captures user input? or
one that would create the xml_string dynamically using the @name and other
@s of each element? Just wondering...not too strong on javascript...mostly
vb basics...I'm just trying to torture myself with this project!
Again, thank you.
Kathy
-----Original Message-----
From: Passin, Tom [mailto:tpassin@xxxxxxxxxxxx]
Sent: Tuesday, April 22, 2003 2:09 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: [xsl] I have the XSLT, now need to make it usable as
user-inp ut form?
[Kathy Burke]
>
>
> My HTML form is created by applying XSLT templates. For
> example, a <measure>
> element becomes an input box with the @Name applied in the XML. All
> templates spring from a simple structure:
>
> <html>
> <head></head>
> <body>
> <xsl:apply-templates />
> </body>
> </html>
>
> Then I was hoping to just add some vb or javascript to the form as
> needed...is it feasible to do it this way?
>
Yes, very, if I am thinking the same thing as you are.
> >I write a JavaScript which captures the user's input and
> constructs an XML
> string (a
> >well-formed, serialized document, if you will)...
>
> Any way you could show me a bit of an example...?
>
Here is a javascript function I have used in the past. It can be called
recursively. I did not need attributes in this particular application,
but it would not be hard to add them. It is simple but it produces
well-formed xml unless you work hard to defeat it.
// This function builds a tagged XML element
//with given tag name and content
function element(tag,content){
var xml
if (!content) xml='<'+tag+'/>'
else xml='<'+tag+'>' + content + '</'+tag+'>'
return xml
}
You could write something like
var xml_string = element('measure',
element(name,'Form Element 1'),
'this is a sample form element')
xml_string = element('root',xml_string)
You have to think about whether you need to escape any of the data from
the form elements (which I do not show here).
You could have your stylesheet insert the scriping code into the html
document.
Cheers,
Tom P
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 |
- RE: [xsl] I have the XSLT, now need to make it usable as user-inp ut form?, (continued)
- Passin, Tom - Tue, 22 Apr 2003 12:49:33 -0400
- Kathy Burke - Tue, 22 Apr 2003 13:38:43 -0400
- Passin, Tom - Tue, 22 Apr 2003 14:08:55 -0400
- Kathy Burke - Tue, 22 Apr 2003 14:34:04 -0400 <=
- Passin, Tom - Tue, 22 Apr 2003 14:42:56 -0400
- Passin, Tom - Tue, 22 Apr 2003 14:53:59 -0400
|
<- Previous | Index | Next -> |
RE: [xsl] I have the XSLT, now need, Passin, Tom
|
Thread |
RE: [xsl] I have the XSLT, now need, Passin, Tom
|
RE: [xsl] Passing in a node value, Wendell Piez
|
Date |
RE: [xsl] I have the XSLT, now need, Passin, Tom
|
|
Month |
|