tillong Posted November 8, 2007 Report Share Posted November 8, 2007 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 Quote Link to comment
tillong Posted November 9, 2007 Author Report Share Posted November 9, 2007 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 Quote Link to comment
Dirk J. Posted November 10, 2007 Report Share Posted November 10, 2007 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. Quote Link to comment
tillong Posted November 10, 2007 Author Report Share Posted November 10, 2007 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. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.