xsl-list
[Top] [All Lists]

Re: generate-id( ) not working

2003-07-02 19:03:45
Thanks very much Lars. Your info was very helpful. I have a question again.
If you see my output HTML, when i put down the targets of my links at the
very bottom of the doc., they are in a sequential order. First i put down
all the HSString items, then the HSDouble item and so forth. This is being
done through this statements like this one in my first template:

<xsl:apply-templates select="//HSString" mode="target" />

My question is, is there a way for me to put down these targets in the same
order as i display them in the heirarchal sequence above? In the example XML
and XSL i provide, the heirarchal structure has textField_1, integerField_1,
decimalField_1...textField_1_1, integerField_1_1 and so forth. But right now
my targets (in output HTML) at the bottom show all the textFields first then
decimalFields and so forth. I understand that this is because of my sequence
in of the apply template statements in the first template.
Please let me know if putting them in the sequence of the heirarchal
structure is possible. Thank you once again for you help.
John
--------------------------------------------------------------
XML:
--------------------------------------------------------------

 <HSContract contractCategory="2" contractName="myWebservice"
contractType="3" expirationDate="Jun-23-2013" id="25_610_15006485306"
limitMaxConcurrentThreads="false" logEnabled="true" maxConcurrentThreads="2"
revision="25_33" runBatchInParallel="false" startDate="Jun-23-2003">
  <imagePath />
 <HSDataContainerType list="true" name="Inputs" required="true" revision=""
systype="true">
 <HSString name="textField_1" restrictType="3" xmlNodeType="1">
  <DefaultValue>hello</DefaultValue>
 <HSDocumentation>
 <shortDescription>
 <![CDATA[ textField_1_Documentation
  ]]>
  </shortDescription>
  </HSDocumentation>
  <restrictedValue />
  </HSString>
  <HSInteger name="integerField_1" required="true" xmlNodeType="1" />
  <HSDouble name="decimalField_1" required="true" xmlNodeType="1" />
  <HSDate isCacheKey="false" name="dateField_1" required="true"
xmlNodeType="1" />
  <HSBinary binaryEncoding="0" name="binaryField_1" required="true"
xmlNodeType="1" />
 <HSBoolean name="trueFalseField_1" required="true" xmlNodeType="1">
  <DefaultValue>false</DefaultValue>
  </HSBoolean>
 <HSDataContainerType name="DataContainer_1_1" required="true" revision="">
  <HSString name="textField_1_1" required="true" xmlNodeType="1" />
  <HSInteger name="integerField_1_1" required="true" xmlNodeType="1" />
 <HSDataContainerType name="DataContainer_1_1_1" required="true"
revision="">
  <HSString name="textField_1_1_1" required="true" xmlNodeType="1" />
  <HSInteger name="integerField_1_1_1" required="true" xmlNodeType="1" />
  </HSDataContainerType>
  </HSDataContainerType>
  </HSDataContainerType>
 <HSDataContainerType list="true" name="Outputs" required="true" revision=""
systype="true">
 <HSDataContainerType name="NoValueRestrictions" required="true"
revision="">
  <HSString name="required" required="true" xmlNodeType="1" />
 <HSString name="optional_NoDefault" xmlNodeType="1">
  <DefaultValue />
  </HSString>
 <HSString name="optional_withDefault" xmlNodeType="1">
  <DefaultValue>This is the default value</DefaultValue>
  </HSString>
  </HSDataContainerType>
 <HSDataContainerType name="TextValueRestrictions" required="true"
revision="">
 <HSString name="restrictByValue" required="true" restrictType="1"
xmlNodeType="1">
  <restrictedValue>CA</restrictedValue>
  <restrictedValue>WA</restrictedValue>
  <restrictedValue>VA</restrictedValue>
  </HSString>
 <HSString name="restrictByRange" required="true" restrictType="2"
xmlNodeType="1">
  <restrictedValue>0</restrictedValue>
  <restrictedValue>100</restrictedValue>
  </HSString>
 <HSString name="restrictByRangeNoMIN" required="true" restrictType="2"
xmlNodeType="1">
  <restrictedValue />
  <restrictedValue>500</restrictedValue>
  </HSString>
 <HSString name="restrictByRangeNoMAX" required="true" restrictType="2"
