This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Error Gen'ing XML from HTML
Hi. What I'm trying to do seems a little bit the reverse of what
everyone else is doing. I'm taking user input on a generated html page,
using javascript to format an xml file and then calling a stored
procedure on an oracle webserver. The html file is generated from an
XSQL file (using XSL).
I'm getting an error and I've stripped it down to bare essentials. It
doesn't matter what XML doc you run it against as I'm not actually using
any of the XML data for this test. Here's the error I'm getting:
Invalid xml declaration. Error processing resource
'file:///C:/working/smalltest.xsl'. Line 15, Position 21
ValueXml = "<?xml version='1.0'?>\n";
--------------------^
Even though the PI is in quotes, I get the error. My xsl file is below.
My question I guess, is how do I embed an xml PI in an xsl stylesheet?
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">
<html>
<head>
<script language="javaScript">
var valueXml;
function submitForm()
{
alert( "In the formSubmit" );
ValueXml = "<?xml version='1.0'?>\n";
ValueXml +="<ROWSET><ROW>\n";
ValueXml +="<CUST_NO>1</CUST_NO>\n";
ValueXml +="</ROWSET></ROW>\n";
SubmitForm.docXml.value = ValueXml;
SubmitForm.submit();
}
</script>
</head>
<body>
<form name="submit_form" onclick="submitForm()">
<input type="submit"/>
<input type="hidden" name="DocXml"/>
</form>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Thanks for any guidance.
--
Lewis Cunningham
NDS Systems
Tel : 727-538-2250
Mail: lewis@ndsapps.com
Web : www.ndsapps.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list