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
(1,770 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?

Pazhanivel Thiruvenkadam,
CertifiedLabVIEWArchitect|| CertifiedTestStandDeveloper,
Currently able to Access LV2015&LV2017
0 Kudos
Message 2 of 13
(1,735 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
(1,730 Views)

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

Pazhanivel Thiruvenkadam,
CertifiedLabVIEWArchitect|| CertifiedTestStandDeveloper,
Currently able to Access LV2015&LV2017
0 Kudos
Message 4 of 13
(1,715 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
(1,710 Views)

Try like the same for ist and nomeMnemonico

 

XML.png

Pazhanivel Thiruvenkadam,
CertifiedLabVIEWArchitect|| CertifiedTestStandDeveloper,
Currently able to Access LV2015&LV2017
0 Kudos
Message 6 of 13
(1,696 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.

Pazhanivel Thiruvenkadam,
CertifiedLabVIEWArchitect|| CertifiedTestStandDeveloper,
Currently able to Access LV2015&LV2017
0 Kudos
Message 7 of 13
(1,694 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
(1,653 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
(1,638 Views)

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

Pazhanivel Thiruvenkadam,
CertifiedLabVIEWArchitect|| CertifiedTestStandDeveloper,
Currently able to Access LV2015&LV2017
0 Kudos
Message 10 of 13
(1,627 Views)