Reading and writing XML files from gadgets

This section is for general discussion about Gadgets

Reading and writing XML files from gadgets

Postby zoner » Thu Jan 09, 2020 4:38 am

Is there a way from the gadgets to read or write xml files ?
zoner
 
Posts: 18
Joined: Wed Sep 11, 2013 6:41 pm
Model of CNC Machine: Self design - 5' x 10' x 1'

Re: Reading and writing XML files from gadgets

Postby jimandi5000 » Thu Jan 09, 2020 5:21 am

zoner wrote:Is there a way from the gadgets to read or write xml files ?



YES! It is "Easy as Pie"

What do you need?
Thanks,
Jim
User avatar
jimandi5000
Vectric Craftsman
 
Posts: 271
Joined: Wed Mar 11, 2015 6:50 pm
Location: North Houston Tx.
Model of CNC Machine: Home Made 60 x 120

Re: Reading and writing XML files from gadgets

Postby zoner » Thu Jan 09, 2020 3:15 pm

I am looking tor a library to write data as xml tree ... to output some calculations to an xml file that will be read with Alibre Design Expert 2019. I'm building things to cut in Aspire but want to see the 3D effect of the many pieces that will be cut ... so ... viewing them assembled in Alibre :)

I can easily write with io.write ... and build the XML tags manually ... but if there was an existing library ... I would prefer that !
zoner
 
Posts: 18
Joined: Wed Sep 11, 2013 6:41 pm
Model of CNC Machine: Self design - 5' x 10' x 1'

Re: Reading and writing XML files from gadgets

Postby jimandi5000 » Thu Jan 09, 2020 3:32 pm

zoner wrote:I am looking tor a library to write data as xml tree ... to output some calculations to an xml file that will be read with Alibre Design Expert 2019. I'm building things to cut in Aspire but want to see the 3D effect of the many pieces that will be cut ... so ... viewing them assembled in Alibre :)

I can easily write with io.write ... and build the XML tags manually ... but if there was an existing library ... I would prefer that !


I have built a set of functions to read, write, and update ini files that could be easily updated to handle the xml tree structure. Let me know. Do you have a sample file? I would like to have a stab at it.
Thanks,
Jim
User avatar
jimandi5000
Vectric Craftsman
 
Posts: 271
Joined: Wed Mar 11, 2015 6:50 pm
Location: North Houston Tx.
Model of CNC Machine: Home Made 60 x 120

Re: Reading and writing XML files from gadgets

Postby zoner » Thu Jan 09, 2020 3:54 pm

I don't have the structure yet ... I was looking for a path from Aspire to Alibre ...

I will work on my need now (building the layers that will have what will be saved to disk) and will have something next week (for the xml structure)

I did find this : https://github.com/manoelcampos/xml2lua which is suppose to work for lua 5.1 to 5.3 ... will have to test next week I guess !
zoner
 
Posts: 18
Joined: Wed Sep 11, 2013 6:41 pm
Model of CNC Machine: Self design - 5' x 10' x 1'

Re: Reading and writing XML files from gadgets

Postby Adrian » Thu Jan 09, 2020 4:57 pm

There are lots of XML libraries for LUA. I prefer to work in JSON myself when programming but that's not an option for Alibre.
User avatar
Adrian
Vectric Archimage
 
Posts: 9965
Joined: Thu Nov 23, 2006 2:19 pm
Location: Surrey, UK
Model of CNC Machine: ShopBot PRS Alpha 96x48

Re: Reading and writing XML files from gadgets

Postby zoner » Thu Jan 09, 2020 6:45 pm

Aspire is lua 5.2 embedded but we still have access to loading libraries from disk thus xml2lua
Alibre is python 2.7 embedded parts of the full library is available only ... but there is an xml parser so ... but no JSON ... which was my first reflex for python ...

20 years ago I did a lot of xml-xsl-xsd so quite at ease with xml
zoner
 
Posts: 18
Joined: Wed Sep 11, 2013 6:41 pm
Model of CNC Machine: Self design - 5' x 10' x 1'

Re: Reading and writing XML files from gadgets

Postby jimandi5000 » Tue Jan 14, 2020 7:18 pm

I feel the need for a XML reader / writer function. Would anyone like a copy?
Thanks,
Jim
User avatar
jimandi5000
Vectric Craftsman
 
Posts: 271
Joined: Wed Mar 11, 2015 6:50 pm
Location: North Houston Tx.
Model of CNC Machine: Home Made 60 x 120

Re: Reading and writing XML files from gadgets

Postby jimandi5000 » Tue Jan 14, 2020 11:28 pm

jimandi5000 wrote:I feel the need for a XML reader / writer function. Would anyone like a copy?


I will add Json. :)
Thanks,
Jim
User avatar
jimandi5000
Vectric Craftsman
 
Posts: 271
Joined: Wed Mar 11, 2015 6:50 pm
Location: North Houston Tx.
Model of CNC Machine: Home Made 60 x 120


Return to Gadgets - General

Who is online

Users browsing this forum: No registered users and 9 guests