Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: bennido on October 03, 2006, 07:09:59 pm
-
Hi all,
I've been trying out UML modelling for XML schema and hitting a basic (?) problem.
I've created a simple class diagram and included (by drag drop as a Simple link) an XSD element from another package onto the class diagram.
According to EA help file, this should cause code generation to automatically produce an "xsd:include" statement for the linked package in the schema.
But it doesn't and as a result the XML schema is not valid the XSD element being referenced is not defined.
Is there a setting in EA that I missed or am I missing the point completely ?
Can someone please help ? Thanks !
-
When you drag and drop an element from the Project Browser onto the current diagram using the option "as Simple Link", the element will appear in the current diagram as a simple reference back to the original source element. Changes to this element in the diagram will affect all other links to this element (refer to the EA Help file under the topic : Modeling with UML -> Common Diagram Tasks -> Pasting from the Project Browser).
For XSD Generation, just pasting an element as a Simple Link does not guarantee its inclusion in the generated schema. Consider the following diagram with a sample package structure and the package tagged-values.
(http://www.sparxsystems.com/forumImages/Sample.PNG)
Generate the Schema from the package "PA" and you will see that the generated XSD will have an "include" element.
-
Ah ok, I see where I went wrong now.
I had the targetNamespace defined correctly but I was missing the extra tagged value for "schemaLocation" for the package to be included.
Thanks for the help !