Author Topic: Any XML parser reachable from Javascript?  (Read 5232 times)

Offline bitli

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 513
Any XML parser reachable from Javascript?
« on: 2010 April 11 03:41:31 »
Hi,
In 1.6 the process information is saved in a XML format, which is quite convenient to read.  I assume that there is a C++ XML parser in the PI code.  Would it be possible to call it from the Javascript to parse a file/string to DOM and make XPATH selections?
-- bitli

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Re: Any XML parser reachable from Javascript?
« Reply #1 on: 2010 April 11 12:48:33 »
Hi Bitli,

The next version of PixInsight will include two new core JavaScript objects, namely XMLStreamReader and XMLStreamWriter. These objects will implement sequential reading and generation of XML code through an easy-to-use high-level interface.

XMLStreamReader and XMLStreamWriter, however, don't load or represent an XML document as a tree of nodes, in the fashion of the XPath specification. They will provide, however, the necessary functionality to decode common data types as numbers (both floating point and integer), dates and Booleans from XML attributes.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline bitli

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 513
Re: Any XML parser reachable from Javascript?
« Reply #2 on: 2010 April 11 13:38:37 »
Thanks, should be good enough.
-- bitli