xsl-list
[Top] [All Lists]

Inline Hyperlink

2003-04-26 09:24:47
Just when I am beginning to have a comfort level in xml/xslt, another issue
appears. My inline hyperlink code is returning the following text in my
browser, instead of an active link:

<a href="http://enw-ltd.com";  target="" title="Co. home page"> </a>

The schema declaration is:

   <xs:complexType name="TextHyperLinkType">
      <xs:sequence>
         <xs:element ref="hlAddress"/>
         <xs:element ref="hlTitle"/>
         <xs:element ref="hlMode" minOccurs="0"/>
         <xs:element name="thlHotText" type="xs:string">
         </xs:element>
      </xs:sequence>
   </xs:complexType>
   <xs:element name="hlMode">
      <xs:simpleType>
         <xs:restriction base="xs:string">
            <xs:enumeration value="_Self"/>
            <xs:enumeration value="_Blank"/>
         </xs:restriction>
      </xs:simpleType>
   </xs:element>
   <xs:element name="hlAddress" type="xs:string">
   <xs:element name="hlTitle" type="xs:string">
      <xs:annotation>
         <xs:documentation>Appears as hint on mouse over</xs:documentation>
      </xs:annotation>
   </xs:element>

The xslt formatting is:

    <xsl:template match="n1:TextHyperLink">
        &lt;a href=<xsl:for-each select="n1:hlAddress">
            <span style="color:#990000; text-decoration:underline; ">
                <xsl:apply-templates />
            </span></xsl:for-each>&#160;
        target=&quot;<xsl:for-each select="n1:hlMode">
            <xsl:apply-templates />
        </xsl:for-each>&quot;
        title=&quot;<xsl:for-each select="n1:hlTitle">
            <xsl:apply-templates />
        </xsl:for-each>&quot;&gt;
        <!--xsl:for-each select="n1:thlHotText"/></xsl:for-each-->
        &lt;/a&gt;
    </xsl:template>

My xml page has the following:

         <TextHyperLink>
            <hlAddress>"http://enw-ltd.com";</hlAddress>
                <hlTitle>Co. home page</hlTitle>
                <thlHotText>performance</thlHotText>
                xlink:type="simple"
                xlink:href="http://enw-ltd.com";
         </TextHyperLink>

tks,

jwc



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



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