Form to XML (tutorial example)

<html> <head>
include vb-script source as follows.
<script type="text/vbscript" src="ui-form2xml-1.bas"></script>
</head> <body>
make a form and specify its action.
<form action="vbscript:make">
declare the document properties. ( OPTIONAL )
<div id="documentproperties">
<select name="xWriteTo"> ... </select>
switches how to make a new document.
<input name="xFileName" ... />
gives a name of XML file to be created. (when "write to file")
declare the root document.
<div id="rootdocument" title="JediKnightsBook">
above line makes a root document with <JediKnightsBook>.
in this section,
  • SPAN tags give the structure of the document.
  • its title attribute gives an XML element name.
  • use @ + name for an XML attribute name.
  • XML texts are give by INPUT, SELECT and TEXTAREA tags.
<span title="Person"> makes an element node of <Person>. <span title="@id"> makes an attribute of <Person id=" ">. </span> <span title="Sex"> makes an element node of <Sex> </Sex>. </span> <span title="Name"> makes an element node of <Name>. <span title="FirstName"> makes an element node of <FirstName> </FirstName>. </span> <span title="LastName"> makes an element node of <LastName> </LastName>. </span> </Name> </span> <span title="Word"> makes an element node of <Word>

</Word> </span>
</Person> </span>
</JediKnightsBook> </div>
put a button to the form.
<input type="submit">
</form> </body> </html>