unique or distinct count from xml

How to get  a unique count from a xml
<Orders>
<Order  ID="1111" Amount="200"></Order>
<Order ID= "2222" Amount="10"></Order>
<Order ID="3333" Amount="5"></Order>
<Order ID="1111" Amount="20"></Order>
</Orders>
The result should be 3 unique count and the 4 Order  Id counts.
How can i get using
XPathNodeIterator using  Compile,Execute with a XPathNavigator

thanks you

bhu


1
4/26/2006 1:27:57 AM
dotnet.xml 7266 articles. 0 followers. Follow

2 Replies
764 Views

Similar Articles

[PageSpeed] 48

The XPath expression for that is

count(Orders/Order[not(@ID=preceding-sibling::Order/@ID)])

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

-1
george5726 (13)
4/26/2006 7:41:00 AM
Thank you  it worked.

"George Bina" <george@oxygenxml.com> wrote in message 
news:1146037260.246389.220930@i40g2000cwc.googlegroups.com...
> The XPath expression for that is
>
> count(Orders/Order[not(@ID=preceding-sibling::Order/@ID)])
>
> Best Regards,
> George
> ---------------------------------------------------------------------
> George Cristian Bina
> <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
> http://www.oxygenxml.com
> 


3
5/1/2006 12:17:58 PM
Reply:

Similar Artilces:

defining unique range of cells for different sheets as the same n.
I want to use the same name, month9, to refer the same range of cells, but on different sheets, how do i turn off the global define? When you define the name (Insert|name|Define), include the sheet name in the "names in workbook" box: sheet1!month9 or 'sheet 1'!month9 You can select your range and type this in the name box (to the left of the formula bar), too. KSAPP wrote: > > I want to use the same name, month9, to refer the same range of cells, but on > different sheets, how do i turn off the global define? -- Dave Peterson ...

How do I create a filter to return counts
I have sales data that I would like to create a report on. This report would count the number of events based upon the total and seperate them by year. In Excel it looks like this: 2003 2004 2005 2006 2007 $0 - $1,000 134 98 69 40 7 $1,000 - $5,000 212 152 147 120 17 $5,000 - $15,000 73 94 94 92 20 $15,000 - $25,000 17 18 24 27 1 $25,000 - $50,000 8 15 22 16 0 $50,000 + 2 7 7 9 1 I can create seperate queries to giv...

How to convert an xml file to another ?
Hello, I have to convert an xml file to another xml file that is very similar, but some content are different, and the names of some nodes are different. In fact it's a response to a message : while in the original file there is <XXX>, the response file should contain <XXXResponse> with the same content : It's quite easy to modify the InnerText of a node, but it's impossible to rename the node : Is there a smart way to do this ? Thanks for help. ------------------------------------------------------- Patrice Dargenton patrice.dargenton@free.fr http://patrice.dargenton.f...

Beginner: Is HWND unique?
Hi! When I start an application twice and ask each application for the handle of its main window (calling an inbuild COM function), are the returned dwords guaranteed to be different? Thanks a lot for your help! Volker -- For email replies, please substitute the obvious. It is not guaranteed to be the same or different. You might get the same HWND towice in a row, or might get different ones between two instances of your program. AliR. "Volker Hetzer" <firstname.lastname@ieee.org> wrote in message news:ed9gei$di9$1@nntp.fujitsu-siemens.com... > Hi! > When I start an ...

Counting totals for weekly reports
I've got a report which prints off student absences, I'd like to print off a total for the number of absences in the week, and a total for the number of students who are absent, I've done this for the monthly report but when I set the student code to count in the design view for the weekly report it still counts each student individually instead of totalling the absences. Add a footer for the weekly grouping on the report and set the controlsource to: = Sum([Absences]) or whatever the Absence field name is. -- Arvin Meyer, MCP, MVP http://www.datastrat.com ht...

Count Reports Sent Before A Specific Time
I am trying to count the number of reports were sent before 4 pm each day. If the time difference between 4 PM and when the report is sent is greater than 1, then I want that to count as 1. If the time difference is a negative number, then I do not want that report to be counted. My formula so far is: =Count((DateDiff("m",[4:00 PM],[Preparedness]![Time AM Report Sent])<=1)) But all that is doing is counting all reports. Is there a better/easier way to do this? Many thanks! Caro Parsing your formula I see you are wanting to know how many months between [4:00 PM] a...

XML Web Service Asynch Result Error in Generated Code
Hope this is the best forum for this, any suggestions for another are appreciated. I have a simple Compact Framework (2) app that sends some data to a web service and acts despending on the response. I added the web service as a web reference (in VS2005 VB) and then have a bit of code that calls the service like this: Dim webService As New com.companynamehere.webservices.CheckList Dim wsCallback As New AsyncCallback(AddressOf ProcessCallBack) webService.BeginSubmit(xmlForm, wsCallback, Nothing) The ProcessCallBack function that handles the asynch result looks like this: Sub ProcessCal...

