LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem open xml file

Hi, i'm using labview as beginner in labview application. I started to load and interpreter a simple xml file with labview and classical VIs object for xml treatment. I realized my project, i found the nodes correctly, but i have a problem to extract the child and sibling elements of a node. Could anyone suggest me ho to extract a list(sibling) of childs from a node? 

So i have to search if exist a block to open a file with a scheme. In labview i think it doesn't exist, correctly?

Thanks Michele 

0 Kudos
Message 1 of 13
(3,071 Views)

Please try to share the XML File you use and the Code Snippet which you tried.
Use XML Grid and check whether your file has proper schema?

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 13
(3,036 Views)

Thanks for the answer, in the attach there is a simple project to load the file "tabellismo_simple". The problem is to find the instance array of "classe" nodes.  There is the file scheme, thank you Michele 

0 Kudos
Message 3 of 13
(3,031 Views)

Please share the Vi with LV2015 and the expected data from the shared file.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 4 of 13
(3,016 Views)

In the attach i post the project with labview 2015.

With NodeChildsArray, i'll expected (or i would) to find an array of instances from node rele 

<classe nome="RELE">
<istanza ist="0" nomeMnemonico="Caldaia 1apre">

<istanza ist="1" nomeMnemonico="Caldaia 1chiude">

...

instead it doesn't return the child array correctly

thanks Michele 

 

0 Kudos
Message 5 of 13
(3,011 Views)

Try like the same for ist and nomeMnemonico

 

XML.png

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 6 of 13
(2,997 Views)

Xpath For nomeMnemonico     "/impianto/classe/istanza/@nomeMnemonico"

 

Xpath For ist    "/impianto/classe/istanza/@ist"

 

which will give all Values irrespective of Classe Name so make Loops in such a way Classe values are extracted.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 7 of 13
(2,995 Views)

Thanks for the answer and i'm sorry about delay for my reply but i was to make core2 course, i had done this, but my problem is to search various children from single class. In your example i couldn't find the addiction of children instance from the parent node. In your example or in my i have to find a list of class children from various node, then i would extract the attributes from the various instance. Your sincerely Michele 

0 Kudos
Message 8 of 13
(2,954 Views)

Thanks for the answer and i'm sorry about delay for my reply but i was to make core2 course, i had done this, but my problem is to search various children from single class. In your example i couldn't find the addiction of children instance from the parent node. In your example or in my i have to find a list of class children from various node, then i would extract the attributes from the various instance. Your sincerely Michele 

0 Kudos
Message 9 of 13
(2,939 Views)

You need to use your xpath in such a way you expect the output.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 10 of 13
(2,928 Views)