expression in a custom XSLT Context Function (implementing IXsltContextFunction like this MSDN example) in .Net but the Invoke function gets called one result at a time so I have no visibility of the other results to find duplicates.
1) Is there a way of doing this using a single XPath 1.0 expression?
2) Is there a way of passing in an array of elements into a single Invoke call of the custom XSLT Context Function class? I'm working in VB.Net but am happy with any C# examples anyone can share.
Is the following possible in one XPath expression (see sample below) Select all (span tags of class msg) AND all ((img tags that have a non-empty alt attribute) AND (are NOT located inside a span tag of class msg))
Trying to figure out XPath and I have successfully create an XPathExpression that lets me grab the events, but any nested sub groups seem to be unavailable to the query, I can get all the children on the Events group, but the LocationName field I can not access.[code]...
Given the xml below why does the first selectsinglenode call not work but the second one does? Are the single quotes specifying a string type or something? Dim dbglvlnode As Xml.XmlNode = doc.SelectSingleNode(String.Format("Config/Scanner[DeviceID = '{0}']/DebugLevel", XMLstuff.DeviceID)) Dim dbglvlnode As Xml.XmlNode = doc.SelectSingleNode(String.Format("Config/Scanner[DeviceID = {0}]/DebugLevel", XMLstuff.DeviceID)) <?xml version="1.0" standalone="yes"?> [Code] ......
The xml document is like so: ... I would like to use XPath to Navigate but I am not sure where to get started. Can anyone point me to some examples of traversing the nodes? I have the first part figured out but not sure how to iterate through all l1,l2,l3,l1 nodes...
I have the following XML from Amazon's Marketplace API. I need to sum all the values of Item/ItemPrice/Component[type='Principal']/Amount for all Items to compute an order total. Is this possible to do using LINQ to XML in VB.NET?
My goal is to just select the 2nd one, the <span> tag and am not sure why <p> tag is also being selected. If it selects <p>, but why wouldn't it also select the <strong> or <a>, and why not the <table> or <td> that contain the <p>?
I am trying to find the value of <media:thumbnail url>. Right now I have an xpathnnavigator set up but if i need to use another method of parsing the xml, I can do that.
I use an XPathNavigator Select to get a node iterator in the code below and get an invalid token error. If I take out the @contract I do not get an error. I then have to use MoveToAttribute, which works, but shouldn't be needed. Why do I get an error when the @ syntax is valid XPath?
I'm all new to this treeview business. I have a fixed treeview, very simple and basic. Only two levels, parent and child nodes. I just need two things out of this treeview.
1) If parent is checked, check all child nodes.
2) If just one child node is unchecked, uncheck parent node.
That's it! I've been looking for this for 30 mins and I cant find it. Maybe because my vb.net is old, it doesnt seem to be the same as others =/ I'm using vb.net 2003.
I'm running out of walls to bang my head against. Okay new windows form with a textbox, button and TreeView Populate the TreeView.nodes with the default nodes via properties
[Code]...
I want to click button1 and have the name of the childnode? Node3? placed in the textbox. Not via selection, I can do that. But via index or item number. The code I have is as follows
I have this data in txt file and the data keeps changing all the time.
[code]...
I would like to read all lines and compare, if the same name and same address is found, which is in the [......], then i need to count it and show the most frequent buyer!should i read it all and put in array, and compare and put the duplicate data and count into another array?
I have the following 2 lines of code:[code]I'm looking to get the value for first instance of lastWriteTime which should be 2011-10-13T10: 48: 48. 3833771-04:00 but the code just pops up an empty string. Sorry for the big post but here is the entire XML file for reference. Can anyone see why this isn't working, or give me an example of how to make it work some other way? [code]
I have an XElement and an XPath expression that selects a node from it. It works fine in the original program that I wrote it in but doesnt work if I paste it to another program. I've checked the references and import statements.
I think the problem might be that the original program had the code within the class of a wpf window while it was moved to a abstract class where it doesnt work.[code...]
I have a XPath expression that is supposed to return/get only one node out of the XML document. But it is getting more than the one. I don't understand why.
Code-behind:
Dim xmlNameTbl As XmlNameTable = rootDoc.NameTable Dim xmlNS As XmlNamespaceManager = New XmlNamespaceManager(xmlNameTbl) xmlNS.AddNamespace("asp", "http://test.com/asp")
There are multiple occurances of the PLUS_BORROWER data. For each occurence of PLUS_BORROWER, I want to save the CREDIT_SCORE and DAYTIME_PHONE_NBR when the Type= And SOCIAL_SECURITY_NBR are certain values. Then I want to execute a loop and extract the Credit_Score and Daytime_Phone_Nbrs.
I have the following code that will pull off the first PLUS_BORROWER if the Type='Primary', but I am having trouble expanding it.
oExtraData.Load(myXMLFile) 'only select nod with type attribute equal primary Dim oNode As Xml.XmlNode = oExtraData.SelectSingleNode("//PLUS_BORROWER[@Type='Primary']") 'get credit score node Dim scoreNode As Xml.XmlNode = oNode.SelectSingleNode("CREDIT_SCORE") MsgBox("I have the Primary") MsgBox("Credit score is " & scoreNode.InnerText)
There are multiple occurances of the PLUS_BORROWER data. For each occurence of PLUS_BORROWER, I want to save the CREDIT_SCORE and DAYTIME_PHONE_NBR when the Type= And SOCIAL_SECURITY_NBR are certain values.Then I want to execute a loop and extract the Credit_Score and Daytime_Phone_Nbrs.[code]
I'm trying to get the value of a specific <div> from an html. This div has a class attribute of "itemPrice6", but problem is that this class appears few more times for other <div>s in which i'm not interested in. Best thing for me is if I am able to access the needed <div> using something like XPATH so I can target only those I need.
My Code: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim web As New HtmlAgilityPack.HtmlWeb Dim doc As HtmlAgilityPack.HtmlDocument = web.Load("[URL]") Dim prices As HtmlAgilityPack.HtmlNodeCollection = [Code] .....
I am using the httplistener to grab xml off a POST.. so I dont have a file.. I just take the xml string and put to string.. but I tried to use this code..
I have a List object and I want to remove the duplicated items but leaving at least one of the duplicated items in the list;I wrote something like this however I would optimize this code for better performance, is there something faster?
Const chars As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" Dim rnd As New Random() Dim mylist As List(Of String) = Enumerable.Range(1, 100).Select(Function(i)