[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
RE: [xml-dev] Revive of E4X and Xqib
- From: Emanuel Allen <emanuelallen@hotmail.com>
- To: "'Rushforth, Peter'" <Peter.Rushforth@NRCan-RNCan.gc.ca>,<xml-dev@lists.xml.org>
- Date: Fri, 25 Jul 2014 14:53:36 -0400
// it's not prefect, but this is what I'm hoping for:
var doc0
doc0 =
{html:[
{head:[
{title:[
{textNode:"string"}
]}
]},
{body:[
{h1:"text"},
{p:[{textNode:"string string string"},
{strong:"string"},
{em:"strong"}
]},
{img:[
{src:"string.jpg"},
{name:"string"}
]},
{section:[
{name:"string"}
]},
{a:[
{textNode:"stringValue"},
{href:"http://urlStringValue.com"},
{name:"string"}
]},
{a:[
{textNode:"W3C"},
{href:"http://www.w3.org"},
{name:"w3"}
]}
]}
]};
doc0.html[0].head[0].title[0].textNode;
doc0.html[1].body[0].h1;
doc0.html[1].body[1].p[0].textNode;
//I know, repitieeve more than programming, but that when xPath(); method
comes in.
I have to lay off this, I'm still a novice. I got to get back to my
studying.
-----Original Message-----
From: Rushforth, Peter [mailto:Peter.Rushforth@NRCan-RNCan.gc.ca]
Sent: Friday, July 25, 2014 1:53 PM
To: L2L 2L; xml-dev@lists.xml.org
Cc: William Velasquez
Subject: RE: [xml-dev] Revive of E4X and Xqib
I vaguely recall welcoming the idea of E4X, and I recall JSON eclipsing it
in the end.
But it does seem to me that E4X fits pretty closely with the extensible web
manifesto:
" We prefer to enable feature development and iteration in JavaScript,
followed by implementation in browsers and standardization. To enable
libraries to do more, browser vendors should provide new low-level
capabilities that expose the possibilities of the underlying platform as
closely as possible."
I think access to XML via the E4X api is just such a "low-level" capability
that is needed for XML to be useful to web applications. Maybe its revival
should target MicroXML?
Good luck!
Where's the home page of your revival movement?
Regards,
Peter
-----Original Message-----
From: William Velasquez [mailto:wvelasquez@visiontecnologica.com]
Sent: July 25, 2014 12:10
To: L2L 2L; xml-dev@lists.xml.org
Subject: RE: [xml-dev] Revive of E4X and Xqib
I understand your interest in reviving E4X, and wish you success in your
effort.
But from my point of view, you have the same chances that an alcohol
prohibition initiative these days.
The reason: the way the standards arise today (for good or evil) is
something like the expressed Extensible Web manifesto:
http://extensiblewebmanifesto.org/
Personally I don't promote it, and there are many points of view against it
(some on this list, even from me). But pragmatically speaking, that's the
way the things work today in the web.
But there is still hope for you in the form of libraries.
If your need is related to javascript (in the browser or server) you can
find some libraries out there and most important, people with the need and
the knowledge to build and maintain them.
In the case of E4X there are some libraries like e4x.js
https://github.com/eligrey/e4x.js/
Alain Couthures (the creator of XSLTForms) is working in a full replacement
of DOM for browser called Fleur.js https://github.com/AlainCouthures/Fleur
Even it doesn't includes e4x support, he or somebody else could add it to
the features.
My best wishes,
- Bill
-----Mensaje original-----
De: L2L 2L [mailto:emanuelallen@hotmail.com] Enviado el: jueves, 24 de julio
de 2014 6:50 p. m.
Para: xml-dev@lists.xml.org
Asunto: [xml-dev] Revive of E4X and Xqib
Xqib. I am a novice programmer who fell in love with ECMAScript, and XML. I
feel in love with xml after I found xqib. I was and still am zeal about it
that I push myself to learn xml, xslt, schema(and out of respect DTD).
I am currently trying to accomplish two things:
One: revive of e4x
Two: revive of xqib
My proposal for e4x:
An interface point of view(short and simple)
Change spec name to EDPQO(ECMAScript's DOM Parser & Query Object)
EDPO acting as a internal representation of the DOM in an ESON(JSON) format
All communication with this representation via ESON(JSON) syntax
Scrap everything but the methods and properties.
Change the XML(); object name to DOM(); to indicate that it's for XML, HTML,
XHTML, XSLT, Schema, and the likes(anything that's is base XML.
A reference interface object; allowing communication with the document
object model through a shallow copy of it via ESON(JSON) syntax:
var doc = DOM();
Doc.load(note.xml);
Doc.load(page.html);
Doc.load(page.xhtml);
Doc.load(pageschema.xsd);
Doc.load(pagetransform.xslt);
All access possible via ESON(JSON) syntax.
Allow xPath 1.0 support through the method:
xPath(*/expression*/);
To use xPath expression to nevigate through the DOM object.
Example: doc.xPath("/html/body/p");
Remove support for native element via <></>
For example:
XML file to be use:
<note>
<date>2002-08-01</date>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body> </note>
Example:
E4X spec.
var Doc=new DOM();
Doc.load("note.xml");
ESON syntax:
console.log(Doc.body);
Along with ESON(JSON) syntax, allow for added method of Number, String,
Array, Object, RegRxp. Since data type are automatically wrapped, they
should be NO complication of allowing this.
A display of a few methods:
This /**"/note/body"**/ is within body element as the last child, after the
textNode:
Doc[4].body.ps = "also, don't forget to bring a jacket";
note that body is an object, as note is am array of elements that cannot
hold node text. The body.ps 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:
Doc[Doc.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"];
xmlDoc.splice(4, 0 , "<ps>also, don't forget to bring a jacket</ps>");
xPath 1.0 for the xPath(); method
With attribute, I say to use the xPath(/*expression*/); method to retrieve
that via string:
<date attr="value">
2002-08-01
</date>
Doc.xPath("/note/date/@attr");
//xPath 1.0 spec
);
Via ESON syntax:
/*as the attribute node(object) is a child of the date node(object); it
stand to reason that it is also a object within the date object that can
only hold text*/
Doc[0].date[0].attr"; //"value"
For xqib, please look at this site:
http://www.xqib.org/index.php
The old e4x program is already written, just need to be extracted to adopt.
Mirth connect is an open source that have the e4x still apart of their
software.
My apologies for and mistake.
Thank you for reading.
E-S4L
_______________________________________________________________________
XML-DEV is a publicly archived, unmoderated list hosted by OASIS to support
XML implementation and development. To minimize spam in the archives, you
must subscribe before posting.
[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
subscribe: xml-dev-subscribe@lists.xml.org List archive:
http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
_______________________________________________________________________
XML-DEV is a publicly archived, unmoderated list hosted by OASIS to support
XML implementation and development. To minimize spam in the archives, you
must subscribe before posting.
[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
subscribe: xml-dev-subscribe@lists.xml.org List archive:
http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
_______________________________________________________________________
XML-DEV is a publicly archived, unmoderated list hosted by OASIS to support
XML implementation and development. To minimize spam in the archives, you
must subscribe before posting.
[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
subscribe: xml-dev-subscribe@lists.xml.org List archive:
http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]