xsl-list
[Top] [All Lists]

Another XSL Structure/Template Problem...

2003-07-30 00:24:20
Attached are the XML and XSL files:

Everything works perfectly fine. I use a set of templates to generate a
tree. And another set of templates to put descriptions below the tree.

As you can see from the output HTML , Data Containers such as LookIn,
Options, IncludeInSearch and ServiceInfo are not hyper-links to any
description at the bottom. I would like them to be hyperlinks and also have
their descriptions at the bottom just like i have for all my other fields
such as searchFor, projectName, packageName etc etc. For this i tried
following the same format i used to HSString or HSInteger with mode="target"
thinking i could apply the same rules to put a description at the bottom
just like other fields but this doesn't work.

Another problem i have is in the tree itself. Somehow, my xsl is putting
descriptions of Data Containers e.g LookIn after its puts its name in the
tree. I am not able to get rid of these descriptions. I do not want any such
descriptions in the tree.

The best thing to do would be to load these files into Xselerator or any
other xsl editor and see the html output.

Any help or hints would be greatly appreciated.

Regards,

John

***********************
XML:
***********************

<HSContract contractCategory="2" contractName="FindWebServices"
contractType="1" expirationDate="Apr-23-2013" id="2_400_9735012853"
limitMaxConcurrentThreads="false" logEnabled="true" maxConcurrentThreads="2"
revision="2_45" runBatchInParallel="false" startDate="Apr-23-2003">

  <imagePath />

  <HSDataContainerType list="true" name="Inputs" required="true" revision=""
systype="true">

                <HSString name="searchFor" required="true" xmlNodeType="1">
                        <DefaultValue />
                        <HSDocumentation>
                                <shortDescription>
                                        <![CDATA[ This is the search text that 
is used to find Web
services.]]>
                                </shortDescription>
                        </HSDocumentation>
                </HSString>

                <HSDataContainerType name="LookIn" optionalOrigin="true" 
revision="">
                        <HSDocumentation>
                                <shortDescription>
                                        <![CDATA[ The search can be restricted 
to a particular  project or
package on a NextAxiom server.
                                                ]]>
                                </shortDescription>
                        </HSDocumentation>

                <HSString name="projectName" xmlNodeType="1">
                        <DefaultValue />
                        <HSDocumentation>
                                <shortDescription>
                                        <![CDATA[ The full name of the 
NextAxiom project to search  in.  This
is an optional input.  Note that the possible choices for this input can be
retrieved by using a Web service that returns all project names on a
NextAxiom server.
                                                ]]>
                                </shortDescription>
                        </HSDocumentation>
                </HSString>

                <HSString name="packageName" xmlNodeType="1">
                        <DefaultValue />
                        <HSDocumentation>
                                <shortDescription>
                                        <![CDATA[ The full path name of the 
NextAxiom package to search  in.
Packages are similar to 'folders' on a file system; they are used to group
web services into logical categories.  Packages can be nested to any depth.
The path separator for a packages is a period ('.').
                                                        This is an optional 
input.  Note that the possible choices for this
input can be retrieved by using a Web service that returns all package names
for a given project on a NextAxiom server.
                                        ]]>
                                </shortDescription>
                        </HSDocumentation>
                </HSString>

        </HSDataContainerType>

        <HSDataContainerType name="Options" optionalOrigin="true" revision="">

                <HSDocumentation>
                        <shortDescription>
                                <![CDATA[ Optional search options
                                        ]]>
                        </shortDescription>
                </HSDocumentation>

                <HSBoolean name="caseSensitive" xmlNodeType="1">
                        <DefaultValue>false</DefaultValue>
                        <HSDocumentation>
                                <shortDescription>
                                        <![CDATA[ If the value is true, then 
the search is case-sensitive.  If
the value is false, then the search is case-insensitive.
                                        ]]>
                                </shortDescription>
                        </HSDocumentation>
                </HSBoolean>

        </HSDataContainerType>

        <HSDataContainerType name="IncludeInSearch" optionalOrigin="true"
