[great-users] Reading XML file using Code Generator

Partridge, Brian R Brian.R.Partridge at boeing.com
Fri Apr 18 12:36:07 CDT 2008


Does anyone have any idea how to get the GReAT Code Generator to read
the tags of a XML file? The GR engine works just fine, but when using
the Code Generator I get the following error: 

Error during parsing: 'myXMLFile.xml'. Exception message is: 
Error at file 'C:\myXMLFile.xml', 
line 2, column 126. Message: Unknown element 'interfaceList'

I am working on adding data from an XML file to GME model using GReAT.
The XML file was exported from a Excel spreadsheet so it is of the form:

<interfaceList> 
        <interface> 
                <name> 
                        A model name 
                </name> 
                <attribute> 
                          A model attribute 
                </attribute> 
        </interface> 
<interfaceList> 

Of course I made this XML file ready for GReAT-use by translating it
into this form: 
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> 
<interfaceList xmlns:xsi=" <http://www.w3.org/2001/XMLSchema-instance>
http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="MyXMLSchema.xsd"> 
        <interface name="A model  name" attribute="A model attribute" />

</interfaceList> 

Where "MyXMLSchema.xsd" is the name of the package that models the XML
data in my UMLModelTransformer. 
I have my transform working pretty well, and am able to run it without
error using the GR engine. However, I would like to run this transform
using the Code Generator because it is "10 to 100X faster" than the GR
engine. When I do this, my XML file cannot be read. Again, the GR engine
reads the file just fine, but running it using Code Generator results in
the Unkown element 'interafaceList' error.

I was getting this very same error when I was using the GRE engine, but
changing the opening tag from:

<interfaceList>

to 

<interfaceList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="MyXMLSchema.xsd"> 

solved this problem.  The error I get when using the Code Generator
seems to indicate that I should modify this opening tag so that the file
can be read. Any ideas would be appreciated.

Thanks,

Brian Partridge 
Intern 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.isis.vanderbilt.edu/pipermail/great-users/attachments/20080418/99780593/attachment.html 


More information about the great-users mailing list