|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Read XML file
Hi!
I tryed to read an XML file and to store the data such as nodes and values in the dictionary. I know that dictionary is unordered siquence. I can not use tuple because I have add more from another file later on. Does anybody know what I should use in order to have it stored in the some kind of container in the same order that it is in XML file? Thanks. |
|
#2
|
||||
|
||||
|
Perhaps this can help?
http://aspn.activestate.com/ASPN/Co...n/Recipe/107747
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest Down with Sharon Osbourne Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month |
|
#3
|
||||
|
||||
|
On the subject of what types to use for containers i'd probably go for a mix of list and dictionaries. This way you can use the list to keep the nodes/groups ordered and then use dictionary to store the different node names i.e.
Code:
nodes = [{'name1': 'value', 'name2': 'value'}, {'name1': 'value', 'name2': 'value'}] and so on...
from an XML doc something like this: Code:
<group>
<name1>value</name1>
<name2>value</name2>
</group>
<group>
<name1>value</name1>
<name2>value</name2>
</group>
Note: none of this is ment to work i'm simply trying to explain the basic idea...Hope this is of some help, Mark. Last edited by netytan : February 23rd, 2004 at 06:09 PM. |
|
#4
|
|||
|
|||
|
Thanks to all. It worked.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > Read XML file |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|