[Mono-list] xsp + xml + TransformArgumentList
Mark Gallop
gallopma at cyllene.uwa.edu.au
Thu Sep 15 02:17:53 EDT 2005
Hello,
I am trying to create a online questionnaire using xsp, xml data and a
xsl transform but I get the following error when using
TransformArgumentList:
System.Xml.XPath.XPathException: expected nodeset: $qload
in <0x0012d> System.Xml.XPath.Expression:EvaluateNodeSet (System.Xml.XPath.BaseIterator iter)
in <0x0001a> System.Xml.XPath.ExprSLASH:Evaluate (System.Xml.XPath.BaseIterator iter)
in <0x00060> System.Xml.XPath.Expression:EvaluateNodeSet (System.Xml.XPath.BaseIterator iter)
in <0x0016a> System.Xml.XPath.EqualityExpr:EvaluateBoolean (System.Xml.XPath.BaseIterator iter)
in <0x00011> System.Xml.XPath.CompiledExpression:EvaluateBoolean (System.Xml.XPath.BaseIterator iter)
....... (many more lines)
Could someone please have a look at the test below and tell me what/if I
am doing wrong? I was able to create a gtk#/gecko# app using the same
data so I think it is a problem with asp:xml.
I have tried with Mono 1.1.8.3 and gentoo on x86 and ppc.
Cheers,
Mark
index.aspx -------------------------------
<%@ language="C#" %>
<%@ Import namespace="System.Xml" %>
<%@ Import namespace="System.Xml.Xsl" %>
<html>
<script runat=server>
void Page_Load(Object sender, EventArgs e)
{
if (!IsPostBack)
{
XmlDocument doc = new XmlDocument();
doc.Load(Server.MapPath("guide.xml"));
XslTransform trans = new XslTransform();
trans.Load(Server.MapPath("guide.xsl"));
XsltArgumentList args = new XsltArgumentList();
args.AddParam("qload", "", "form/question[@id='1.1']");
qaXml.TransformArgumentList = args;
qaXml.Document = doc;
qaXml.Transform = trans;
qaXml.Visible = true;
}
else
{
qaXml.Visible = false;
}
}
</script>
</head>
<body>
<form id="theForm" runat="server" method="post">
<asp:xml runat="server" id="qaXml"/>
</form>
</body>
</html>
guide.xml----------------------
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="guide.xsl"?>
<form>
<question id="1.1">
<text>Is there a bulging eardrum or ear pain?</text>
</question>
<question id="1.2">
<text>Is there a perforation?</text>
</question>
</form>
guide.xsl----------------------
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="qload" select="form/question[@id='1.1']"/>
<xsl:template match="/">
<table height="100%" width="100%">
<tr>
<td valign="top">
<xsl:value-of select="$qload/text"/>
</td>
</tr>
</table>
</xsl:template>
</xsl:stylesheet>
More information about the Mono-list
mailing list