revision="">
                <HSDocumentation>
                        <shortDescription>
                                <![CDATA[ These inputs are used to restrict the 
search. They  are all
optional inputs, that default to 'true' if no value is supplied.
                                        ]]>
                        </shortDescription>
                </HSDocumentation>

                <HSBoolean name="serviceName" xmlNodeType="1">
                <DefaultValue>true</DefaultValue>
                        <HSDocumentation>
                                <shortDescription>
                                        <![CDATA[ If this is true, then a web 
service must contain the search
text in it's name to pass the criteria.
                                        ]]>
                                </shortDescription>
                        </HSDocumentation>
                </HSBoolean>
                <HSBoolean name="documentation" xmlNodeType="1">
                        <DefaultValue>true</DefaultValue>
                        <HSDocumentation>
                                <shortDescription>
                                        <![CDATA[ If this is true, then a web 
service must contain the search
text in it's documentation to pass the criteria.
                                                ]]>
                                </shortDescription>
                        </HSDocumentation>
                </HSBoolean>
                <HSBoolean name="keywords" xmlNodeType="1">
                        <DefaultValue>true</DefaultValue>
                        <HSDocumentation>
                                <shortDescription>
                                        <![CDATA[ If this is true, then a web 
service must contain the search
text in one of it's keywords to pass the criteria.
                                        ]]>
                                </shortDescription>
                        </HSDocumentation>
                </HSBoolean>
                <HSBoolean name="serviceInputs" xmlNodeType="1">
                        <DefaultValue>true</DefaultValue>
                        <HSDocumentation>
                                <shortDescription>
                                        <![CDATA[ If this is true, then a web 
service must contain the search
text in it's inputs to pass the criteria.
                                        ]]>
                                </shortDescription>
                        </HSDocumentation>
                </HSBoolean>
                <HSBoolean name="serviceOutputs" xmlNodeType="1">
                        <DefaultValue>true</DefaultValue>
                        <HSDocumentation>
                                <shortDescription>
                                        <![CDATA[ If this is true, then a web 
service must contain the search
text in it's outputs to pass the criteria.
                                        ]]>
                                </shortDescription>
                        </HSDocumentation>
                </HSBoolean>

        </HSDataContainerType>
  </HSDataContainerType>


 <HSDataContainerType list="true" name="Outputs" required="true" revision=""
systype="true">

        <HSDataContainerType id="274877906956" list="true" name="ServiceInfo"
optionalOrigin="true" revision="">
                <HSDocumentation>
                        <shortDescription>
                                <![CDATA[ This is a list of information of each 
service that was found
by the search.
                                ]]>
                        </shortDescription>
                </HSDocumentation>

                <HSString name="id" required="true" xmlNodeType="1">
                        <DefaultValue />
                        <HSDocumentation>
                                <shortDescription>
                                        <![CDATA[ The unique NextAxiom 
identifier for the Web service.
                                                ]]>
                                </shortDescription>
                        </HSDocumentation>
                </HSString>

                <HSString name="name" required="true" xmlNodeType="1">
                        <DefaultValue />
                        <HSDocumentation>
                                <shortDescription>
                                        <![CDATA[ The name of the Web service]]>
                                </shortDescription>
                        </HSDocumentation>
                </HSString>

                <HSString name="shortDescription" xmlNodeType="1">
                        <DefaultValue />
                        <HSDocumentation>
                                <shortDescription>
                                        <![CDATA[ The short decription 
documentation of the Web service
                                        ]]>
                                </shortDescription>
                        </HSDocumentation>
                </HSString>

                <HSString name="projectName" required="true" xmlNodeType="1">
                        <DefaultValue />
                        <HSDocumentation>
                                <shortDescription>
                                        <![CDATA[ The name of the project where 
the Web service exists]]>
                                </shortDescription>
                        </HSDocumentation>
                </HSString>

                <HSString name="packageName" required="true" xmlNodeType="1">
                        <DefaultValue />
                        <HSDocumentation>
                                <shortDescription>
                                        <![CDATA[ The full path name of the 
package where the Web service
exists]]>
                                </shortDescription>
                        </HSDocumentation>
                </HSString>

        </HSDataContainerType>
  </HSDataContainerType>

</HSContract>

****************************************************************
XSL:
***************************************************************

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

        <xsl:template match="HSContract">
                <html>
                        <head>
                                <title/>
                        </head>
                        <body>
                                <font face="Arial">
                                <p>
                                        <b>Service Name: </b>
                                        <xsl:value-of select="@contractName"/>
                                        <br />
                                        <b>Start Date: </b>
                                        <xsl:value-of select="@startDate"/>
                                        <br />
                                        <b>Expiration Date: </b>
                                        <xsl:value-of select="@expirationDate"/>
                                        <br />
                                </p>
                                <xsl:apply-templates select="HSDocumentation" />
                                <!-- <keyword> is all taken care of in here -->
                                <b>Search Keyword: </b>
                                <br />
                                <xsl:for-each select="keyword">
                                        <xsl:choose>
                                                <xsl:when 
test="normalize-space(text())=''">None
                                                        <br />
                                                </xsl:when>
                                                <xsl:otherwise>
                                                        <xsl:value-of 
select="text()"/>
                                                        <br />
                                                </xsl:otherwise>
                                        </xsl:choose>
                                </xsl:for-each>
                                <br />
                                <br />
                                <!-- TEMPLATES FOR Tree Generation-->
                                <xsl:apply-templates 
select="HSDataContainerType[(_at_)name='Inputs']" mode =
"treeGeneration"/>
                                <xsl:apply-templates 
select="HSDataContainerType[(_at_)name='Outputs']"  mode
= "treeGeneration"/>
                                <xsl:apply-templates 
select="HSDataContainerType[(_at_)name='Inputs']" mode =
"dataTypeDetail"/>
                                <xsl:apply-templates 
select="HSDataContainerType[(_at_)name='Outputs']"  mode
= "dataTypeDetail"/>
                                </font>
                        </body>
                </html>
        </xsl:template>

        <xsl:template match="HSDataContainerType[contains(@name, 'Inputs')]" 
