Hacker News new | past | comments | ask | show | jobs | submit login

Or a DOMFS in /dom that's organized in the same hierarchy as the browser DOM. For example, to write a whole page:

    echo "...." > /dom
Update the <title> tag:

    echo "TITLE" > /dom/html/head/title
Change the charset:

    echo "EBCDIC" > /dom/html/head/meta[1].charset // second <meta> tag
    echo "EBCDIC" > /dom/html/head/1.charset       // second child of <head>
Even go full XPath and replace a tag's inner HTML:

    echo "<div>abc</div>" > /dom/[@id='myID']
This is a horrible idea...



Oracle Acquisitions team would like to discuss a business transaction.


This comment is worse and more horrible than the parent.


XPath? What's wrong with the find command?


The way I envisioned it was that attributes are also files themselves, and the contents contain the values. So:

    // given:
    <div id="myID">

    // `id` attribute is located in
    /dom/html/body/…/div[n].id
So unless you look at the contents of the files, you wouldn’t be able to find a certain ID. Because of that, DOMFS (when XPath is enabled) would expose that same "file" at `/dom/[@id='myID']` as well.

I guess you could do something like this?

    grep "myID" /dev/**/*.id
But why would you even use this “DOMFS”?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: