I saw it mentioned that it is possible to use other than the labview LVXMLSchema.xsd to verify xml file conformity to a required template. Are there any examples of how to do this? I'm new to xml and am still figuring out how to use it, but I know we will want to verify all xml file input data to a vi before allowing the vi to run. Thanks.
JKI Discussion Forums
Page 1 of 1
Using xsd files
#2
Posted 21 March 2011 - 04:08 PM
bca, on 18 March 2011 - 04:23 PM, said:
I saw it mentioned that it is possible to use other than the labview LVXMLSchema.xsd to verify xml file conformity to a required template. Are there any examples of how to do this? I'm new to xml and am still figuring out how to use it, but I know we will want to verify all xml file input data to a vi before allowing the vi to run. Thanks.
Hi,
You can use the XML Load Document function to validate the XML against a DTD (document type definition) file. I think that you need to put the reference to this DTD in the XML file.
Also, EasyXML will output an error if the incoming XML file can't be parsed. So, maybe you just need to use EasyXML. Have you tried this yet?
Thanks,
-Jim
#3
Posted 29 March 2011 - 11:55 AM
I found that I can use a schema to validate using the labview Load XML File.vi if I put the schema-instance and schema location strings into the root element using #attributes. That is what I needed, thanks.
#4
Posted 29 March 2011 - 02:44 PM
bca, on 29 March 2011 - 11:55 AM, said:
I found that I can use a schema to validate using the labview Load XML File.vi if I put the schema-instance and schema location strings into the root element using #attributes. That is what I needed, thanks.
Great! I'm glad that worked for you. Thanks for letting us know.
-Jim
#5
Posted 14 April 2012 - 05:06 PM
#6
Posted 14 April 2012 - 05:08 PM
bca, on 29 March 2011 - 11:55 AM, said:
I found that I can use a schema to validate using the labview Load XML File.vi if I put the schema-instance and schema location strings into the root element using #attributes. That is what I needed, thanks.
Right, but have you found a way to apply an XML Schema check? ie: I'm using xsd schemas, not dtd.
Cross posted to http://forums.ni.com...1952127#M648928
This post has been edited by crelf: 14 April 2012 - 06:36 PM
#7
Posted 16 April 2012 - 08:31 PM
crelf, on 14 April 2012 - 05:06 PM, said:
Hi Jim - can you elaborate on this? My experience is that EasyXML skips over items that aren't in the control definition and continues without error.
Hi crelf,
What I meant is that if the XML isn't well-formed, then EasyXML will output an error.
You're right that if the XML contains extra data that's not in the LabVIEW data, when it will continue without error.
-Jim
Share this topic:
Page 1 of 1



Back to top