mode =
"treeGeneration">
                <img src="dcopenicon.gif">
                        <a href="#in">
                                <b>
                                        <xsl:value-of select="@name"/>
                                </b>
                        </a>
                </img>
                <div style="margin-left: 3em;">
                        <xsl:apply-templates select="*"/>
                </div>
        </xsl:template>

        <xsl:template match="HSDataContainerType[contains(@name, 'Inputs')]" 
mode =
"dataTypeDetail">
                <br />
                <b>
                        <a name="in">Inputs Descriptions</a>
                </b>
                <br />
                <br />
                <xsl:apply-templates select="*" mode="target" />
        </xsl:template>

        <xsl:template match="HSDataContainerType[contains(@name, 'Outputs')]" 
mode
= "treeGeneration">
                <img src="dcopenicon.gif">
                        <a href="#out">
                                <b>
                                        <xsl:value-of select="@name"/>
                                </b>
                        </a>
                </img>
                <div style="margin-left: 3em;">
                        <xsl:apply-templates select="*"/>
                </div>
        </xsl:template>

        <xsl:template match="HSDataContainerType[contains(@name, 'Outputs')]" 
mode
= "dataTypeDetail">
                <br />
                <b>
                        <a name="out">Outputs Descriptions</a>
                </b>
                <br />
                <br />
                <xsl:apply-templates select="*" mode="target" />
        </xsl:template>


        <xsl:template match="HSDataContainerType">
                <b>
                        <img src="dcopenicon.gif">
                                <xsl:value-of select="@name"/>
                        </img>
                        <br />
                </b>
                <div style="margin-left: 3em;">
                        <xsl:apply-templates select="*"/>
                </div>
        </xsl:template>

        <xsl:template match="HSString">
                <img src="texticon.gif">
                        <a href="#{generate-id(.)}">
                                <xsl:value-of select="@name" />
                        </a>
                        <br />
                </img>
        </xsl:template>

        <xsl:template match="HSString" mode="target">
                <img src="texticon.gif">
                        <a name="{generate-id(.)}">
                                <b>
                                        <xsl:comment>Accessing the parent 
nodes...</xsl:comment>
                                        <xsl:for-each select="ancestor::*">
                                                <xsl:choose>
                                                        <xsl:when 
test="contains(@name, 'Inputs')"></xsl:when>
                                                        <xsl:when 
test="contains(@name, 'Outputs')"></xsl:when>
                                                        <xsl:when 
test="contains(@name, 'Settings')"></xsl:when>
                                                        <xsl:otherwise>
                                                                <xsl:if 
test="not(position()='1')">
                                                                        
<xsl:value-of select="@name" />/
                                                                </xsl:if>
                                                        </xsl:otherwise>
                                                </xsl:choose>
                                        </xsl:for-each>
                                        <xsl:value-of select="@name" />
                                </b>
                        </a>
                </img>
                <br />
                <!-- Handle HSDocumentation inside a dataContainer in here -->
                <xsl:text>Description: </xsl:text>
                <xsl:choose>
                        <xsl:when test="normalize-space(HSDocumentation) = ''">
                                None
                                <br />
                        </xsl:when>
                        <xsl:otherwise>
                                <xsl:value-of select="HSDocumentation" />
                                <br />
                        </xsl:otherwise>
                </xsl:choose>
                <xsl:text>Required: </xsl:text>
                <xsl:choose>
                        <xsl:when test="contains(@required, 'true')">
                                Yes
                                <br />
                        </xsl:when>
                        <!-- if optional, then default value exists or doesn't 
exist-->
                        <xsl:otherwise>No
                                <br />
                                Default Value:
                                <!--if default tag has some value, display 
otherwise say "No Default
Value"-->
                                <xsl:choose>
                                        <xsl:when 
test="normalize-space(DefaultValue) = ''">
                                                None
                                                <br />
                                        </xsl:when>
                                        <xsl:otherwise>
                                                <xsl:value-of 
select="DefaultValue" />
                                                <br />
                                        </xsl:otherwise>
                                </xsl:choose>
                        </xsl:otherwise>
                </xsl:choose>
                <xsl:choose>
                        <xsl:when test="contains(@restrictType, '1')">
                                <!-- if restrictType = 1 then display 
restrictions-->
                                Only the following values are allowed:
                                <xsl:for-each select="restrictedValue">
                                        <xsl:value-of select="text()" />&#160;
                                </xsl:for-each>
                                <br />
                        </xsl:when>
                        <xsl:when test="contains(@restrictType, '2')">
                                <xsl:for-each select="restrictedValue">
                                        <xsl:if test="(position() = 1) and 
text()">
                                        Min Number of Characters:
                                                <xsl:value-of select="text()"/>
                                                <br />
                                        </xsl:if>
                                        <xsl:if test="(position() = 1) and 
not(text())">
                                        Min Number of Characters: None
                                                <br/>
                                        </xsl:if>
                                        <xsl:if test="(position() = 2) and 
