Hello,
I have a xml file like the following.
<?xml version="1.0">
<data>
<idef units="Vin,Vout,E">
<i id="i1">
<sample num="1">
<sampledata value="2;3;7" />
</sample>
<sample num="2">
<sampledata value="8;1;7" />
</sample>
</i>
<i id="i33"<!-- The Id is totally random -->
<sample num="1">
<sampledata value="2;3;7" />
</sample>
<sample num="2">
<sampledata value="6,2,5" />
</sample>
</i>
<s id="s1">
<sample num="1">
<sampledata value="2" unit="k" />
</sample>
<sample num="2">
<sampledata value="8" unit="k" />
</sample>
</s>
<s id="s2"><!-- The Id is totally random -->
<sample num="1">
<sampledata value="7" unit="k" />
</sample>
<sample num="2">
<sampledata value="8" unit="k" />
</sample>
</s>
<e id="Ea">
<sample num="1">
<sampledata value="9" unit="k" />
</sample>
<sample num="2">
<sampledata value="4" unit="k" />
</sample>
</e>
<e id="Eb">
<sample num="1">
<sampledata value="1" unit="k" />
</sample>
<sample num="2">
<sampledata value="8" unit="k" />
</sample>
</e>
</data>
Now I want to parse it and make 10 List<from these.
Lists are ,
Ea: 9,4
Eb: 1,8
s1: 2,8
s2: 7,8
i1-Vin: 2,8
i1-Vout:3,1
i1-E:7,7
i33-Vin: 2,6
i33-Vout:3,2
i33-E:7,5
How to do this?
What library should I use? is there any standard way to do this?
Its a C# desktop application. Is there any way to directly use the
xml file as multiple datasource??
I need something which is faster. Casue the file is way too large
15MB.
Thanks 3 3235 mu*******@gmail.com wrote:
Hello,
I have a xml file like the following.
<?xml version="1.0">
<data>
<idef units="Vin,Vout,E">
<i id="i1">
<sample num="1">
<sampledata value="2;3;7" />
</sample>
<sample num="2">
<sampledata value="8;1;7" />
</sample>
</i>
<i id="i33"<!-- The Id is totally random -->
<sample num="1">
<sampledata value="2;3;7" />
</sample>
<sample num="2">
<sampledata value="6,2,5" />
</sample>
</i>
<s id="s1">
<sample num="1">
<sampledata value="2" unit="k" />
</sample>
<sample num="2">
<sampledata value="8" unit="k" />
</sample>
</s>
<s id="s2"><!-- The Id is totally random -->
<sample num="1">
<sampledata value="7" unit="k" />
</sample>
<sample num="2">
<sampledata value="8" unit="k" />
</sample>
</s>
<e id="Ea">
<sample num="1">
<sampledata value="9" unit="k" />
</sample>
<sample num="2">
<sampledata value="4" unit="k" />
</sample>
</e>
<e id="Eb">
<sample num="1">
<sampledata value="1" unit="k" />
</sample>
<sample num="2">
<sampledata value="8" unit="k" />
</sample>
</e>
</data>
Now I want to parse it and make 10 List<from these.
Lists are ,
Ea: 9,4
Eb: 1,8
s1: 2,8
s2: 7,8
i1-Vin: 2,8
i1-Vout:3,1
i1-E:7,7
i33-Vin: 2,6
i33-Vout:3,2
i33-E:7,5
Sorry, I don't see how these "lists" relate to the input XML.
What kind of lists do you want to create? List<int>?
What is Ea or Eb, part of a list, or some kind of variable name for a list?
How to do this?
Well the .NET framework has the low level but fast forwards only
XmlReader API to parse XML. Then it has XPathDocument/XPathNavigator for
XPath 1.0 based reading and navigation. .NET 3.5 also has LINQ to XML.
I need something which is faster. Casue the file is way too large
15MB.
Faster than what?
--
Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/
On Jun 15, 7:09 am, Martin Honnen <mahotr...@yahoo.dewrote:
muquad...@gmail.com wrote:
Hello,
I have a xml file like the following.
<?xml version="1.0">
<data>
<idef units="Vin,Vout,E">
<i id="i1">
<sample num="1">
<sampledata value="2;3;7" />
</sample>
<sample num="2">
<sampledata value="8;1;7" />
</sample>
</i>
<i id="i33"<!-- The Id is totally random -->
<sample num="1">
<sampledata value="2;3;7" />
</sample>
<sample num="2">
<sampledata value="6,2,5" />
</sample>
</i>
<s id="s1">
<sample num="1">
<sampledata value="2" unit="k" />
</sample>
<sample num="2">
<sampledata value="8" unit="k" />
</sample>
</s>
<s id="s2"><!-- The Id is totally random -->
<sample num="1">
<sampledata value="7" unit="k" />
</sample>
<sample num="2">
<sampledata value="8" unit="k" />
</sample>
</s>
<e id="Ea">
<sample num="1">
<sampledata value="9" unit="k" />
</sample>
<sample num="2">
<sampledata value="4" unit="k" />
</sample>
</e>
<e id="Eb">
<sample num="1">
<sampledata value="1" unit="k" />
</sample>
<sample num="2">
<sampledata value="8" unit="k" />
</sample>
</e>
</data>
Now I want to parse it and make 10 List<from these.
Lists are ,
Ea: 9,4
Eb: 1,8
s1: 2,8
s2: 7,8
i1-Vin: 2,8
i1-Vout:3,1
i1-E:7,7
i33-Vin: 2,6
i33-Vout:3,2
i33-E:7,5
Sorry, I don't see how these "lists" relate to the input XML.
What kind of lists do you want to create? List<int>?
What is Ea or Eb, part of a list, or some kind of variable name for a list?
How to do this?
Well the .NET framework has the low level but fast forwards only
XmlReader API to parse XML. Then it has XPathDocument/XPathNavigator for
XPath 1.0 based reading and navigation. .NET 3.5 also has LINQ to XML.
I need something which is faster. Casue the file is way too large
15MB.
Faster than what?
--
Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/
By the following,
s2: 7,8
i1-Vin: 2,8
I meant
List<ints2;
List<inti1_Vin;
I need it .net 1.1 dependent hardly 2.0 (if I don't find any way ).
I was thinking if there is any tool or api which will directly output
List<>. and I'll give the description of the xml data. May be in xml
format.
Thanks for the XPathDocument/XPathNavigator names.
I'll check if that works for me.
<mu*******@gmail.comwrote in message
news:15**********************************@d77g2000 hsb.googlegroups.com...
On Jun 15, 7:09 am, Martin Honnen <mahotr...@yahoo.dewrote:
>muquad...@gmail.com wrote:
Hello,
I have a xml file like the following.
List<ints2;
List<inti1_Vin;
I need it .net 1.1 dependent hardly 2.0 (if I don't find any way ).
..NET 1.1 doesn't support generics so you can't use 1.1 and List<T>.
--
Joe Fawcett (MVP - XML) http://joe.fawcett.name This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Dave |
last post by:
Hello all,
After perusing the Standard, I believe it is true to say that once you
insert an element into a std::list<>, its location in memory never changes.
This makes a std::list<> ideal for...
|
by: matty.hall |
last post by:
I have two classes: a base class (BaseClass) and a class deriving from
it (DerivedClass). I have a List<DerivedClass> that for various
reasons needs to be of that type, and not a List<BaseClass>....
|
by: Brian Pelton |
last post by:
I am not sure how to fix this problem I've stumbled into...
I have a list<> of an interface type. I need to pass that list to a
method that adds more objects to the list.
But, eventually, I...
|
by: Varangian |
last post by:
Hello, there
I have a problem with regards to System.Collections.Generic.List<T>
I need to pass a class with implements an interface - TestClass :
IPerson
I put this class in a...
|
by: Paul |
last post by:
Hi,
I feel I'm going around circles on this one and would appreciate some other
points of view.
From a design / encapsulation point of view, what's the best practise for
returning a private...
|
by: Iron Moped |
last post by:
I'm airing frustration here, but why does LinkedList<not support the
same sort and search methods as List<>? I want a container that does not
support random access, allows forward and reverse...
|
by: Andrew Robinson |
last post by:
I have a method that needs to return either a Dictionary<k,vor a List<v>
depending on input parameters and options to the method.
1. Is there any way to convert from a dictionary to a list...
|
by: Zytan |
last post by:
This returns the following error:
"Cannot modify the return value of
'System.Collections.Generic.List<MyStruct>.this' because it is
not a variable"
and I have no idea why! Do lists return copies...
|
by: Lee Crabtree |
last post by:
This seems inconsistent and more than a little bizarre.
Array.Clear sets all elements of the array to their default values (0,
null, whatever), whereas List<>.Clear removes all items from the...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |