Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XSLT / choose / string-length issue 1

Status
Not open for further replies.

ddrillich

Technical User
Jun 11, 2003
546
0
0
US
Good Day,

I have the following XSLT code -

Code:
<xsl:variable name="database"     select="autn:content/DOCUMENT/DREDJDBNAME"/>
<xsl:variable name="autnsummary"  select="autn:summary"/>
<xsl:variable name="summaryr"     select="autn:content/DOCUMENT/SUMMARY_R"/>

     <xsl:choose>

         <xsl:when test="$database = 'sitesearch' or contains($database,'podcast') or contains($database,'video') or contains($database,'pdf') or string-length($autnsummary) < 1 ">
               <context-summary><xsl:value-of select="$summaryr" /></context-summary>
         </xsl:when>
         <xsl:otherwise>
               <context-summary><xsl:value-of select="autn:summary" /></context-summary>
         </xsl:otherwise>


     </xsl:choose>

The following part -

Code:
string-length($autnsummary) < 1
seems to break it.

Any suggestions?

Regards,
Dan


 
>string-length($autnsummary) < 1
[tt]string-length($autnsummary) [red]&lt;[/red] 1 [/tt]
 
Good Day,

I have another issue, which is very similar. The following breaks as well b/c of the two lower than signs -

Code:
  <image alternate-text="Google's Eric Schmidt to Leave Apple's Board" src-id="OB-EE247_schmid_A_20090803085438.jpg" width='<xsl:value-of select="$width"/>'  height="76"/>

Substituting the first one with &lt; seems to produce text.

Any ideas?

Regards,
Dan
 
You can do it in-line with attribute-value-template (avt), otherwise expand the constructor containing xsl:attribute element.
><image alternate-text="Google's Eric Schmidt to Leave Apple's Board" src-id="OB-EE247_schmid_A_20090803085438.jpg" width='<xsl:value-of select="$width"/>' height="76"/>
[tt]<image alternate-text="Google's Eric Schmidt to Leave Apple's Board" src-id="OB-EE247_schmid_A_20090803085438.jpg" [red]width="{$width}"[/red] height="76"/>[/tt]
 
tsuji absolutely loves to teach about attribute value template! [wink]

Tom Morrison
 
Beep... somebody peeps at this moment.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top