text()">
                                        Max Number of Characters:
                                                <xsl:value-of select="text()"/>
                                                <br />
                                        </xsl:if>
                                        <xsl:if test="(position() = 2) and 
not(text())">
                                        Max Number of Characters: None
                                                <br />
                                        </xsl:if>
                                </xsl:for-each>
                        </xsl:when>
                        <xsl:when test="contains(@restrictType, '3')">
                                <!-- if restrictType = 3 then say 'Pattern 
Allowed:' value-->
                                <xsl:text>The value must match the following 
pattern: </xsl:text>
                                <xsl:choose>
                                        <!-- <xsl:when 
test="normalize-space(text()) = ''"> -->
                                        <xsl:when test="restrictedValue[.='']">
                                                <xsl:text>None</xsl:text>
                                                <br />
                                        </xsl:when>
                                        <xsl:otherwise>
                                                <xsl:value-of 
select="restrictedValue" />
                                                <br />
                                        </xsl:otherwise>
                                </xsl:choose>
                        </xsl:when>
                        <xsl:otherwise>
                        Value Restrictions: None
                                <br />
                        </xsl:otherwise>
                </xsl:choose>
                <br />
        </xsl:template>


        <xsl:template match="HSDouble">
                <img src="decimalicon.gif">
                        <a href="#{generate-id(.)}">
                                <xsl:value-of select="@name" />
                        </a>
                        <br />
                </img>
        </xsl:template>
        <xsl:template match="HSDouble" mode="target">
                <img src="decimalicon.gif">
                        <a name="{generate-id(.)}">
                                <b>
                                        <xsl:comment>Accessing the parent 
nodes...</xsl:comment>
                                        <xsl:for-each select="ancestor::*">
                                                <xsl:choose>
                                                        <xsl:when 
test="contains(@name, 'Inputs')"></xsl:when>
                                                        <xsl:when 
test="contains(@name, 'Outputs')"></xsl:when>
                                                        <xsl:when 
test="contains(@name, 'Settings')"></xsl:when>
                                                        <xsl:otherwise>
                                                                <xsl:if 
test="not(position()='1')">
                                                                        
<xsl:value-of select="@name" />/
                                                                </xsl:if>
                                                        </xsl:otherwise>
                                                </xsl:choose>
                                        </xsl:for-each>
                                        <xsl:value-of select="@name" />
                                </b>
                        </a>
                </img>
                <br />
                <!-- Handle HSDocumentation in here -->
                <xsl:text>Description: </xsl:text>
                <xsl:choose>
                        <xsl:when test="normalize-space(HSDocumentation) = ''">
                                None
                                <br />
                        </xsl:when>
                        <xsl:otherwise>
                                <xsl:value-of select="HSDocumentation" />
                                <br />
                        </xsl:otherwise>
                </xsl:choose>

                Required:
                <xsl:choose>
                        <xsl:when test="contains(@required, 'true')">
                                Yes
                                <br />
                        </xsl:when>
                        <!-- if optional, then default value exists or doesn't 
exist-->
                        <xsl:otherwise>No
                                <br />
                                Default Value:
                                <!--if default tag has some value, display 
otherwise say "No Default
Value"-->
                                <xsl:choose>
                                        <xsl:when 
test="normalize-space(DefaultValue) = ''">
                                                None
                                                <br />
                                        </xsl:when>
                                        <xsl:otherwise>
                                                <xsl:value-of 
select="DefaultValue" />
                                                <br />
                                        </xsl:otherwise>
                                </xsl:choose>
                        </xsl:otherwise>
                </xsl:choose>
                <xsl:choose>
                        <xsl:when test="contains(@restrictType, '1')">
                                <!-- if restrictType = 1 then display 
restrictions-->
                                Only the following values are allowed:
                                <xsl:for-each select="restrictedValue">
                                        <xsl:value-of select="text()" />;
                                </xsl:for-each>
                                <br />
                        </xsl:when>
                        <xsl:when test="contains(@restrictType, '2')">
                                <xsl:for-each select="restrictedValue">
                                        <xsl:if test="(position() = 1) and 
text()">
                                        Min Value Allowed:
                                                <xsl:value-of select="text()"/>
                                                <br />
                                        </xsl:if>
                                        <xsl:if test="(position() = 1) and 
not(text())">
                                        Min Value Allowed: None
                                                <br/>
                                        </xsl:if>
                                        <xsl:if test="(position() = 2) and 
text()">
                                        Max Value Allowed:
                                                <xsl:value-of select="text()"/>
                                                <br />
                                        </xsl:if>
                                        <xsl:if test="(position() = 2) and 
not(text())">
                                        Max Value Allowed: None
                                                <br />
                                        </xsl:if>
                                </xsl:for-each>
                        </xsl:when>
                        <xsl:when test="contains(@restrictType, '3')">
                                <!-- if restrictType = 3 then say 'Pattern 
Allowed:' value-->
                                <xsl:text>The value must match the following 
pattern: </xsl:text>
                                <xsl:choose>
                                        <!-- <xsl:when 