xmlNodeType="1">
  <restrictedValue>40</restrictedValue>
  <restrictedValue />
  </HSString>
 <HSString name="restrictByPattern" required="true" restrictType="3"
xmlNodeType="1">
  <restrictedValue>^Pattern</restrictedValue>
  </HSString>
  </HSDataContainerType>
 <HSDataContainerType name="NumberValueRestrictions" required="true"
revision="">
 <HSInteger name="restrictByValue" required="true" restrictType="1"
xmlNodeType="1">
  <restrictedValue>10</restrictedValue>
  <restrictedValue>20</restrictedValue>
  <restrictedValue>30</restrictedValue>
  </HSInteger>
 <HSInteger name="restrictByRange" required="true" restrictType="3"
xmlNodeType="1">
  <restrictedValue />
  </HSInteger>
 <HSInteger name="restrictByPattern" required="true" restrictType="3"
xmlNodeType="1">
  <restrictedValue>$1234</restrictedValue>
  </HSInteger>
  </HSDataContainerType>
 <HSDataContainerType name="OtherRestrictions" required="true" revision="">
 <HSDate isCacheKey="false" name="dateHasAllRestrictions" required="true"
restrictType="2" xmlNodeType="1">
  <restrictedValue>Aug-05-2003</restrictedValue>
  <restrictedValue>Aug-27-2003</restrictedValue>
  </HSDate>
 <HSBoolean name="booleanHasValueRestrictionOnly" required="true"
restrictType="1" xmlNodeType="1">
  <DefaultValue>false</DefaultValue>
  <restrictedValue>true</restrictedValue>
  </HSBoolean>
 <HSBoolean name="trueFalseField_1" restrictType="1" xmlNodeType="1">
  <DefaultValue>false</DefaultValue>
  <restrictedValue>false</restrictedValue>
  </HSBoolean>
  </HSDataContainerType>
 <HSDataContainerType name="BinaryRestrictions" required="true" revision="">
 <HSBinary binaryEncoding="0" name="base64Encoding" required="true"
xmlNodeType="1">
  <DefaultValue />
  </HSBinary>
 <HSBinary binaryEncoding="1" name="hexEncoding" required="true"
xmlNodeType="1">
  <DefaultValue />
  </HSBinary>
  </HSDataContainerType>
  </HSDataContainerType>
 <HSDataContainerType name="Settings" required="true" revision=""
systype="true">
 <HSString name="HSUserId" systype="true" xmlNodeType="1">
  <DefaultValue />
  </HSString>
  <HSDataContainerType name="ServiceParameters" optionalOrigin="true"
revision="" systype="true" />
 <HSString name="HSLibName" systype="true" xmlNodeType="1">
  <DefaultValue />
  </HSString>
 <HSBoolean name="batchStopOnError" systype="true" xmlNodeType="1">
  <DefaultValue>true</DefaultValue>
  </HSBoolean>
 <HSDouble name="cost" systype="true" xmlNodeType="1">
  <DefaultValue>0.0</DefaultValue>
  </HSDouble>
 <HSInteger name="timeout" systype="true" xmlNodeType="1">
  <DefaultValue>0</DefaultValue>
  </HSInteger>
 <HSString name="locale" systype="true" xmlNodeType="1">
  <DefaultValue />
  </HSString>
 <HSString name="languageCode" systype="true" xmlNodeType="1">
  <DefaultValue />
  </HSString>
 <HSDataContainerType name="LibURIs" optionalOrigin="true" revision=""
systype="true">
 <HSString name="location" required="true" systype="true" xmlNodeType="1">
  <DefaultValue />
  </HSString>
 <HSBoolean name="enableAlternateLocations" required="true" systype="true"
xmlNodeType="1">
  <DefaultValue>false</DefaultValue>
  </HSBoolean>
  </HSDataContainerType>
  </HSDataContainerType>
 <HSDocumentation>
 <shortDescription>
 <![CDATA[ This is an example of a complex set of inputs.
  ]]>
  </shortDescription>
 <descriptionSection title="myWebserviceDesc">
 <![CDATA[ My way or the highway. My way or the highway. My way or the
highway. My way or the highway. My way or the highway. My way or the
highway. My way or the highway.
  ]]>
  </descriptionSection>
  <returnCodeDescription code="" />
  </HSDocumentation>
  </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>
        <!--<p><a href="#desc"><b>Contract Name: </b><xsl:value-of
