D
darenbell
Sorry for having such a specific question, but is there a simple way to
take the XML document below and put it into some sort of organized hash
value without first knowing anything about it?
This is an easy job using something like XML::Simple in Perl, but for
the life of me, I can't figure out an easy way to do this in Ruby.
I'm thinking of some sort of data structure like so:
environment=>authentication=>adminGroup=>description=>'NULL'
environment=>authentication=>adminGroup=>dataType=>'NULL'
environment=>authentication=>adminGroup=>value=>'NULL'
etc...
environment=>database=>databaseHost=>description=>'NULL'
environment=>database=>databaseHost=>dataType=>'NULL'
etc...
XML document:
<environment>
<authentication>
<adminGroup>
<description>NULL</description>
<dataType>NULL</dataType>
<value>NULL</value>
</adminGroup>
<bindUserID>
<description>NULL</description>
<dataType>NULL</dataType>
<value>NULL</value>
</bindUserID>
<bindUserPassword>
<description>NULL</description>
<dataType>NULL</dataType>
<value>NULL</value>
</bindUserPassword>
<ldapServer>
<description>NULL</description>
<dataType>NULL</dataType>
<value>NULL</value>
</ldapServer>
</authentication>
<database>
<databaseHost>
<description>NULL</description>
<dataType>NULL</dataType>
<value>NULL</value>
</databaseHost>
<databaseSchema>
<description>NULL</description>
<dataType>NULL</dataType>
<value>NULL</value>
</databaseSchema>
<databasePort>
<description>NULL</description>
<dataType>NULL</dataType>
<value>NULL</value>
</databasePort>
<databaseUser>
<description>NULL</description>
<dataType>NULL</dataType>
<value>NULL</value>
</databaseUser>
<databasePassword>
<description>NULL</description>
<dataType>NULL</dataType>
<value>NULL</value>
</databasePassword>
</database>
</environment>
TIA
take the XML document below and put it into some sort of organized hash
value without first knowing anything about it?
This is an easy job using something like XML::Simple in Perl, but for
the life of me, I can't figure out an easy way to do this in Ruby.
I'm thinking of some sort of data structure like so:
environment=>authentication=>adminGroup=>description=>'NULL'
environment=>authentication=>adminGroup=>dataType=>'NULL'
environment=>authentication=>adminGroup=>value=>'NULL'
etc...
environment=>database=>databaseHost=>description=>'NULL'
environment=>database=>databaseHost=>dataType=>'NULL'
etc...
XML document:
<environment>
<authentication>
<adminGroup>
<description>NULL</description>
<dataType>NULL</dataType>
<value>NULL</value>
</adminGroup>
<bindUserID>
<description>NULL</description>
<dataType>NULL</dataType>
<value>NULL</value>
</bindUserID>
<bindUserPassword>
<description>NULL</description>
<dataType>NULL</dataType>
<value>NULL</value>
</bindUserPassword>
<ldapServer>
<description>NULL</description>
<dataType>NULL</dataType>
<value>NULL</value>
</ldapServer>
</authentication>
<database>
<databaseHost>
<description>NULL</description>
<dataType>NULL</dataType>
<value>NULL</value>
</databaseHost>
<databaseSchema>
<description>NULL</description>
<dataType>NULL</dataType>
<value>NULL</value>
</databaseSchema>
<databasePort>
<description>NULL</description>
<dataType>NULL</dataType>
<value>NULL</value>
</databasePort>
<databaseUser>
<description>NULL</description>
<dataType>NULL</dataType>
<value>NULL</value>
</databaseUser>
<databasePassword>
<description>NULL</description>
<dataType>NULL</dataType>
<value>NULL</value>
</databasePassword>
</database>
</environment>
TIA