I am still on page 21. I typed a few lines into a file named example.xml, which looks like:
<?xml version='1.0' encoding='UTF-8'?>
<ListAllMyBucketsResult xmlns='http://s3.amazon.com/doc/2006-03-01/'>
<Owner>
<ID>1a2b3c4d5e6f1a2b3c4d5e6f1a2b3c4d5e6f1a2b3c4d5e6f1a2b3c4d5e6f1a2b</ID>
<DisplayName>jamesmurty</DisplayName>
</Owner>
<Buckets>
<Bucket>
<Name>oreilly-aws</Name>
<CreationDate>2007-09-24T08:20:49.000Z</CreationDate>
</Bucket>
<Bucket>
<Name>my-bucket</Name>
<CreationDate>2007-09-24T08:39:30.000Z</CreationDate>
</Bucket>
</Buckets>
</ListAllMyBucketsResult>
Then I typed a few lines like:
[tsakai]$ irb
irb(main):001:0> xml_text = File.new('example.xml','r').read
=> "<?xml version='1.0' encoding='UTF-8'?>\n<ListAllMyBucketsResult xmlns='http://s3.amazon.com/doc/2006-03-01/'>\n <Owner>\n <ID>1a2b3c4d5e6f1a2b3c4d5e6f1a2b3c4d5e6f1a2b3c4d5e6f1a2b3c4d5e6f1a2b</ID>\n <DisplayName>jamesmurty</DisplayName>\n </Owner>\n <Buckets>\n <Bucket>\n <Name>oreilly-aws</Name>\n <CreationDate>2007-09-24T08:20:49.000Z</CreationDate>\n </Bucket>\n <Bucket>\n <Name>my-bucket</Name>\n <CreationDate>2007-09-24T08:39:30.000Z</CreationDate>\n </Bucket>\n </Buckets>\n</ListAllMyBucketsResult>\n"
irb(main):002:0> require 'rexml/document'
=> true
irb(main):003:0> xml_doc = REXML::Document.new(xml_text)
=> <UNDEFINED> ... </>
irb(main):004:0>
What I don't understand is the response from my last line:
<UNDEFINED> ... </>
Can someone please tell me what this means?
Regards,
Tena Sakai
Attached File(s)
-
example.xml (535bytes)
Number of downloads: 472












