Correcting what I told...
Hi,
You can probably save time and memory by directly passing the file
stream to the XMLParser:
stream := (FileStream readOnlyFileNamed: aFilenameString) readStream.
root := (XMLDOMParser parse: stream) root.
I follow your suggestion Tudor, but it didn't reduce the total time
expended on reading of data or the reduction was minimal.
A question: if you do you have a problem with the
reading part (I mean
to compute the root), or is it spent in the follow up loops?
I not understood well your question. I got to compute almost everything
that I needed, *but for some reason, some data are lost when I iterate on
root*
In truth it can be correct, I messed up to interpret the data.
>> Cheers,
>> Doru
>>
>>
>>
>> 2012/3/9 Júlio Martins <[hidden
email]<http://user/SendEmail.jtp?type=node&node=4459560&i=0>
>> >:
>>
>> > HI!
>> >
>> > I have a optimization problem to solve and I would want some hint of
>> you.
>> >
>> > I am using the xml framework to work with data from xml file, and the
>> > reading of the data is consuming much time.
>> > In my code I do something as:
>> >
>> > | stream root |
>> >
>> > stream := (FileStream readOnlyFileNamed: aPath) contentsOfEntireFile
>> > asString..
>> > root := (XMLDOMParser parse: stream) root.
>> >
>> > root allElementsNamed: 'something' do:[ :eachB|
>> > eachB attributeNodes attributeValueAt: 'list'
>> > ...
>> > eachB allElementsNamed: 'another something' do:{ :eachD|
>> > . eachD attributeNodes attributeValueAt: 'element'
>> > ..
>> > ]
>> > ]
>> >
>> > I know such iteration like that take much time to be executed when the
>> file
>> > read is big. There is a another manner to read the data from xml file
>> that
>> > consume less time as possible? Or have someone an idea to improve this
>> code?
>> >
>> > Julio
>> >
>> > ________________________________
>> > View this message in context: XML Data Parsing
>> > Sent from the Moose mailing list archive at
Nabble.com.
>> >
>> > _______________________________________________
>> > Moose-dev mailing list
>> > [hidden email]
<http://user/SendEmail.jtp?type=node&node=4459560&i=1>
>> >
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>> >
>>
>>
>>
>> --
>>
www.tudorgirba.com
>>
>> "Every thing has its own flow"
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
<http://user/SendEmail.jtp?type=node&node=4459560&i=2>
>>
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
>
> ------------------------------
> View this message in context: XML Data
Parsing<http://forum.world.st/XML-Data-Parsing-tp4459560p4459560.html>
> Sent from the Moose mailing list
archive<http://forum.world.st/Moose-f1310756.html>at
Nabble.com.
>
> _______________________________________________
> Moose-dev mailing list
> Moose-dev(a)iam.unibe.ch
>
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
View this message in context:
http://forum.world.st/Re-Moose-dev-XML-Data-Parsing-tp4459619p4459619.html
Sent from the Moose mailing list archive at
Nabble.com.