Jump to content

Using xsd files


bca

Recommended Posts

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

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.

 

3-21-2011 9-06-01 AM.png

 

 

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

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

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

  • 1 year later...
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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.