nkronlage/JavaScripture

Punchdb

Closed this issue · 1 comments

This is a purposal to you to create a database out of punchdb with this:

NodeScript:

All your scripting needs;
Client side,
Server side,
Database side.

NodeScripting.

http://www.jsdb.org

And

http://www.taffydb.com

It's a open source database define for JavaScript. It use E4X to query data between XML and JSON.

I talk to the creature, and spoke my suggestion on improving it. He said that I could do it, but he is currently to busy to attain to it anymore.

I suggest to strip all of E4X feature, EXCEPT the XML object.

Change it's name to DOM(); to mean an document object model query tool, and not the actually document. Keep it's methods and properties.

var doc = DOM();

Doc.load("note.xml");
Doc.load("page.html");
Doc.load("page.xhtml");
Doc.load("pageschema.xsd");
Doc.load("pagetransform.xslt");
Doc.load("database.json");

For example:

XML file to be use:
< note ">"
< date >2002-08-01</ date >
< to >Tove</ to >
Jani</ from >
< heading >Reminder</ heading >
< body >Don't forget me this weekend!</ body >
</ note >

Example:
var Doc=new DOM();
Doc.load("note.xml");

console.log(Doc.note.body);

A display of a few methods:

This /"/note/body"/ is within body element as the last child, after the textNode:
xmlDoc[4].body.ps = "also, don't forget to bring a jacket";

note that body is an object, as note is an array of elements that cannot hold node text. The ps in front adds a new element to body < ps >"Also, don't forget to bring a jacket!"< /ps >:

< note >
<! --...-- >
< body >
Don't forget me this weekend!
< ps >
"Also, don't forget to bring a jacket!"
</ ps >
</ body >
</ note >

This /"/note/"/ is after body element:
xmlDoc.note[note.length ].concat("< ps >also, don't forget to bring a jacket</ ps >");

< note >
<! --...-- >
< body >
Don't forget me this weekend!
</ body >
< ps >
"Also, don't forget to bring a jacket!"
</ ps >
</ note >

This /"/note/"/ is before body element (note: index 4 is note's child heading element)

The following example is the same as:
var note = ["date","to","from","heading","body"];
note.splice(4,0,"ps");
note;//output: ["date","to","from","heading","ps","body"];

Doc.splice(4, 0 , "< ps >also, don't forget to bring a jacket</ ps >");

Taking the XML object and making use of it as a XML/JSON database.

The name for the project could be: J4XJ(JavaScript for XML, and JSON)

Consider this:

Along with the methods and properties of the XML object. Let there be these too:

CRUD:
get(); //retrieve/read
set(); //create, updated, and delete

set and get are universal term in the JavaScript community.

This will become popular do to it's easy to use. By defining two methods that can take care of most situation.

Also an xQuery(); function for magi sting through the dom, if one prefer to do in as so.

THIS SHOULD BE DELETE AFTER YOU READ. FOR IT HAD NOTHING TO DO WITH JAVASCRIPTURE.

Interesting suggestions. I think you should open a separate repository to start working on this and fleshing out your ideas. Closing since it is not related to JavaScripture.com