[Rails] Re: XML::LibXML::Reader

2009-06-08 Thread Jeffrey L. Taylor
Glad it is working. Jeff Quoting lecielbleu : > > ok Jeff i solved problem , using "doc" was a bad mistake :) thanks for > your support ,here is the last codes > > while reader.read > case reader.name > when "Brand_name" >

[Rails] Re: XML::LibXML::Reader

2009-06-07 Thread lecielbleu
ok Jeff i solved problem , using "doc" was a bad mistake :) thanks for your support ,here is the last codes while reader.read case reader.name when "Brand_name" name_from_xml = reader.read_stri

[Rails] Re: XML::LibXML::Reader

2009-06-04 Thread Jeffrey L. Taylor
I'm afraid I don't understand what you are trying to do here. 'doc' isn't in the example below. So how the loop would change its value, I am unclear. It seems like you are saying a loop with an unchanging condition runs forever. Yes, it does. Did you intend to do this: while reader.read put

[Rails] Re: XML::LibXML::Reader

2009-06-04 Thread lecielbleu
i tried also while doc == true while doc = 1 while doc results dont change On Jun 4, 12:51 pm, lecielbleu wrote: > i guess problem is while reader line because when i run basic code > below : > > while doc == true >                         puts reader.read_string >                 end > > s

[Rails] Re: XML::LibXML::Reader

2009-06-04 Thread lecielbleu
i guess problem is while reader line because when i run basic code below : while doc == true puts reader.read_string end strings never stops in the command line , it turns infinite loop. On Jun 4, 12:48 am, "Jeffrey L. Taylor" wrote: > There are no head

[Rails] Re: XML::LibXML::Reader

2009-06-03 Thread Jeffrey L. Taylor
There are no header tags. I have no idea how libXML will behave. It isn't very tolerant of invalid input. Try adding the puts statements I've inserted below to find out how far it is getting. Quoting lecielbleu : > > my xml data seems like that : 2 Brand_id>HP > and here is my codes > > de

[Rails] Re: XML::LibXML::Reader

2009-06-03 Thread lecielbleu
my xml data seems like that : 2HP and here is my codes def xml_testing require'xml' reader = XML::Reader.file('c:/brands.xml') stack = [] while reader case reader.node_type when XML::Reader::TYPE_

[Rails] Re: XML::LibXML::Reader

2009-06-03 Thread Jeffrey L. Taylor
Have not seen this error before. Please show more of your code. Jeffrey Quoting lecielbleu : > > i tried this an get an error = > NoMemoryError > failed to allocate memory > error line number 30 =stack << reader.name --~--~-~--~~~---~--~~ You received this

[Rails] Re: XML::LibXML::Reader

2009-06-03 Thread lecielbleu
i tried this an get an error = NoMemoryError failed to allocate memory error line number 30 =stack << reader.name On Jun 2, 6:59 pm, "Jeffrey L. Taylor" wrote: > Quoting lecielbleu : > > > > > is there anybody who knows how we can get child values using libxml > > (Reader class) > > >    de

[Rails] Re: XML::LibXML::Reader

2009-06-02 Thread Jeffrey L. Taylor
Quoting lecielbleu : > > is there anybody who knows how we can get child values using libxml > (Reader class) > > def xml_import_to_brands > require'xml' > reader = XML::Reader.file('c:/brands.xml') > . For docs, go to http://libxml.rubyforge.org/rdoc/i