Jump to content

XML String Parsing


Recommended Posts

Currently I am investigating using XML within labview. I am interested in parsing information from xml documents but more specifically strings. I have investigated using the LabXML toolkit (the libxml one), however it only works with documents that are on disc. I am receiving XML documents over a TCP socket. It seems that if I use the labXML toolkit I have to write my XML string back to the disk, so that I can parse it, this will be too slow for my application. I looked at the libxml documentation, and the API provides for creating a xmldoc pointer using a string, but I do not see this exposed in labxml.

Is there an option to parse in-memory XML strings without writing to disk. What about the Internet Toolkit? I do not desire to write my own parser and would like the ability to use XQuery / XPath.

Thanks,

Paul

Link to comment

QUOTE(tillong @ Nov 7 2007, 01:45 PM)

Currently I am investigating using XML within labview. I am interested in parsing information from xml documents but more specifically strings. I have investigated using the LabXML toolkit (the libxml one), however it only works with documents that are on disc. I am receiving XML documents over a TCP socket. It seems that if I use the labXML toolkit I have to write my XML string back to the disk, so that I can parse it, this will be too slow for my application. I looked at the libxml documentation, and the API provides for creating a xmldoc pointer using a string, but I do not see this exposed in labxml.

Is there an option to parse in-memory XML strings without writing to disk. What about the Internet Toolkit? I do not desire to write my own parser and would like the ability to use XQuery / XPath.

Thanks,

Paul

Ill answer my own question here. The labXML implementation does not provide a wrapper for the libxml function xmlReadMemory, which also returns an xmldoc pointer. By creating a wrapper VI for that function the remaining wrapper vis for the labXML library can work on an in-memory string. If anybody here is responsible for labXML or has any part in its development, I would suggest providing a wrapped version of xmlReadMemory in future releases.

-Paul

Link to comment

QUOTE(Dirk J. @ Nov 9 2007, 11:33 AM)

Paul,

LabXML uses Microsofts XML ActiveX components you can use direclty (MSXML).

The MSXML2.IXMLDOMDocument3 class (what's in a name) has a method LoadXML(bstrXML) which loads directly from a string.

You can use XPath as a selection language.

, see picture.

Thank you for the input. I am using the LabXML release based on Gnome libxml library (which is cross platform). I might have to do some timing analysis of the two methods and see which ends up being faster.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.