Convert simple spreadsheet to XML
Is there a utility to create an XML map from teh inforamtion within a spreadsheet? Can we point it at the header row of a table and use it as the basis of an XML map for the table. This would bring up a panel that would then allow us to add any additional info required to finish creating the XML map for the spreadsheet flat file. I am looking for a simple function that end users can use on their existing spreadsheets. -- Bruce "Bruce" <Bruce@discussions.microsoft.com> wrote in message news:10C6F13E-23AD-4DF2-87AB-50C4FE77BEE2@microsoft.com... > Is there a utility ...

xml source in help files
I'm using Money 2004 Deluxe on Win 2k Pro (with all the latest patches and service packs). I recently installed Money for the first time a few days (from CD). The problem that I'm having is that the Help documentation shows up as XML source - so I see all of the tags, etc. - which makes it extremely difficult to read. The only posts I've found that describe a similar problem say to delete temporary internet files. I tried that, but still have the same problem. I've also tried re- installing with no luck. Thanks for any help, John You might try this, from an unpublis...

Validate XML against schema file
Hello, I'm using the import directive: #import <msxml.dll> USING NAMESPACE MSXML for this project. Basically, I just have a question, and rather than look through all of the disconnected documentation on MSDN and xml.com, I thought I might ask someone here. I'm using VC++ 6.0, and attempting to verify an XML file against a .xml schema file. I can do this when everything is included in one file, with the following code: // Initialize objects and variables. IXMLDOMDocument2Ptr pXMLDoc = NULL; IXMLDOMParseErrorPtr pError = NULL; _bstr_t strResult = ""; ...

How can I define unique font per each Outlook profile?
We have several Outlook profiles on one computer and each user wants their own font. I noticed changing to one type of font in one profile affects all the other user profiles in Outlook. Is there a way to assign unique fonts to each Outlook profile? Many thanks experts... Each user would need their own Windows login.=20 --=20 Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for=20 Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstar...

