Sg2.9
loading xml?
Recent RSS
loading xml?
Date:  30. November 2009, 19:53

i can't seem to find a solution to do it.
is it possible?

thanks,

k

Re: loading xml?
Date:  1. December 2009, 18:43

I've attached a script to this comment that should lead you in the right direction.

It uses E4X for the xml: https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Processing_XML_with_E4X

Let me know if you need more help!

Re: loading xml?
Date:  2. December 2009, 12:00

Thanks.

Ive written a rhonda sketch to SVG converter in actionscript, i want to make a rhonda illustrator plugin based on that.

by the way, im planning to organize some conditional design workshops with friends here in hungary,if its ok with you. the idea is great!

krisztian

Re: loading xml?
Date:  2. December 2009, 12:55

Jonathan, the offline xml parser would be based on XMLDOM?

Re: loading xml?
Date:  3. December 2009, 12:35

Not sure that I understand what you mean.. What offline xml parser? XMLDOM?
You want to parse files on your hard drive?

Re: loading xml?
Date:  3. December 2009, 15:11

o..sorry

rhonda (see link upper) files are xml.
theres more than one root node, depending on the lines you draw.
like this:

(line)
(pt)
(x)
(y)
(z)
(/pt)
(pt)
(x)
(y)
(z)
(/pt)
(/line)
line)
(pt)
(x)
(y)
(z)
(/pt)
(pt)
(x)
(y)
(z)
(/pt)
(/line)

i want to access them from the harddrive. :)

Re: loading xml?
Date:  3. December 2009, 18:18

Okay thats easy enough:

var file = new File('path/to/the/file.xml');
var string = file.readAll();
var xml = new XML(string);
Re: loading xml?
Date:  7. December 2009, 10:47

sorry for so much work with this simple thing, but
any path i give puts "file not found" on the console window
any ideas?

Re: loading xml?
Date:  7. December 2009, 11:54

it was just a slash / backwards slash \ problem
forget about it :)

Re: loading xml?
Date:  11. December 2009, 21:38

Hi,

now i have some time (plus flu) so i continue on this script.
i wander how opening a file dialog could work, to browse directories, then load an xml.

with this:
Dialog.fileOpen([message[, filters[, selectedFile]]])
?

probably i use it wrong somewhere...

thanks,

k

Scripts
08.08.14, 15:24
15.05.14, 14:23
02.03.14, 19:16
18.11.13, 14:48
22.03.13, 03:05
22.02.13, 15:45
Posts
10.01.17, 16:37
19.02.16, 06:03
19.02.16, 06:00
17.01.16, 11:00
12.01.16, 13:10
25.11.15, 08:19
Script of the Moment
Sketchy Structures 04.11.10