LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Proper XML Header to link to LV Schema

Hello,
 
I have tried in vain to find the proper header text to add to a file created with the "Flatten to XML" function, in order to link the file to the LV Schema ("LVXMLSchema.xsd").  I understand it needs to be something like:
 
<?xml version="1.0" encoding="iso-8859-1"?>
<LVData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation='LVXMLSchema.xsd'>
....
Flattened text here
....
</LVData>
 
But this doesn't work.  My goal is to be able to edit LV-generated XML files in an XML-enabled text editor such as jEdit (ie. have the editor show what elements are allowed, and automatically parse and list errors).  I have tried following the example files in C:\Program Files\National Instruments\LabVIEW 7.1\examples\internet ("TestConfiguration.xml" is properly linked to "TestConfiguration.xsd"), but this doesn't work.
 
The real issue behind this question is this:  We have switched from using .ini files to XML files for storing configuration data for our application.  XML is much easier to read, write, and maintain, however, if the type def used to unflatten the XML is modified, then old files become useless, and need to be recreated from scratch.  Has anyone found an elegant solution to this? (other than manually editing the files)  I would still like to know how to link to the schema, but a more automated solution would be great.
 
Thanks in advance,
 
Jaegen
0 Kudos
Message 1 of 3
(3,380 Views)

Well, it's good to see Murphy's Law still exists ...

No sooner had I posted this question then I found (by trial and error) the answer myself:

<?xml version="1.0"?>
<LVData xmlns="http://www.ni.com/labview"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.ni.com/labview LVXMLSchema.xsd">
....

Flattened text here

....

</LVData>

 
This seems to work - does anyone know if this is actually completely correct?  I did have to copy "LVXMLSchema.xsd" into the same folder as the .xml file - is there a way around this?  I suppose I could point to the normal "home" of this file on the C: drive, but I'd like to be able to use this on computers without LabVIEW installed, so is there any way to point to a location on the web? (xsi:schemaLocation="http://www.ni.com/labview http://www.ni.com/labview/LVXMLSchema.xsd" doesn't seem to work)
 
I am still interested in a better solution to my root problem though ...
 
Cheers,
 
Jaegen
0 Kudos
Message 2 of 3
(3,376 Views)
Hello,
 
I think you're looking for xml syntax, of which I am not an expert, however, I googled "xsi:schemaLocation" and you may want to check the following documentation and example:
 
Schema Documentation:
 
Example:
 
I hope this helps!
 
Best Regards,
 
JLS
Best,
JLS
Sixclear
0 Kudos
Message 3 of 3
(3,362 Views)