Ian Bamsey wrote:
> I am continuing to investigate using XXE as a tool for editing
> documentation within an UML model. The UML model is stored in an XML
> format compliant with the XMI standard.
> 
> The objective is to open the XMI document in XXE and use a style sheet
> to select out specific elements within the model and allow the user to
> edit the documentation associated with the element. For example, the UML
> model might include a UseCase element to which I would like to add/edit
> the associated documentation. The UML tool provides a user-interface for
> this but it is clumsy. A nicely formated document would be preferable.
> 
> I can already select out the name of the elements and generate content
> for these. So my document now has headings, one for each UML element I
> want to document. Now I'd like to have the documentation text beneath
> the headings where it can be edited as follows:
> 
> 1. Use Case : Scheme Management
> This is the scheme management use case.
> 
> The problem is that the documentation for the UML elements is stored as
> an attribute and not text within the element. e.g.

So what? You can embed attribute editors in the styled view.
See
http://www.xmlmind.com/xmleditor/_distrib/doc/csssupport/styling_attributes.html



> <UML:UseCase xmi.id = 'a218' name = 'Scheme Management'>
>    <UML:ModelElement.taggedValue>
>        <UML:TaggedValue xmi.id = 'a220' dataValue = 'This is the scheme
> management use case.'>
>            <UML:TaggedValue.type>
>                <UML:TagDefinition xmi.idref = 'documentation'/>
>            </UML:TaggedValue.type>
>        </UML:TaggedValue>
>    </UML:ModelElement.taggedValue>
> </UML:UseCase>
> 
> I can see that XXE is probably not well suited to the application as
> described, but can anyone suggest an approach to the problem as outlined.
> 

This is hard to believe having adapted XXE to a wide variety of
documents, XML data or a mix of both.

If you want to convince yourself, simply add this line at the top (i.e.
after <?xml version=...?>) of one  of your XMI files:

<?xml-stylesheet type="text/css" href="xxe-config:common/css/xmldata.css"?>

Just make sure that your XMI file is typed. That is, it has a <!DOCTYPE>
or much better (stronger typing) an xsi:schemaLocation="namespace1
schema1 ... namespace2 schema2" attribute.



---
PS: Even quicker to get an idea of the power of XXE, simply open in XXE,
<XXE_install_dir>/demo/form-sampler.xml,
<XXE_install_dir>/demo/bugreport.xml and also
<XXE_install_dir>/demo/bugreport/bugreport.xsd (the documented W3C XML
schema used by bugreport.xml).

Note that bugreport.xsd will not look good unless you install the add-on
called "W3C XML Schema configuration". To do so, simply use
"Options|Install Add-ons" and select the above configuration in the list.


Reply via email to