Hi,

I'm currently developping a model documentation using xpt files.
I've got an UML model in topcased and I want to use xpand files to 
generate my docbook files.
My xpt file looks like:
«IMPORT uml»

«DEFINE Root(String fileName) FOR Package»
        «FILE fileName+".docbook"       -»
<?xml version='1.0' encoding="ISO-8859-15" ?>
<book lang="en">
                «EXPAND PackageRoot FOREACH ownedElement-»
</book>
        «ENDFILE»
«ENDDEFINE»

«DEFINE PackageRoot FOR Package-»
        <chapter id="id«name»">
                <title>Content of the Package «name»</title>
                <para>Here is the first paragraph of the Root 
element.</para>
                «EXPAND ClassesContentsInTableTemplate-»
                «EXPAND PackageLevel(1) FOREACH ownedElement-»
        </chapter>
«ENDDEFINE»

«DEFINE PackageRoot FOR Element»
«ENDDEFINE»

«DEFINE PackageLevel(int level) FOR Package-»
        «IF level<6-»
        <sect«level» id="«name»">
                <title>Content of the Package «name»</title>
                «EXPAND ClassesContentsInTableTemplate-»
                «EXPAND PackageLevel(level+1) FOREACH ownedElement-»
        </sect«level»>
        «ENDIF»
«ENDDEFINE»

«DEFINE PackageLevel(int level) FOR Element»
«ENDDEFINE»


«DEFINE ClassTemplate FOR Class-»
                                        <row>
                                                <entry>«name»</entry>
 <entry>«visibility.toString()»</entry>
 <entry>«isAbstract.toString()»</entry>
                                        </row>
«ENDDEFINE»

«DEFINE ClassTemplate FOR Type»
«ENDDEFINE»


«DEFINE ClassesContentsInTableTemplate FOR Package»
                <table>
                        <title>List of classes contained  in the Package 
«name»</title>
                        <tgroup cols="3">
                                <thead>
                                        <row>
                                                <entry>Class name</entry>
                                                <entry>Visibility</entry>
                                                <entry>IsAbstract</entry>
                                        </row>
                                </thead>
                                <tbody>
                                «EXPAND ClassTemplate FOREACH ownedType»
                                </tbody>
                        </tgroup>
                </table> 
«ENDDEFINE»

I can use code assist for the xpand language words (DEFINE, IF ...) but I 
also want to have it for the Package ... elements from the uml metamodel, 
is it possible ?
_______________________________________________
Topcased-users mailing list
[email protected]
http://lists.gforge.enseeiht.fr/mailman/listinfo/topcased-users

Reply via email to