test="normalize-space(text()) = ''"> -->
                                        <xsl:when test="restrictedValue[.='']">
                                                <xsl:text>None</xsl:text>
                                                <br />
                                        </xsl:when>
                                        <xsl:otherwise>
                                                <xsl:value-of 
select="restrictedValue" />
                                                <br />
                                        </xsl:otherwise>
                                </xsl:choose>
                        </xsl:when>
                        <xsl:otherwise>
                        Value Restrictions: None
                                <br />
                        </xsl:otherwise>
                </xsl:choose>
                <br />
        </xsl:template>
        <xsl:template match="HSInteger">
                <img src="integericon.gif">
                        <a href="#{generate-id(.)}">
                                <xsl:value-of select="@name" />
                        </a>
                        <br />
                </img>
        </xsl:template>
        <xsl:template match="HSInteger" mode="target">
                <img src="integericon.gif">
                        <a name="{generate-id(.)}">
                                <b>
                                        <xsl:comment>Accessing the parent 
nodes...</xsl:comment>
                                        <xsl:for-each select="ancestor::*">
                                                <xsl:choose>
                                                        <xsl:when 
test="contains(@name, 'Inputs')"></xsl:when>
                                                        <xsl:when 
test="contains(@name, 'Outputs')"></xsl:when>
                                                        <xsl:when 
test="contains(@name, 'Settings')"></xsl:when>
                                                        <xsl:otherwise>
                                                                <xsl:if 
test="not(position()='1')">
                                                                        
<xsl:value-of select="@name" />/
                                                                </xsl:if>
                                                        </xsl:otherwise>
                                                </xsl:choose>
                                        </xsl:for-each>
                                        <xsl:value-of select="@name" />
                                </b>
                        </a>
                </img>
                <br />
                <!-- Handle HSDocumentation in here -->
                <xsl:text>Description: </xsl:text>
                <xsl:choose>
                        <xsl:when test="normalize-space(HSDocumentation) = ''">
                                None
                                <br />
                        </xsl:when>
                        <xsl:otherwise>
                                <xsl:value-of select="HSDocumentation" />
                                <br />
                        </xsl:otherwise>
                </xsl:choose>

                Required:
                <xsl:choose>
                        <xsl:when test="contains(@required, 'true')">
                                Yes
                                <br />
                        </xsl:when>
                        <!-- if optional, then default value exists or doesn't 
exist-->
                        <xsl:otherwise>No
                                <br />
                                Default Value:
                                <!--if default tag has some value, display 
otherwise say "No Default
Value"-->
                                <xsl:choose>
                                        <xsl:when 
test="normalize-space(DefaultValue) = ''">
                                                None
                                                <br />
                                        </xsl:when>
                                        <xsl:otherwise>
                                                <xsl:value-of 
select="DefaultValue" />
                                                <br />
                                        </xsl:otherwise>
                                </xsl:choose>
                        </xsl:otherwise>
                </xsl:choose>
                <xsl:choose>
                        <xsl:when test="contains(@restrictType, '1')">
                                <!-- if restrictType = 1 then display 
restrictions-->
                                Only the following values are allowed:
                                <xsl:for-each select="restrictedValue">
                                        <xsl:value-of select="text()" />;
                                </xsl:for-each>
                                <br />
                        </xsl:when>
                        <xsl:when test="contains(@restrictType, '2')">
                                <xsl:for-each select="restrictedValue">
                                        <xsl:if test="(position() = 1) and 
text()">
                                        Min Value Allowed:
                                                <xsl:value-of select="text()"/>
                                                <br />
                                        </xsl:if>
                                        <xsl:if test="(position() = 1) and 
not(text())">
                                        Min Value Allowed: None
                                                <br/>
                                        </xsl:if>
                                        <xsl:if test="(position() = 2) and 
text()">
                                        Max Value Allowed:
                                                <xsl:value-of select="text()"/>
                                                <br />
                                        </xsl:if>
                                        <xsl:if test="(position() = 2) and 
not(text())">
                                        Max Value Allowed: None
                                                <br />
                                        </xsl:if>
                                </xsl:for-each>
                        </xsl:when>
                        <xsl:when test="contains(@restrictType, '3')">
                                <!-- if restrictType = 3 then say 'Pattern 
Allowed:' value-->
                                <xsl:text>The value must match the following 
pattern: </xsl:text>
                                <xsl:choose>
                                        <!-- <xsl:when 
test="normalize-space(text()) = ''"> -->
                                        <xsl:when test="restrictedValue[.='']">
                                                <xsl:text>None</xsl:text>
                                                <br />
                                        </xsl:when>
                                        <xsl:otherwise>
                                                <xsl:value-of 