select="@contractName"/><br /></a>-->
                <p><b>Contract Name: </b><xsl:value-of 
select="@contractName"/><br />
                <b>ID: </b><xsl:value-of select="@id"/><br />
                <b>Start Date: </b><xsl:value-of select="@startDate"/><br /></p>
                <!-- <xsl:apply-templates select="*"/> -->
                <xsl:apply-templates select="HSDataContainerType"/>
                <xsl:apply-templates select="HSDocumentation"/>
                <xsl:apply-templates select="//HSString" mode="target" />
                <xsl:apply-templates select="//HSDouble" mode="target" />
                <xsl:apply-templates select="//HSInteger" mode="target" />
                <xsl:apply-templates select="//HSBinary" mode="target" />
                <xsl:apply-templates select="//HSBoolean" mode="target" />
                <xsl:apply-templates select="//HSDate" mode="target" />
                <!-- <xsl:apply-templates select="imagePath" /> -->
      </body>
    </html>
  </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="*">
        <div><xsl:apply-templates select="HSLinkString" /></div>
        <div><xsl:apply-templates select="HSLinkDouble"/></div>
        <div><xsl:apply-templates select="HSLinkInteger"/></div>
        <div><xsl:apply-templates select="HSLinkDate"/></div>
        <div><xsl:apply-templates select="HSLinkBinary"/></div>
        <div><xsl:apply-templates select="HSLinkBoolean"/></div>
  </xsl:template>

  <!-- ******************************************************** -->

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

  <xsl:template name="HSLinkerString" match="HSString" mode="target">
                <!--<b>Input Description:</b><br /><br/>-->
                <a name="{generate-id(.)}">
                Name: <xsl:value-of select="@name" /><br />
                Required: <xsl:value-of select="@required" /></a><br /><br />
     </xsl:template>

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

  <xsl:template name="HSLinkerDouble" match="HSDouble" mode="target">
                <!--<b>Input Description:</b><br /><br/>-->
                <a name="{generate-id(.)}">
                Name: <xsl:value-of select="@name" /><br />
                Required: <xsl:value-of select="@required" /></a><br /><br />
     </xsl:template>

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

  <xsl:template name="HSLinkerInteger" match="HSInteger" mode="target">
                <!--<b>Input Description:</b><br /><br/>-->
                <a name="{generate-id(.)}">
                Name: <xsl:value-of select="@name" /><br />
                Required: <xsl:value-of select="@required" /></a><br /><br />
     </xsl:template>

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

  <xsl:template name="HSLinkerBinary" match="HSBinary" mode="target">
                <!--<b>Input Description:</b><br /><br/>-->
                <a name="{generate-id(.)}">
                Name: <xsl:value-of select="@name" /><br />
                Required: <xsl:value-of select="@required" /></a><br /><br />
     </xsl:template>

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

  <xsl:template name="HSLinkerDate" match="HSDate" mode="target">
                <!--<b>Input Description:</b><br /><br/>-->
                <a name="{generate-id(.)}">
                Name: <xsl:value-of select="@name" /><br />
                Required: <xsl:value-of select="@required" /></a><br /><br />
     </xsl:template>

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

  <xsl:template name="HSLinkerBoolean" match="HSBoolean" mode="target">
                <!--<b>Input Description:</b><br /><br/>-->
                <a name="{generate-id(.)}">
                Name: <xsl:value-of select="@name" /><br />
                Required: <xsl:value-of select="@required" /></a><br /><br />
     </xsl:template>

  <!-- ******************************************************** -->

  <xsl:template name="HSDoc" match="HSDocumentation">
        <!--<p><a name="desc"><b>Short Description:</b><br /><br /></a>-->
        <p><b>Short Description:</b><br /><br />
        <xsl:apply-templates select="shortDescription" /><br /><br />
        <b>Long Description:</b><br /><br />
        <xsl:apply-templates select="descriptionSection" /></p>
  </xsl:template>

  <xsl:template name="shortDescription" match="//shortDescription">
        <xsl:value-of select="text()"/>
  </xsl:template>

  <xsl:template name= "descriptionSection" match="//descriptionSection">
        <xsl:value-of select="text()"/><br /><br /><p><b>Input 
Description</b></p>
  </xsl:template>

</xsl:stylesheet>


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



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