Reading and writing XML files from gadgets

This section is for general discussion about Gadgets
Post Reply
zoner
Posts: 18
Joined: Wed Sep 11, 2013 6:41 pm
Model of CNC Machine: Self design - 5' x 10' x 1'

Reading and writing XML files from gadgets

Post by zoner »

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

User avatar
jimandi5000
Vectric Wizard
Posts: 440
Joined: Wed Mar 11, 2015 6:50 pm
Model of CNC Machine: Home Made 60 x 120
Location: North Houston Tx.

Re: Reading and writing XML files from gadgets

Post by jimandi5000 »

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

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

Post by zoner »

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 !

User avatar
jimandi5000
Vectric Wizard
Posts: 440
Joined: Wed Mar 11, 2015 6:50 pm
Model of CNC Machine: Home Made 60 x 120
Location: North Houston Tx.

Re: Reading and writing XML files from gadgets

Post by jimandi5000 »

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

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

Post by zoner »

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 !

User avatar
Adrian
Vectric Archimage
Posts: 10468
Joined: Thu Nov 23, 2006 2:19 pm
Model of CNC Machine: ShopBot PRS Alpha 96x48
Location: Surrey, UK

Re: Reading and writing XML files from gadgets

Post by Adrian »

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.

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

Post by zoner »

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

User avatar
jimandi5000
Vectric Wizard
Posts: 440
Joined: Wed Mar 11, 2015 6:50 pm
Model of CNC Machine: Home Made 60 x 120
Location: North Houston Tx.

Re: Reading and writing XML files from gadgets

Post by jimandi5000 »

I feel the need for a XML reader / writer function. Would anyone like a copy?
Thanks,
Jim

User avatar
jimandi5000
Vectric Wizard
Posts: 440
Joined: Wed Mar 11, 2015 6:50 pm
Model of CNC Machine: Home Made 60 x 120
Location: North Houston Tx.

Re: Reading and writing XML files from gadgets

Post by jimandi5000 »

jimandi5000 wrote:I feel the need for a XML reader / writer function. Would anyone like a copy?
I will add Json. :)
Thanks,
Jim

Post Reply