Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DSDP - Real-Time Software Components (RTSC) » new XML(...) error
new XML(...) error [message #754458] Wed, 02 November 2011 15:20 Go to next message
Patrick Geremia is currently offline Patrick Geremia
Messages: 79
Registered: July 2009
Member
The following xs script has stopped was working with release 3_20_08_88
but does not work with release 3_22_01_21. I get the following error :

line 6: TypeError: The processing instruction target matching
"[xX][mM][lL]" is not allowed.

Line 6 is the one with new XML ...

Here is the script:
======================================================================
/*
* ======== main ========
*/
function main(args)
{
var build = new XML(readFile("package/package.bld.xml"));

var pkg = build.@name;
print("packageName=" + pkg);
var makefiles = build.makefiles.srcFile;
for (var i in makefiles)
{
var tmp = makefiles[i].@name;
var pos = tmp.lastIndexOf(".mak");
if (pos!=-1 && (tmp!="package.mak"))
{
goal = tmp.substring(0,pos);
print("buildGoal=" + goal);
}
}

var releases = build.releases.release;
for (var i in releases) {
print("releaseGoal=" + releases[i].@pname);
}
}

/*
* ======== readFile ========
*/
function readFile(fileName)
{
var ins = new java.io.BufferedReader(new java.io.FileReader(fileName));
var outs = new java.io.StringWriter();
var nextLine;
while ((nextLine = ins.readLine()) != null)
{
outs.write(nextLine);
outs.write("\n");
}
outs.flush();
return (outs.toString());
}

main(arguments);
======================================================================
Re: new XML(...) error [message #754479 is a reply to message #754458] Wed, 02 November 2011 17:07 Go to previous messageGo to next message
Sasha Slijepcevic is currently offline Sasha Slijepcevic
Messages: 89
Registered: July 2009
Member
The cause is a bug in Rhino support for E4X:
https://bugzilla.mozilla.org/show_bug.cgi?id=336551

We have a workaround in xdc.loadXML(), so you should try:
var build = xdc.loadXML("package/package.bld.xml");


When you use new XML(), you are using the E4X support directly.
Re: new XML(...) error [message #762060 is a reply to message #754479] Wed, 07 December 2011 13:50 Go to previous message
Patrick Geremia is currently offline Patrick Geremia
Messages: 79
Registered: July 2009
Member
it works. Thanks.

----------------------------------------------------------------------
From : Sasha Slijepcevic <forums-noreply@eclipse.org>
Date : Wed Nov 02 2011 18:07:25 GMT+0100 (CET)

> The cause is a bug in Rhino support for E4X:
> https://bugzilla.mozilla.org/show_bug.cgi?id=336551
>
> We have a workaround in xdc.loadXML(), so you should try:
>
> var build = xdc.loadXML("package/package.bld.xml");
>
>
> When you use new XML(), you are using the E4X support directly.
Previous Topic:excludeDirs not working when creating a release
Next Topic:How to add pre-built library to RTSC-ed one ?
Goto Forum:
  


Current Time: Tue Sep 23 18:32:42 GMT 2014

Powered by FUDForum. Page generated in 0.01707 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software