I am queirying a server and getting a returned xml string within in
a soap wrapper. I have done some searching and found that I can
then sort the data using and XSL style sheet.
My problem is this, I am trying to load both my xml string and then
the xsl string and do the transformNode then return the sorted xml
and display it in my widget.
I keep getting the undefined value _javascript_ error about my
loaded xml string. Here is the code:
=======================
I pass in the xml string and the debug displays it fine.
function sortXML(xmlDoc){
DEBUG("the passed xml is " + xmlDoc);
var myXSLtemplate = "<<?xml version='1.0'?>\n\
<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/TR/WD-xsl\">\n\
<xsl:template match=\"/\">\n\
<table border=\"2\" bgcolor=\"yellow\">\n\
<tr>\n\
<th>Title<\/th>\n\
<th>Artist<\/th>\n\
<\/tr>\n\
<xsl:for-each select=\"CATALOG/CD\" order-by=\"+ ARTIST\">\n\
<tr>\n\
<td><xsl:value-of select=\"TITLE\"/><\/td>\n\
<td><xsl:value-of select=\"ARTIST\"/><\/td>\n\
<\/tr>\n\
<\/xsl:for-each>\n\
<\/table>\n\
<\/xsl:template>\n\
<\/xsl:stylesheet>";
// Load XML
var xml;
xml.load(xmlDoc); HERE IS WHERE THE _javascript_ ERRORS
"undefined value"
// Load the XSL
var xsl;
xsl.load(myXSLtemplate);
// Transform
var sortedXML = xml.transformNode(xsl);
return sortedXML;
}
======================
Any help is appreciated.
Mark