LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Validate xml via xml schema

hi,

I have a LabVIEW VI where i read some elements from a .xml file. First i use the function Read_Characters_From_File and the output string is wired on property/method nodes of a MSXML Refnum. But on the point where i read from xml, the VI should check the associated xml schema (.xsd/.dtd). Is there any possibilty to get a pass oder fail if the xml document do/do not correspond to the DTD schema which belong to the xml file?

LabVIEW version is 7.1

Thanks for answer,
shavo
0 Kudos
Message 1 of 10
(4,144 Views)

Hi shavo,

i think you can use the activex webbrowser component to check the xml file.

Hope it helps.
Mike

0 Kudos
Message 2 of 10
(4,130 Views)
thanks for reply, but i have no ideas how to use the activex webbrowser to check the validation of the xml file.
can you give me some more details or an example?

shavo
0 Kudos
Message 3 of 10
(4,114 Views)
Hi shavo,
you can use the code from the attached picture. If an error occured the webbrowser shows an error message.
Mike
0 Kudos
Message 4 of 10
(4,105 Views)
Hi shavo,
you can also use this code. If you can load the xml file (the output is true), then the file is ok, else not.
Mike
0 Kudos
Message 5 of 10
(4,089 Views)
hi mike,

the VI on the picture works, but the webbrowser shows alle xml documents, independently from validation.
if i open a xml file in a xml editor/parser and the check is fail, the webbrowser of the given VI shows me the HTML code without any error message.
if i wire an error box on the last Close_Reference Element, its PASS too.

you know what´s responsible that....?

shavo


Message Edited by shavo on 07-21-2008 10:28 AM
0 Kudos
Message 6 of 10
(4,085 Views)
A search would have yielded the result that this question has been asked before.

If you're using the MSXML parser it is pointless to try to use the web browser component to validate the XML. That's just redundant. The MSXML parser has a validateOnParse property that you must set before you load the document. See the MSDN link.
Message 7 of 10
(4,083 Views)

Hi,

 

I'm just piggy backing on this thread.

I'm using LV 2011 and I've looked at the XML API added here that allows to use Xerces parser to go though the files.

 

I'm talking about the VI's that are availible in the Programming->File I/O->XML-> XML Parser palette.


I do not see any features that would allow me to validate a schema?

 

Is there anything in LV 2012 that would enable me to validate an XML vs a schema in LV 2012?

The idea I had is to use some .NET code to do that for me ... but I have a bad feeling about mixing LV code with other stuff unless I really need to.


Thanks,

Maciej


0 Kudos
Message 8 of 10
(3,427 Views)

Sorry bout posting I should have read the help file for XML load function before posting.

There is a capablity to add te schema validation. 😉

 

 


0 Kudos
Message 9 of 10
(3,422 Views)

Sorry bout posting I should have read the help file for XML load function before posting.

There is a capablity to add te schema validation. 😉

 

 


0 Kudos
Message 10 of 10
(3,422 Views)