select="restrictedValue" />
                                                <br />
                                        </xsl:otherwise>
                                </xsl:choose>
                        </xsl:when>
                        <xsl:otherwise>
                        Value Restrictions: None
                                <br />
                        </xsl:otherwise>
                </xsl:choose>
                <br />
        </xsl:template>
        <xsl:template match="HSBinary">
                <img src="binaryicon.gif">
                        <a href="#{generate-id(.)}">
                                <xsl:value-of select="@name" />
                        </a>
                        <br />
                </img>
        </xsl:template>
        <xsl:template match="HSBinary" mode="target">
                <img src="binaryicon.gif">
                        <a name="{generate-id(.)}">
                                <b>
                                        <xsl:comment>Accessing the parent 
nodes...</xsl:comment>
                                        <xsl:for-each select="ancestor::*">
                                                <xsl:choose>
                                                        <xsl:when 
test="contains(@name, 'Inputs')"></xsl:when>
                                                        <xsl:when 
test="contains(@name, 'Outputs')"></xsl:when>
                                                        <xsl:when 
test="contains(@name, 'Settings')"></xsl:when>
                                                        <xsl:otherwise>
                                                                <xsl:if 
test="not(position()='1')">
                                                                        
<xsl:value-of select="@name" />/
                                                                </xsl:if>
                                                        </xsl:otherwise>
                                                </xsl:choose>
                                        </xsl:for-each>
                                        <xsl:value-of select="@name" />
                                </b>
                        </a>
                </img>
                <br />
                <!-- Handle HSDocumentation in here -->
                <xsl:text>Description: </xsl:text>
                <xsl:choose>
                        <xsl:when test="normalize-space(HSDocumentation) = ''">
                                None
                                <br />
                        </xsl:when>
                        <xsl:otherwise>
                                <xsl:value-of select="HSDocumentation" />
                                <br />
                        </xsl:otherwise>
                </xsl:choose>

                Required:
                <xsl:choose>
                        <xsl:when test="contains(@required, 'true')">
                                Yes
                                <br />
                        </xsl:when>
                        <!-- if optional, then default value exists or doesn't 
exist-->
                        <xsl:otherwise>No
                                <br />
                                Default Value:
                                <!--if default tag has some value, display 
otherwise say "No Default
Value"-->
                                <xsl:choose>
                                        <xsl:when 
test="normalize-space(DefaultValue) = ''">
                                                None
                                                <br />
                                        </xsl:when>
                                        <xsl:otherwise>
                                                <xsl:value-of 
select="DefaultValue" />
                                                <br />
                                        </xsl:otherwise>
                                </xsl:choose>
                        </xsl:otherwise>
                </xsl:choose>
                <xsl:choose>
                        <xsl:when test="contains(@restrictType, '1')">
                                <!-- if restrictType = 1 then display 
restrictions-->
                                Only the following values are allowed:
                                <xsl:for-each select="restrictedValue">
                                        <xsl:value-of select="text()" />;
                                </xsl:for-each>
                                <br />
                        </xsl:when>
                        <xsl:when test="contains(@restrictType, '2')">
                                <xsl:for-each select="restrictedValue">
                                        <xsl:if test="(position() = 1) and 
text()">
                                        Min Value Allowed:
                                                <xsl:value-of select="text()"/>
                                                <br />
                                        </xsl:if>
                                        <xsl:if test="(position() = 1) and 
not(text())">
                                        Min Value Allowed: None
                                                <br/>
                                        </xsl:if>
                                        <xsl:if test="(position() = 2) and 
text()">
                                        Max Value Allowed:
                                                <xsl:value-of select="text()"/>
                                                <br />
                                        </xsl:if>
                                        <xsl:if test="(position() = 2) and 
not(text())">
                                        Max Value Allowed: None
                                                <br />
                                        </xsl:if>
                                </xsl:for-each>
                        </xsl:when>
                        <xsl:when test="contains(@restrictType, '3')">
                                <!-- if restrictType = 3 then say 'Pattern 
Allowed:' value-->
                                <xsl:text>The value must match the following 
pattern: </xsl:text>
                                <xsl:choose>
                                        <!-- <xsl:when 
test="normalize-space(text()) = ''"> -->
                                        <xsl:when test="restrictedValue[.='']">
                                                <xsl:text>None</xsl:text>
                                                <br />
                                        </xsl:when>
                                        <xsl:otherwise>
                                                <xsl:value-of 
select="restrictedValue" />
                                                <br />
                                        </xsl:otherwise>
                                </xsl:choose>
                        </xsl:when>
                        <xsl:otherwise>Binary Encoding:
                                <xsl:choose>
                                        <xsl:when 
test="contains(@binaryEncoding, '0')">
                                        base64
                                                <br />
                                        </xsl:when>
                                        <xsl:otherwise>
                                        Hex
                                                <br />
                                        </xsl:otherwise>
                                </xsl:choose>
                        </xsl:otherwise>
                </xsl:choose>
                <br />
        </xsl:template>
        <xsl:template match="HSDate">
                <img src="dateicon.gif">
                        <a href="#{generate-id(.)}">
                                <xsl:value-of select="@name" />
                        </a>
                        <br />
                </img>
        </xsl:template>
        <xsl:template match="HSDate" mode="target">
                <img src="dateicon.gif">
                        <a name="{generate-id(.)}">
                                <b>
                                        <xsl:comment>Accessing the parent 
