Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Use XML with spidermonkey?

209 views
Skip to first unread message

Sebastien Gamel

unread,
Jan 24, 2008, 12:29:45 PM1/24/08
to dev-tech-...@lists.mozilla.org
Hi

I search on MDC but i don't find how to use XML in spidermonkey.

I explain, I search to parse an file xml

Example

<view width="200" height="200" onopen="view_onopen()">

<script language="jscript"><!--

function view_onopen()

{

foo( "bar()", 1000 );

}

function bar()

{

x = 2 + 2;

}

--></script>

<div background="#FFFFFF" width="200" height="200"/>

</view>

If you know the method please?

Regards

Seb

Al

unread,
Jan 26, 2008, 2:47:28 PM1/26/08
to

I don't believe spidermonkey has this capability. Again, most of the
XHTML-related functionality is implemented by the host browser.

What you may be looking for is E4X (ECMAScript for XML), which is about
embedding XML *within* JS, (but not the other way around).

See here: http://en.wikipedia.org/wiki/E4X

The relevant configuration option in spidermonkey is JS_HAS_XML_SUPPORT,
which should be set to 1 (see src/jsconfig.h).

Hope that helps.

Cheers,
-Al-

0 new messages