Jump to content
bca

Using xsd files

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.

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
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.

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

Edited by crelf

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

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