I'm going to rephrase my earlier question and hopefully make it more clear.
Now, the value of target attribute is being returned in the results as “target=”_self”. The problem is that all records have that attribute value in the link. The records containing “sirepub” in DOCUMENT_URL should have a target value of “_blank”. I assume that the “when” part of the conditional choose test is not being understood and therefore defaulting to the value of “otherwise”.
So it seems my problem is with <xsl:when test="$meta=$document_url and contains(/@V, 'sirepub')">.
Here's the code:
<xsl:template name="drawcell">
<xsl
aram name="meta"/>
<xsl
aram name="linkfield"/>
<xsl
aram name="document_url"/>
<td valign="top">
<xsl:if test="$linkfield=$meta">
<a>
<xsl:attribute name="href">
<xsl:value-of select="MT[@N='DOCUMENT_URL']/@V"/>
</xsl:attribute>
<xsl:attribute name="target">
<xsl:choose>
<xsl:when test="$meta=$document_url and contains(/@V, 'sirepub')">
<xsl:value-of select="’_blank’" />
</xsl:when>
<xsl
therwise>
<xsl:value-of select="’_self’"/>
</xsl
therwise>
</xsl:choose>
</xsl:attribute>
</a>
</xsl:if>
</td>
</xsl:template>
Here's some sample xml.
<R N="6" MIME="application/pdf"> <U> <UE> <UD> <T>CITY OF SAN DIEGO COUNCIL DOCKET</T>
<RK>5</RK>
<CRAWLDATE>24 Jul 2008</CRAWLDATE>
<FS NAME="date" VALUE="2008-07-02" />
<MT N="DOC_DATE" V="2008-08-02" />
<MT N="DOCUMENT_URL" V=" />
<MT N="SORTORDER" V="1" />
<MT N="TITLE" V="Combined Monday Tuesday Docket" />
<S>Page 1. bla bla bla <b>...</b></S>
<LANG>en</LANG>
- <HAS>
<L />
<C SZ="" CID="1tDLa3mftjoJ" ENC="UTF-8" />
</HAS>
</R>
- <R N="7" MIME="application/pdf">
<U> <UE> <UD> <T>AGENDA FOR THE</T>
<RK>9</RK>
<CRAWLDATE>24 Jul 2008</CRAWLDATE>
<FS NAME="date" VALUE="2008-06-28" />
<MT N="DOC_DATE" V="2008-07-29" />
<MT N="DOCUMENT_URL" V=" />
<MT N="SORTORDER" V="1" />
<MT N="TITLE" V="Council Meeting Docket" />
<S>Page 1. AGENDA FOR THE REGULAR COUNCIL MEETING OF TUESDAY, JULY 29, 2008,<br> AT 10:00 AM CITY ADMINISTRATION BUILDING COUNCIL CHAMBERS <b>...</b></S>
<LANG>en</LANG>
- <HAS>
<L />
<C SZ="" CID="vka_CEfPf4IJ" ENC="UTF-8" />
</HAS>
</R>
Now, the value of target attribute is being returned in the results as “target=”_self”. The problem is that all records have that attribute value in the link. The records containing “sirepub” in DOCUMENT_URL should have a target value of “_blank”. I assume that the “when” part of the conditional choose test is not being understood and therefore defaulting to the value of “otherwise”.
So it seems my problem is with <xsl:when test="$meta=$document_url and contains(/@V, 'sirepub')">.
Here's the code:
<xsl:template name="drawcell">
<xsl
<xsl
<xsl
<td valign="top">
<xsl:if test="$linkfield=$meta">
<a>
<xsl:attribute name="href">
<xsl:value-of select="MT[@N='DOCUMENT_URL']/@V"/>
</xsl:attribute>
<xsl:attribute name="target">
<xsl:choose>
<xsl:when test="$meta=$document_url and contains(/@V, 'sirepub')">
<xsl:value-of select="’_blank’" />
</xsl:when>
<xsl
<xsl:value-of select="’_self’"/>
</xsl
</xsl:choose>
</xsl:attribute>
</a>
</xsl:if>
</td>
</xsl:template>
Here's some sample xml.
<R N="6" MIME="application/pdf"> <U> <UE> <UD> <T>CITY OF SAN DIEGO COUNCIL DOCKET</T>
<RK>5</RK>
<CRAWLDATE>24 Jul 2008</CRAWLDATE>
<FS NAME="date" VALUE="2008-07-02" />
<MT N="DOC_DATE" V="2008-08-02" />
<MT N="DOCUMENT_URL" V=" />
<MT N="SORTORDER" V="1" />
<MT N="TITLE" V="Combined Monday Tuesday Docket" />
<S>Page 1. bla bla bla <b>...</b></S>
<LANG>en</LANG>
- <HAS>
<L />
<C SZ="" CID="1tDLa3mftjoJ" ENC="UTF-8" />
</HAS>
</R>
- <R N="7" MIME="application/pdf">
<U> <UE> <UD> <T>AGENDA FOR THE</T>
<RK>9</RK>
<CRAWLDATE>24 Jul 2008</CRAWLDATE>
<FS NAME="date" VALUE="2008-06-28" />
<MT N="DOC_DATE" V="2008-07-29" />
<MT N="DOCUMENT_URL" V=" />
<MT N="SORTORDER" V="1" />
<MT N="TITLE" V="Council Meeting Docket" />
<S>Page 1. AGENDA FOR THE REGULAR COUNCIL MEETING OF TUESDAY, JULY 29, 2008,<br> AT 10:00 AM CITY ADMINISTRATION BUILDING COUNCIL CHAMBERS <b>...</b></S>
<LANG>en</LANG>
- <HAS>
<L />
<C SZ="" CID="vka_CEfPf4IJ" ENC="UTF-8" />
</HAS>
</R>