--00163628369c6b117b049a4a2963
Content-Type: text/plain; charset=ISO-8859-1

On Thu, Jan 20, 2011 at 2:02 AM, Dan Thomas <danthom1000 / gmail.com> wrote:

> Josh,
>
> having re-read, I'm understanding your comments more.  Can't seem to
> delete my last post.
>
>
The forum is a front-end for a newsgroup / mailing list. So, for example, I
am typing this from gmail. Since email isn't mutable, you can't remove posts
once they are made.


> The 'violation of the law of Demeter' is actually what I'm trying to
> fix.  I thought that maybe I should be trying to modify data in the erb
> file, but it sounds like you're saying just use Nogogiri, search for the
> id I want to change, make the change, and save it back to the xml file.
> Sounds good to me.
>
>
I had started to write a response, but my code wasn't working like I wanted,
and I had to go to class before I had a chance to look into it :/

If I understand your code correctly, you are storing your values in an XML
file, and your sinatra app just loads it in to find the values, displays
them to the user with a form to submit updates, receives the updates, and
changes the XML accordingly. If that is the case, the perpetuation of your
data happens in the XML, and if you want to change the data, that is where
you should be changing it. In otherwords, the XML file takes the place of
your database (coincidentally, the class I'm in as I'm writing this is XML
databases!)


> Are there any examples of searching a Nogogiri object using CSS
> selectors, and making a change?  Sorry, I'm out of my element here, and
> appreciate your help. Thanks
>
>
I don't actually know much about using Nokogiri with XML, I usually use it
with HTML, and choose YAML when selecting a format to store my data in. But
I see "Notably, you can even use CSS queries in an XML document!" on
http://nokogiri.org/tutorials/searching_a_xml_html_document.html and it has
an example.

--00163628369c6b117b049a4a2963--