nodes...</xsl:comment>
                                        <xsl:for-each select="ancestor::*">
                                                <xsl:choose>
                                                        <xsl:when 
test="contains(@name, 'Inputs')"></xsl:when>
                                                        <xsl:when 
test="contains(@name, 'Outputs')"></xsl:when>
                                                        <xsl:when 
test="contains(@name, 'Settings')"></xsl:when>
                                                        <xsl:otherwise>
                                                                <xsl:if 
test="not(position()='1')">
                                                                        
<xsl:value-of select="@name" />/
                                                                </xsl:if>
                                                        </xsl:otherwise>
                                                </xsl:choose>
                                        </xsl:for-each>
                                        <xsl:value-of select="@name" />
                                </b>
                        </a>
                </img>
                <br />
                <!-- Handle HSDocumentation in here -->
                <xsl:text>Description: </xsl:text>
                <xsl:choose>
                        <xsl:when test="normalize-space(HSDocumentation) = ''">
                                None
                                <br />
                        </xsl:when>
                        <xsl:otherwise>
                                <xsl:value-of select="HSDocumentation" />
                                <br />
                        </xsl:otherwise>
                </xsl:choose>

                Required:
                <xsl:choose>
                        <xsl:when test="contains(@required, 'true')">
                                Yes
                                <br />
                        </xsl:when>
                        <!-- if optional, then default value exists or doesn't 
exist-->
                        <xsl:otherwise>No
                                <br />
                                Default Value:
                                <!--if default tag has some value, display 
otherwise say "No Default
Value"-->
                                <xsl:choose>
                                        <xsl:when 
test="normalize-space(DefaultValue) = ''">
                                                None
                                                <br />
                                        </xsl:when>
                                        <xsl:otherwise>
                                                <xsl:value-of 
select="DefaultValue" />
                                                <br />
                                        </xsl:otherwise>
                                </xsl:choose>
                        </xsl:otherwise>
                </xsl:choose>
                <xsl:choose>
                        <xsl:when test="contains(@restrictType, '1')">
                                <!-- if restrictType = 1 then display 
restrictions-->
                                Only the following values are allowed:
                                <xsl:for-each select="restrictedValue">
                                        <xsl:value-of select="text()" />;
                                </xsl:for-each>
                                <br />
                        </xsl:when>
                        <xsl:when test="contains(@restrictType, '2')">
                                <xsl:for-each select="restrictedValue">
                                        <xsl:if test="(position() = 1) and 
text()">
                                        Min Value Allowed:
                                                <xsl:value-of select="text()"/>
                                                <br />
                                        </xsl:if>
                                        <xsl:if test="(position() = 1) and 
not(text())">
                                        Min Value Allowed: None
                                                <br/>
                                        </xsl:if>
                                        <xsl:if test="(position() = 2) and 
text()">
                                        Max Value Allowed:
                                                <xsl:value-of select="text()"/>
                                                <br />
                                        </xsl:if>
                                        <xsl:if test="(position() = 2) and 
not(text())">
                                        Max Value Allowed: None
                                                <br />
                                        </xsl:if>
                                </xsl:for-each>
                        </xsl:when>
                        <xsl:when test="contains(@restrictType, '3')">
                                <!-- if restrictType = 3 then say 'Pattern 
Allowed:' value-->
                                <xsl:text>The value must match the following 
pattern: </xsl:text>
                                <xsl:choose>
                                        <!-- <xsl:when 
test="normalize-space(text()) = ''"> -->
                                        <xsl:when test="restrictedValue[.='']">
                                                <xsl:text>None</xsl:text>
                                                <br />
                                        </xsl:when>
                                        <xsl:otherwise>
                                                <xsl:value-of 
select="restrictedValue" />
                                                <br />
                                        </xsl:otherwise>
                                </xsl:choose>
                        </xsl:when>
                        <xsl:otherwise>
                        Value Restrictions: None
                                <br />
                        </xsl:otherwise>
                </xsl:choose>
                <br />
        </xsl:template>
        <xsl:template match="HSBoolean">
                <img src="truefalseicon.gif">
                        <a href="#{generate-id(.)}">
                                <xsl:value-of select="@name" />
                        </a>
                        <br />
                </img>
        </xsl:template>
        <xsl:template match="HSBoolean" mode="target">
                <img src="truefalseicon.gif">
                        <a name="{generate-id(.)}">
                                <b>
                                        <xsl:comment>Accessing the parent 
nodes...</xsl:comment>
                                        <xsl:for-each select="ancestor::*">
                                                <xsl:choose>
                                                        <xsl:when 
test="contains(@name, 'Inputs')"></xsl:when>
                                                        <xsl:when 
test="contains(@name, 'Outputs')"></xsl:when>
                                                        <xsl:when 
test="contains(@name, 'Settings')"></xsl:when>
                                                        <xsl:otherwise>
                                                                <xsl:if 
test="not(position()='1')">
                                                                        
