C
castironpi
Any interest in pursuing/developing/working together on a mmaped-xml
class? Faster, not readable in text editor.
class? Faster, not readable in text editor.
castironpi said:Any interest in pursuing/developing/working together on a mmaped-xml
class? Faster, not readable in text editor.
Any hints on what you are talking about?
Stefan
Any interest in pursuing/developing/working together on a mmaped-xml
class? Faster, not readable in text editor.
XML is text-based, so it should -always- be readable in a text editor.
It's part of the definition, I believe.
However, an implementation of one of the alternative binary XML
formats would probably be very welcome.
Fast Infoset:http://www.itu.int/rec/T-REC-X.891-200505-I/en
EXI:http://www.w3.org/TR/2007/WD-exi-20070716/
I don't know enough about either format to say if it would be
possible, but an implementation that conformed to the ElementTree API
could be a big win.
'ab<'a= e.XML( '<a><b>abc</b></a>' )
a.getchildren()[0].text 'abc'
a.getchildren()[0].text= 'ab<'
e.tostring(a)' said:e.XML(_)_.getchildren()[0].text
In an XML file, entries are stored in serial, sort of like this.
AAA BBB CCC DDD
Or more recognizably,
<A><B><C>something</C><D>something</D></B></A>
Point is, to change <C>something</C> to <C>something else</C>, you
have to recopy everything after that.
AAA BBB CCC DDD
AAA BBBb CCC DDD
requires 7 writes, 'b CCC DDD', not 1.
I want to use a simple tree structure to store:
0 A-> None, 1
1 B-> None, 2
2 C-> 3, None
3 D-> None, None
Each node maps to 'Next, Child', or more accurately, 'Next Sibling,
First Child'.
You get constant time updates to contents, and log-time searches.
Hi,
this discussion seems pretty much off-topic for a Python list.
Do I understand you right: you want to access serialised XML data
as a memory
mapped file and operate directly on the byte data?
You would still have to
decode the complete byte sequence to parse it and build your index structure
in that case.
How do you plan to store the pointers to a node's next sibling/child? And how
do you keep them updated over insertions/deletions?
That, plus the copy
overhead in a sequential file, will be very costly on each change.
Every XML tree structure gives you log-time searches. But how do you achieve
constant time updates in a sequential file?
Stefan
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.