[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

XSL navigation in XML tree problem

Subject: XSL navigation in XML tree problem
From: Jean-Robert Wiame <Jean-Robert.Wiame@xxxxxxxxx>
Date: Thu, 28 Oct 1999 09:55:39 +0200
span class not

> Hello XSL gourous...
> 
> Hope you can help me with this one... I have a problem regarding some XSL
> features. I have xml documents in which there are java methods
> definitions. In those methods are descriptions typed by the user. Part of
> those descriptions are about the parameters of the methods. The user must
> define the number and the name of the parameter he wishes to document in
> an element using this format: <MPA number="..." name="...">Parameter
> description... blablabla... </MPA>. The name of the parameter is defined
> nowhere else... Of course, the user is not forced to define all parameters
> and there is no defined order for the user's descriptions. The XSL I am
> working on tries to create the signature of the method and needs the names
> of the parameters (if they are described...). These names are accessed in
> the processing of the parameters but are at a completely different level
> of the structure. The number of the parameter is not defined in the
> parameter but the parameters are in the right sequence (the first
> parameter is number 1, the second is number 2...). I am trying to find a
> way to have those available parameter names in the method signature. I
> provide here a sample of the XSL I am using and a sample of the XML I am
> using. In red, you will find the interesting parts... In the XSL, the part
> in red is where the parameter names should be discovered (that part
> doesn't work of course...). In the XML, the parts in red are the user's
> description of the parameters.
> 
> The solution must be found in XSL. A script may be useful but I would
> prefer not using one...
> 
> This is the XSL formatting procedure to get the method signature:
> 
>             <DIV class="SUB">
>               <xsl:for-each select="CAU/Modifier" order-by="Description">
>                 <xsl:value-of select="Name"/>
>               </xsl:for-each>
> 
>               <!-- Result -->
>               <xsl:if test="CAU/Result/Class">
> 
>                 <xsl:if test="CAU/Result/Class/Link">
>                   <xsl:element name="a"><xsl:attribute
> name="href"><xsl:value-of
> select="CAU/Result/Class/Link"/></xsl:attribute><xsl:value-of
> select="CAU/Result/Class/Name"/></xsl:element>
>                 </xsl:if>
> 
>                 <xsl:if test="CAU/Result/Class[not(Link)]">
>                   <SPAN class="RT">
>                     <xsl:value-of select="Result/CAU/Class/Name"/>
>                   </SPAN>
>                 </xsl:if>
> 
>                 <xsl:if
> test="CAU/Result/is_Method_of_Result_Class[Description]">
>                   <SPAN class="RT">
>                     <xsl:value-of
> select="CAU/Result/is_Method_of_Result_Class/Description"/>
>                   </SPAN>
>                 </xsl:if>
> 
>               </xsl:if>
> 
>               <xsl:if test="CAU/Result/Interface">
> 
>                 <xsl:if test="CAU/Result/Interface/Link">
>                   <xsl:element name="a"><xsl:attribute
> name="href"><xsl:value-of
> select="CAU/Result/Interface/Link"/></xsl:attribute><xsl:value-of
> select="CAU/Result/Interface/Name"/></xsl:element>
>                 </xsl:if>
> 
>                 <xsl:if test="CAU/Result/Interface[not(Link)]">
>                   <SPAN class="RT">
>                     <xsl:value-of select="CAU/Result/Interface/Name"/>
>                   </SPAN>
>                 </xsl:if>
> 
>               </xsl:if>
> 
>               <SPAN class="MET">
>                 <xsl:value-of select="Method/Name"/>
>               </SPAN>
> 
>               (
> 
>               <!-- Parameters -->
>               <xsl:for-each select="CAU/Parameter">
> 
>                 <xsl:if test="Class">
> 
>                   <xsl:if test="Class/Link">
>                     <xsl:element name="a"><xsl:attribute
> name="href"><xsl:value-of
> select="Class/Link"/></xsl:attribute><xsl:value-of
> select="Class/Name"/></xsl:element>
>                   </xsl:if>
> 
>                   <xsl:if test="Class[not(Link)]">
>                     <SPAN class="CLT">
>                       <xsl:value-of select="Class/Name"/>
>                     </SPAN>
>                   </xsl:if>
> 
>                   <xsl:if test="isMethodOfParameterClass[Description]">
> 
>                     <SPAN class="CLT">
>                       <xsl:value-of
> select="isMethodOfParameterClass/Description"/>
>                     </SPAN>
>                   </xsl:if>
> 
>                 </xsl:if>
>   
>                 <xsl:if test="Interface">
> 
>                   <xsl:if test="Interface/Link">
>                     <xsl:element name="a"><xsl:attribute
> name="href"><xsl:value-of
> select="Interface/Link"/></xsl:attribute><xsl:value-of
> select="Interface/Name"/></xsl:element>
>                   </xsl:if>
> 
>                   <xsl:if test="Interface[not(Link)]">
>                     <SPAN class="INT">
>                       <xsl:value-of select="Interface/Name"/>
>                     </SPAN>
>                   </xsl:if>
>   
>                   <xsl:if test="isMethodOfParameterClass[Description]">
> 
>                     <SPAN class="INT">
>                       <xsl:value-of
> select="isMethodOfParameterClass/Description"/>
>                     </SPAN>
>                   </xsl:if>
> 
>                 </xsl:if>
> 
	<!-- START HERE -->

>                 <xsl:for-each
> select="../../Method/Description/MPA[index()=@number]">
>                     <xsl:value-of select="@name" />
>                 </xsl:for-each>
> 
	<!-- END HERE -->

>                 <xsl:if test="context()[not(end())]">, </xsl:if>
>               </xsl:for-each>
>               )
> 
>               <!-- Exceptions -->
>               <xsl:if test="CAU/Exception">
> 
>                 throws 
> 
>                 <xsl:for-each select="CAU/Exception/Class[Link]"
> order-by="Name">
>                   <xsl:element name="a"><xsl:attribute
> name="href"><xsl:value-of select="Link"/></xsl:attribute><xsl:value-of
> select="Name"/></xsl:element>
>                   <xsl:if test="context()[not(end())]">, </xsl:if>
>                 </xsl:for-each>
> 
>                 <xsl:for-each select="CAU/Exception/Class[not(Link)]"
> order-by="Name">
>                   <SPAN class="CLT">
>                     <xsl:value-of select="Name"/>
>                   </SPAN>
>                   <xsl:if test="context()[not(end())]">, </xsl:if>
>                 </xsl:for-each>
>   
>               </xsl:if>
>             </DIV>
> 
> This is the XML document describing a method:
> 
> <Meth>
>   <Method>
>     <ID>38555</ID>
>     <Picture>
>       <URL>Method.jpg</URL>
>       <Width>152</Width>
>       <Height>247</Height>
>     </Picture>
>     <System>1</System>
>     <Name>getField0</Name>
>     <Description>
<!-- START HERE -->

>       <MPA number="1" name="blabla1">This is just a test of the method
> name...</MPA>
>       <MPA number="2" name="blabla2">This is just a test of the method
> name... ttt</MPA>
> 
<!-- END HERE -->
>     </Description>
>   </Method>
>   <CAU>
>     <Result>
>       <Class>
>         <ID>38514</ID>
>  
> <Link>\\William\Users\cn\CodeAnalyzer\Documentation\Field_38514.xml</Link>
>         <Name>Field</Name>
>       </Class>
>       <isMethodOfResultClass>
>         <ID>149852</ID>
>         <Picture>
>           <URL>Class.jpg</URL>
>           <Width>157</Width>
>           <Height>242</Height>
>         </Picture>
>         <Source>getField0</Source>
>         <Target>Field</Target>
>       </isMethodOfResultClass>
>     </Result>
>   </CAU>
>   <CAU>
>     <Parameter>
>       <Class>
>         <ID>38253</ID>
>  
> <Link>\\William\Users\cn\CodeAnalyzer\Documentation\String_38253.xml</Link
> >
>         <Name>String</Name>
>       </Class>
>       <isMethodOfParameterClass>
>         <ID>149853</ID>
>         <Picture>
>           <URL>isParameterOf.jpg</URL>
>           <Width>153</Width>
>           <Height>245</Height>
>         </Picture>
>         <Source>getField0</Source>
>         <Target>String</Target>
>         <Description>0</Description>
>       </isMethodOfParameterClass>
>     </Parameter>
>     <Parameter>
>       <Class>
>         <ID>38245</ID>
>  
> <Link>\\William\Users\cn\CodeAnalyzer\Documentation\int_38245.xml</Link>
>         <Name>int</Name>
>       </Class>
>       <isMethodOfParameterClass>
>         <ID>149854</ID>
>         <Picture>
>           <URL>isParameterOf.jpg</URL>
>           <Width>-1</Width>
>           <Height>-1</Height>
>         </Picture>
>         <Source>getField0</Source>
>         <Target>int</Target>
>       </isMethodOfParameterClass>
>     </Parameter>
>   </CAU>
>   <CAU>
>     <Modifier>
>       <ID>38247</ID>
>       <System>0</System>
>       <Name>private</Name>
>     </Modifier>
>     <Modifier>
>       <ID>38278</ID>
>       <System>1</System>
>       <Name>native</Name>
>     </Modifier>
>   </CAU>
> </Meth>
> 
> I didn't find a solution... Maybe you can...
> 
PS : the <!--START HERE--> and <!--END HERE--> comment must be removed. They
are here only to show the important part of the XML and XSL code, thanks

> NEVE Cédric - CEDITI
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.