Author Topic: Tagged value note  (Read 3715 times)

ruderik

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Tagged value note
« on: August 06, 2004, 02:22:06 am »
Hi,

Just wanted to ask how to access a tagged value note inside a code template ? The value is well documented, but i can't find any information about the belonging note-text.

The reason is: we are using nDoc for help-doc generation, and this tool uses an xml tag for exceptions, like this: <exception cref="member">description</exception>
So i wanted to use the tag 'throws' having the exception name as its value, but then i still need a description. Would be nice if this could be contained in the note.

I'm a newbie, so sorry if this is a stupid question, but couldn't find an answer anywhere  :(.
Still using the evaluation version btw, so hope for an answer within 30 days  ;)

greets,

Ruud

Tadd Stuart

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Tagged value note
« Reply #1 on: August 06, 2004, 11:06:57 am »
This may help. I needed to extract the TaggedValues out of a Data Model and the associated Notes so I created an XSLT stylesheet to go against the Exported XML from EA.
---- Start ---

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:UML="omg.org/UML1.3" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     <xsl:template match="/">
           <HTML>
           <HEAD>
           <link href="style.css" rel="stylesheet" type="text/css">
           </HEAD><BODY>
           <H1>Data Model</H1>
     
<TABLE border="1" width="100%">
     <xsl:for-each select="XMI/XMI.content/UML:Model/UML:Namespace.ownedElement/UML:Package/UML:Namespace.ownedElement">
    <TR>
           <TD valign="top"><xsl:value-of select="@name"/></TD>
           <TD valign="top"><xsl:value-of select="@description"/>
                 <TABLE border="1" width="100%">
                 <xsl:for-each select="UML:Class">
                       <TR name="Table" valign="top">
                             <TD><xsl:value-of select="@name"/></TD>
                             <TD>
                            <TABLE border="1" width="100%">
                                   <xsl:for-each select="UML:Classifier.feature/UML:Attribute">
                                <TR name="Element">
                                    <TD valign="top"><xsl:value-of select="@name"/></TD>
                                    <TD>
                                              <TABLE border="1" width="100%">
                                                     <xsl:for-each select="UML:ModelElement.taggedValue/UML:TaggedValue">
                                                      <xsl:choose>
                                                            <xsl:when test="@tag = 'Datafield'">
                                                  <TR name="Element">
                                                      <TD><xsl:value-of select="@value"/></TD>
                                                      <TD><xsl:value-of select="XMI.extension/UML:Comment/@name"/></TD>
                                                  </TR>
                                                      </xsl:when>
                                                    </xsl:choose>
                                                     </xsl:for-each>
                                              </TABLE>
                                    </TD>
                                </TR>
                                   </xsl:for-each>
                            </TABLE>
                             </TD>
                       </TR>      
                   </xsl:for-each>
                   </TABLE>
       </TD>
    </TR>
      </xsl:for-each>
</TABLE>
      
           </BODY>       
           </HTML>            
     </xsl:template>
</xsl:stylesheet>

---- End ----
Tadd Stuart
Portland Maine