[great-users] Reading XML file using Code Generator

Partridge, Brian R Brian.R.Partridge at boeing.com
Tue Apr 22 08:53:44 CDT 2008


Message: 3
Thanks Daniel. I moved my schema file to the appropriate path and it
worked like a charm. 
Thanks,
Brian 

------------------------------------------------------------------------
-
Message: 1
Date: Fri, 18 Apr 2008 10:36:07 -0700
From: "Partridge, Brian R" <Brian.R.Partridge at boeing.com>
Subject: [great-users] Reading XML file using Code Generator
To: <great-users at list.isis.vanderbilt.edu>
Message-ID:
	
<FECBE2B1F82EBA4AADDCB5E432DFAF89061ADA03 at XCH-SW-3V2.sw.nos.boeing.com>
	
Content-Type: text/plain; charset="us-ascii"

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/200804
18/99780593/attachment-0001.html 

------------------------------

Message: 2
Date: Sat, 19 Apr 2008 00:55:02 -0500
From: "Daniel Balasubramanian" <daniel at isis.vanderbilt.edu>
Subject: Re: [great-users] Reading XML file using Code Generator
To: "great-users" <great-users at list.isis.vanderbilt.edu>
Message-ID:
	
<7AB1C26C64423249964AB392C6EBF0E001117444 at discovery.isis.vanderbilt.edu>
	
Content-Type: text/plain;	charset="iso-8859-1"

Hi Brian,

How are you reading in the XML file?  Are you using some 3rd party
library like xerces?  The error message that you said you are getting
makes it sound like the code generator can't find the schema, or that
it's using the wrong version of the schema.  Verify that the schema is
in the path or correct directory so that the executable you got from the
code generator can find it.  If you can't get it working, I'll be in
ISIS on Monday and we can take a look at it together.

Hope this helps,
Daniel


-----Original Message-----
From: great-users-bounces at list.isis.vanderbilt.edu on behalf of
Partridge, Brian R
Sent: Fri 4/18/2008 12:36 PM
To: great-users
Subject: [great-users] Reading XML file using Code Generator
 
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 




------------------------------

_______________________________________________
great-users mailing list
great-users at list.isis.vanderbilt.edu
http://list.isis.vanderbilt.edu/mailman/listinfo/great-users


End of great-users Digest, Vol 44, Issue 3
******************************************


More information about the great-users mailing list