<xsl:value-of select="@name" />/
                                                                </xsl:if>
                                                        </xsl:otherwise>
                                                </xsl:choose>
                                        </xsl:for-each>
                                        <xsl:value-of select="@name" />
                                </b>
                        </a>
                </img>
                <br />
                <!-- Handle HSDocumentation in here -->
                <xsl:text>Description: </xsl:text>
                <xsl:choose>
                        <xsl:when test="normalize-space(HSDocumentation) = ''">
                                None
                                <br />
                        </xsl:when>
                        <xsl:otherwise>
                                <xsl:value-of select="HSDocumentation" />
                                <br />
                        </xsl:otherwise>
                </xsl:choose>

                Required:
                <xsl:choose>
                        <xsl:when test="contains(@required, 'true')">
                                Yes
                                <br />
                        </xsl:when>
                        <!-- if optional, then default value exists or doesn't 
exist-->
                        <xsl:otherwise>No
                                <br />
                                Default Value:
                                <!--if default tag has some value, display 
otherwise say "No Default
Value"-->
                                <xsl:choose>
                                        <xsl:when 
test="normalize-space(DefaultValue) = ''">
                                                None
                                                <br />
                                        </xsl:when>
                                        <xsl:otherwise>
                                                <xsl:value-of 
select="DefaultValue" />
                                                <br />
                                        </xsl:otherwise>
                                </xsl:choose>
                        </xsl:otherwise>
                </xsl:choose>
                <xsl:choose>
                        <xsl:when test="contains(@restrictType, '1')">
                                <!-- if restrictType = 1 then display 
restrictions-->
                                Only the following values are allowed:
                                <xsl:for-each select="restrictedValue">
                                        <xsl:value-of select="text()" />;
                                </xsl:for-each>
                                <br />
                        </xsl:when>
                        <xsl:when test="contains(@restrictType, '2')">
                                <xsl:for-each select="restrictedValue">
                                        <xsl:if test="(position() = 1) and 
text()">
                                        Min Value Allowed:
                                                <xsl:value-of select="text()"/>
                                                <br />
                                        </xsl:if>
                                        <xsl:if test="(position() = 1) and 
not(text())">
                                        Min Value Allowed: None
                                                <br/>
                                        </xsl:if>
                                        <xsl:if test="(position() = 2) and 
text()">
                                        Max Value Allowed:
                                                <xsl:value-of select="text()"/>
                                                <br />
                                        </xsl:if>
                                        <xsl:if test="(position() = 2) and 
not(text())">
                                        Max Value Allowed: None
                                                <br />
                                        </xsl:if>
                                </xsl:for-each>
                        </xsl:when>
                        <xsl:when test="contains(@restrictType, '3')">
                                <!-- if restrictType = 3 then say 'Pattern 
Allowed:' value-->
                                <xsl:text>The value must match the following 
pattern: </xsl:text>
                                <xsl:choose>
                                        <!-- <xsl:when 
test="normalize-space(text()) = ''"> -->
                                        <xsl:when test="restrictedValue[.='']">
                                                <xsl:text>None</xsl:text>
                                                <br />
                                        </xsl:when>
                                        <xsl:otherwise>
                                                <xsl:value-of 
select="restrictedValue" />
                                                <br />
                                        </xsl:otherwise>
                                </xsl:choose>
                        </xsl:when>
                        <xsl:otherwise>
                        Value Restrictions: None
                                <br />
                        </xsl:otherwise>
                </xsl:choose>
                <br />
        </xsl:template>

        <!-- This doesn't mess up HSDocumentation inside of a DataContainer or a
Field-->
        <xsl:template match="HSContract/HSDocumentation">
                <b>Short Description: </b>
                <br />
                <xsl:choose>
                        <xsl:when test="normalize-space(shortDescription) = ''">
                        None
                                <br />
                                <br />
                        </xsl:when>
                        <xsl:otherwise>
                                <xsl:value-of select="shortDescription" />
                                <br />
                                <br />
                        </xsl:otherwise>
                </xsl:choose>
                <b>Long Description:</b>
                <br />
                <xsl:if test="normalize-space(descriptionSection)=''">
                None
                        <br />
                </xsl:if>
                <xsl:for-each select="descriptionSection">
                        <xsl:choose>
                                <xsl:when test="@title!=''">
                                        <b>
                                                <font size="-1.5">
                                                        <xsl:value-of 
select="@title" />
                                                </font>
                                        </b>
                                        <br />
                                        <xsl:if test="text()!=''">
                                                <font size="-1.5">
                                                        <xsl:value-of 
select="text()" />
                                                </font>
                                                <br />
                                        </xsl:if>
                                        <xsl:if 
test="normalize-space(text())=''">
                                                <font size="-1.5">
                                                        None
                                                </font>
                                                <br />
                                        </xsl:if>
                                </xsl:when>
                                <xsl:otherwise>
                                None
                                </xsl:otherwise>
                        </xsl:choose>
                </xsl:for-each>
                <br />
        </xsl:template>
</xsl:stylesheet>



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



<Prev in Thread] Current Thread [Next in Thread>