<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Help me SORT this out....please!!!</title><link>https://www.infopathdev.com:443/forums/thread/14516.aspx</link><pubDate>Tue, 02 May 2006 15:31:32 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14516</guid><dc:creator>bad_andy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14516.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14516</wfw:commentRss><description>Thanks for the reply, and sorry for not getting back sooner.  I haven't been able to get very far with QuickWatch, so this is all I can give you for now:&lt;br /&gt;&lt;br /&gt;The function that calls the getNode() functions seems to be  getNodeValue:&lt;br /&gt;&lt;br /&gt;/*------------------------------------------------------------------------------&lt;br /&gt;	getNodeValue()&lt;br /&gt;------------------------------------------------------------------------------*/&lt;br /&gt;function getNodeValue(xpath, defaultValue)&lt;br /&gt;{&lt;br /&gt;	var xmlNode = getNode(xpath);&lt;br /&gt;&lt;br /&gt;	if (isInvalidOrEmpty(xmlNode))&lt;br /&gt;		return (arguments.length &amp;gt; 1) ? defaultValue : "";&lt;br /&gt;	else&lt;br /&gt;		return xmlNode.text;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;and the function that calls getNodeValue is the one that handles the button:&lt;br /&gt;&lt;br /&gt;function btnReSort::OnClick(oEvent)&lt;br /&gt;{&lt;br /&gt;	// Avoid side effects when DOM is read only.&lt;br /&gt;	if (XDocument.IsDOMReadOnly)&lt;br /&gt;		return;&lt;br /&gt;&lt;br /&gt;	// It is used by comparison function, and to flag sort in progress.&lt;br /&gt;	// The generation of unique keys is suppressed while sort is in progress.&lt;br /&gt;	g_xpathSortBy = getNodeValue("/at:assetTracking/at:tempSortBy");&lt;br /&gt;		&lt;br /&gt;	if (!g_xpathSortBy)&lt;br /&gt;		return;&lt;br /&gt;&lt;br /&gt;	sort("/at:assetTracking/at:assets", "at:asset", compareAssets);&lt;br /&gt;&lt;br /&gt;	// Unblock generation of unique keys.&lt;br /&gt;	g_xpathSortBy = "";&lt;br /&gt;}</description></item><item><title>Re: Help me SORT this out....please!!!</title><link>https://www.infopathdev.com:443/forums/thread/14515.aspx</link><pubDate>Tue, 02 May 2006 01:40:01 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14515</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14515.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14515</wfw:commentRss><description>This seems like your XPath is wrong. Can you paste the string that you pass to the getNode() function?&lt;br /&gt;&lt;br /&gt;If this string is automatically generated you can add a QuickWatch in the Microsoft Script Editor that will tell you what the value of this variable is.</description></item><item><title>Help me SORT this out....please!!!</title><link>https://www.infopathdev.com:443/forums/thread/12852.aspx</link><pubDate>Mon, 01 May 2006 21:19:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12852</guid><dc:creator>bad_andy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12852.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12852</wfw:commentRss><description>I'm clueless when it comes to jscript.  That's why I chose a sample form as a basis for mine.  Here's the deal...I've created a form with a repeating table so that the user can input as many lines as necessary.  Now I want to give other users the ability to sort the form data as they see fit.  Since the Asset Tracking sample form is conceptually very similar, I copied the entire code over to my form and named my fields accordingly.  Of course, now I have a lot more code than I need, but that's a good problem to have, as long as the code works.  Problem is, it doesn't work.  When I click the Sort button, which corresponds to the reSort function in Asset Tracking, I get an error in the getNode function.  The error points to the "return XDocument" line below.&lt;br /&gt;&lt;br /&gt;Since I'm clueless at this stuff, can someone explain why this would be giving me an error?  What sort of things should I be looking for to correct this problem?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/*------------------------------------------------------------------------------&lt;br /&gt;getNode()&lt;br /&gt;------------------------------------------------------------------------------*/&lt;br /&gt;function getNode(xpath)&lt;br /&gt;{&lt;br /&gt;// Both XML node and absolute XPath are allowed.&lt;br /&gt;if (typeof(xpath) == "string")&lt;br /&gt;return XDocument.DOM.selectSingleNode(xpath);&lt;br /&gt;else&lt;br /&gt;return xpath;&lt;br /&gt;}&lt;br /&gt;</description></item></channel></rss>