unique record numbers
I am trying to create a unique PIN for members in a table (not the primary key) that will be 4 digits long, and would like each new entry to be incremental. I am very new, and would appreciate a detailed instruction (though I can get around access fair enough). Any help would be appreciated. On Fri, 5 Mar 2010 19:19:44 -0800, Rev David Bissas <Rev David Bissas@discussions.microsoft.com> wrote: The "DMax + 1" technique should work for you. Google or Bing for it. -Tom. Microsoft Access MVP >I am trying to create a unique PIN for members in a table (not t...

System.Xml.XmlDocument with (x)html entities
Hello all, I'm having a bit of a problem with System.Xml.XmlDocument. The scenario is as follows: I receive a dataset containing some data fetched from database. I can retrieve a string containing the data with Dataset.GetXml method. Inside the xml document, in a datatable field, I have an xhtml document that may contain xhtml entities (for example &nbsp; or &apos;). When I do a XmlDocument.LoadXml, these xhtml entities crash the LoadXml method. I've tried looking into the XmlResolver class, but haven't found a way to get it to work with XmlDocument. Anyone? TIA, S...

Pull Unique Values From a List/Table
How can I pull unique values from a table? I track vendors who might sell multiple items, but I only need to show the vendor once so I can pull other information. There are also may be blanks in the rows if the vendor is inactive. Thanks! Let me add one more twist to this problem: The unique values also need to filter out where it may be 'VendorA - West' and 'VendorA - East' and combine them into one record. I only need it to show VendorA and not both records East and West (same company, just different drop ship location). Thanks! "Karl Burrows" <kfb1@spa...

Counting with conditions based on another range
HI. I've tried several different ways now to the experts :) I have two rows of data: Emp Lvl Rating 1 4 2 3 2 2 1 4 1 2 2 3 I need to count How many emp lvl 2's with rating 2 = 1 what is the formula for this? Try this: =3DSUMPRODUCT((A1:A6=3D2)*(B1:B6=3D1)) Hope this helps. Pete On Nov 27, 9:25=A0am, stephanie <stepha...@discussions.microsoft.com> wrote: > HI. =A0I've tried several different ways now to the experts :) ...

Parsing and Counting Matches
I have two columns of data. The first column is not important for this exercise but the second column contains a series of state initials. I need to count the number of times the states initials appear in the second column and place the total count in a column designated for that state. I have attached a two row sample of what the finished sheet should look like. I am not a VBA programmer but have a lot of programming experience in other programming languages. Can this be accomplished using a series of Excel functions or do I need to write a VBA program to do this? Any help with this is gr...

Count Duplicates
How can I isolate the number of records where a field is duplicated i.e. we have a barcode field in our stock DB where we have discovered there are some duplicated barcodes. We have tried to pull the data into a pivot table using the count function of stock codes that carry the same barcode, but all we get is a count of 1 even though we know some of the barcodes are duplicated. Does this make sense? Anyway is there another way of using Excel to filter barcodes? TIA Select the column with the codes and go menu Data > Filter > Advanced filter, choose "unique items only"...

Flat files to XML
Hello all, How can I convert unstructured flat files into structured XML? Are there any scientific articles and tools that handles this subject? Bye, hakhan Check out http://tinyurl.com/4vgn8 creating custom XmlReaders is a nice way to deal with with CSV or Fixe width files, although don't know exactly what you mean by unstructure files.. - jsm3 ----------------------------------------------------------------------- Posted via http://www.mcse.m ----------------------------------------------------------------------- View this thread: http://www.mcse.ms/message1165932.htm ...

Is there any a "unique" function performs on CStringArray or CStringList?
Is there any a "unique" function performs on CStringArray or CStringList? I know there is an algorithm function "unique" performing on containers in Standard C++ library. Is there a similar function in MFC? What am I doing now to avoid adding same strings to container is: CStringList strList; ..... if (strList.Find("somestring") == NULL) strList.AddTail("somestring"); But I realized it may be an inefficient way. Any good sugestion? I would have used a CMap for this. Then, when all insertions were done, I might consider converting it to a CArray...

m_pDocument Doc/View unique id for each view
I'm using the standard mfc mainform with a doc/view. While I'm in the view portion I need to track the actions taken individually and separately for each view. So when when I click on view one I track that in a separate place than view two. I there a unique id or index for each view? Something like m_pDocument->ID? Thank you, Joshua <jtfaulk@eudoramail.com> wrote in message news:1111085780.370621.117620@f14g2000cwb.googlegroups.com... > I'm using the standard mfc mainform with a doc/view. While I'm in the > view portion I need to track the actions taken...

Can't load xml containing \v
I have an xml document that I am trying to load, which contains RTF text. I get the error, "{"'\v', hexadecimal value 0x0B, is an invalid character. Line 1, position 24." }" when I call this code. System.Xml.XmlDocument xmlNewDocument = new System.Xml.XmlDocument(); xmlNewDocument.LoadXml("<TextExpanderPlainText>\v</TextExpanderPlainText>"); This loads without any errors in IE, but not .Net XML. Is there anything I can do to get the xml string to load not knowing if it may contain any special processing values like "\v"? Than...

Unique Values, not Unique Records
My data looks like the following: ID Type Amt 1234 A $10.00 1234 B $10.00 1234 C $10.00 I would like to find a way to get only one of the items on to a new spreadsheet, because they are duplicate records in my eyes. The Advanced filter does not work because each record is unique. Can anyone help? in the dialog for the advanced filter, make sure only the ID column is referenced "steph44haf" wrote: > My data looks like the following: > > ID Type Amt > 1234 ...

Get-ChildItem.Count not working with one file
I'm executing the following command on a directory that has one file in it. When I execute it, there is never a result. Only when I add a second file does it come back with an answer. any help? (Get-ChildItem c:\temp\output *.csv).Count If I run the normal Get-ChildItems c:\temp\output I do see one file listed. Hello Steve, > I'm executing the following command on a directory that has one file > in it. When I execute it, there is never a result. Only when I add a > second file does it come back with an answer. any help? > > (Get-ChildItem c:\tem...

Unique Constraints
Hello, I have a Users table with 2 fields, UserName and Visible. The same UserName can exist many times with Visible = 0 but just one record can exist for the same UserName with visible = 1. In my Stored Procedure before inserting a new visible user I check the user doesn't exist in the table with visible = 1, but that is not enough, there are cases when the Stored Procedure is called in the same moment with the same parameters and there is duplicated data. I can't define a Unique constraint because UserName with visible = 0 is not unique, what would be the best way...

.net and XML schema *.XSD ???
Hello, I'm a newbie in XML and .Net I've a function that return some XML I've also a XML schema *.XSD What should I do with all this things ? I had try myDataSet.ReadXML("c:\myfile.xml") but I've got some errors 'Bad xml file, Tag non close ..) thanks olivier olivier wrote: > I'm a newbie in XML and .Net > I've a function that return some XML > I've also a XML schema *.XSD > > What should I do with all this things ? > I had try > > myDataSet.ReadXML("c:\myfile.xml") > > but I've got some errors ...