bca Posted March 18, 2011 Report Share Posted March 18, 2011 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. Link to comment Share on other sites More sharing options...
Jim Kring Posted March 21, 2011 Report Share Posted March 21, 2011 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 Link to comment Share on other sites More sharing options...
bca Posted March 29, 2011 Author Report Share Posted March 29, 2011 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. Link to comment Share on other sites More sharing options...
Jim Kring Posted March 29, 2011 Report Share Posted March 29, 2011 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 Link to comment Share on other sites More sharing options...
crelf Posted April 14, 2012 Report Share Posted April 14, 2012 EasyXML will output an error if the incoming XML file can't be parsed. 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. Link to comment Share on other sites More sharing options...
crelf Posted April 14, 2012 Report Share Posted April 14, 2012 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/t5/LabVIEW/Validate-XML-to-xsd-schema/m-p/1952127#M648928 Link to comment Share on other sites More sharing options...
Jim Kring Posted April 16, 2012 Report Share Posted April 16, 2012 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.