LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Migrating LabXML tool to 64bits

Solved!
Go to solution

Just a guess, but I noticed coercion dots on your CreateNewNode and AddChild VIs doc and parent node inputs. Have you made sure that the data-types for those VIs terminals and CLFN parameters have been updated to 64bit? If they are still 32 bit then the references will be invalid.

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
0 Kudos
Message 21 of 25
(2,216 Views)

Hi TroyK,

many thanks for your tip. I fixed all the datatypes and now it´s working properly in LV x64!

0 Kudos
Message 22 of 25
(2,205 Views)

Hi all,

I'm trying to select the "log" node inside an XML file.
Any idea why it doesn't work?
Below there's an extract of the file.

I've already validated the XML and there's no error in it.

<?xml version="1.0" encoding="utf-8"?>
<logs xmlns="http://www.witsml.org/schemas/1series" version="1.4.1.1" xsi:schemaLocation="http://www.witsml.org/schemas/1series ../xsd_schemas/obj_log.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<log uid="measurement">

<data>
1999.509,-0.438772,-0.92,513.655
</data>

</log>
</logs>

Thanks in advance for any help.

0 Kudos
Message 23 of 25
(1,466 Views)

I believe this has to do with the root element default namespace declaration in your XML: xmlns="http://www.witsml.org/schemas/1series"
See here: https://stackoverflow.com/questions/3135175/libxml2-error-with-namespaces-and-xpath


Child elements aren't required to be qualified (with a namespace prefix) in the XML doc, but technically they are required to be qualified with a namespace in XPATH queries.

 

libxml2 does have the function xmlXPathRegisterNs to register a namespace so it can be used in XPATH quesries but that function doesn't seem to be implemented in the IXMLwrap.dll for us to use in this LabVIEW wrapper version of libxml2.

 

So I think you have 3 options.

  1. Remove (or add a namespace prefix to) the xmlns declaration in the XML doc root node (quick way to test if this is the problem)
        Then this XPATH will work: /logs/log/data
  2. Use XPATH queries that include a function that searches the default namespace:
        /*[local-name()='logs']/*[local-name()='log']/*[local-name()='data']
  3. Find, modify and recompile the source code for the IXMLwrap.dll to include the xmlXPathRegisterNs function, then register the namespace to use in your XPATH queries.

xpathnamespace.png

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
Message 24 of 25
(1,449 Views)

Thanks TroyK, that's exactly what I need. Unfortunately, I don't have control over the XML format but using the second option does the trick.

0 Kudos
Message 25 of 25
(1,428 Views)