Query with XDocument...

  • Thread starter Gustavo Ferrero
  • Start date
G

Gustavo Ferrero

Hi all....

I'm newbie with InfoPath, i tried to make a simple query with XDocument like
this:

function LoadCatalog()
{
var domXML = null;
var domXSL = null;

try
{
// Load the catalog data.
domXML = XDocument.GetDOM("Customers");
domXML.setProperty(
"SelectionNamespaces","xmlns:dfs='http://schemas.microsoft.com/office/infopath/2003/dataFormSolution'
" +
"xmlns:dsf='http://schemas.microsoft.com/office/infopath/2003/dataFormSolution'
" +
"xmlns:s0='http://tempuri.org/'");
domXML.setProperty("SelectionLanguage", "XPath");

// This query in XPATH is OK?
var iNodes =
domXML.selectNodes("/dfs:myFields/dfs:dataFields/dsf:Customers[@Id=2]");
XDocument.UI.Alert();



// Load the catalog xsl from the solution.
domXSL = new ActiveXObject("MSXML2.DomDocument.5.0");
domXSL.async = false;
domXSL.load("catalog.xsl");

// Transform the data and insert it into the DIV.
return domXML.transformNode(domXSL)

}
catch(ex)
{
XDocument.UI.Alert("Unable to load catalog: " + ex.description);
return '<span style="color:red">Catalog Unavailable</span>';
}
}

But the query in XPath didn't filter the result, and return all the rows....

Please, can anyone help me with a simple example...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top