|
-
May 19th, 2013, 03:01 PM
#1
handle list of data an fast search
i want to create some data structure that will amount of 20K xml.
xml structure will be of type :
<XML><GUID>fcf2664e-d641-48a7-a1aa-2e8fef5145e6</GUID><DATA>.....</DATA><XML>
<XML><GUID>62040b2d-52a4-4ce0-814f-ff5530dde6fc</GUID><DATA>.....</DATA><XML>
and so on...
i want to achive 2 things:
1) i want to remove xml after XX minutes (xx will be general number for all the XML)
2) i want to search over the structure and find the xml by its GUID.
whats the best way to implement this?
-
May 20th, 2013, 11:04 PM
#2
Re: handle list of data an fast search
First of all, the xml you posted isn't valid xml because it's missing closing xml tags (e.g. </XML>).
That being said, do you have control over the xml schema? If so, I would suggest you change the schema to have the guid/data pair as a single node of the xml (rather than a data node following a guid node).
Something like (...please ignore the names I've chosen):
Code:
<nodes>
<node guid="fcf2664e-d641-48a7-a1aa-2e8fef5145e6">
<data>....</data>
</node>
<node guid="62040b2d-52a4-4ce0-814f-ff5530dde6fc">
<data>....</data>
</node>
</node>
Once you have the xml in a format like this (if it's possible), then you can use Xml serialization to read it into a class.
In terms of fast lookup, you can then put each node into a dictionary object and use the guid as the key for fast retrieval.
If this sounds interesting, I can elaborate further.
-
May 21st, 2013, 01:45 AM
#3
Re: handle list of data an fast search
very interesting, i didnt think of serialization, how execlly will it help?
can i maybe combine it with saving the xml as compressed?
-
May 21st, 2013, 02:29 AM
#4
Re: handle list of data an fast search
the exect xml structure is like this:
<XML>
<HEAD>
<GUID>fcf2664e-d641-48a7-a1aa-2e8fef5145e6</GUID>
</HEAD>
<BODY>
<DATA>.....</DATA>
</BODY>
</XML>
and under the data there are more nodes.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|