View Single Post
Old September 1st, 2006, 09:17 AM
NEO1976 NEO1976 is offline
Friend of Wrox
Join Date: May 2005
Location: Nürnberg/München, , Germany.
Posts: 140
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to control optional elements and attributes

Dear all,

Sorry that I am asking many questions today but unfortunately I have another problem.

I am having two optional attributes and they are giving me source and image link of the external icons. I am gonna write down the XSL again but if you want to see the XML file it is the same XML at the loop in XSL topic

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="2.0" xmlns:SOAP-ENV="" xmlns:xsl="" xmlns:fcs="urn:factiva:developer:v3_0:parsers" xmlns:msxsl="urn:schemas-microsoft-com:xslt" >
<xsl:output method="html" version="4.0" />
<xsl:template match ="/">
<xsl:apply-templates select="SOAP-ENV:Envelope/SOAP-ENV:Body/fcs:GetArticleResponse/fcs:articleResponse/fcs:articleResultSet/fcs:article"></xsl:apply-templates>
<xsl:template match="SOAP-ENV:Envelope/SOAP-ENV:Body/fcs:GetArticleResponse/fcs:articleResponse/fcs:articleResultSet/fcs:article">
            <title>Factiva Test</title>
            <link href='' rel="stylesheet" type="text/css" />
            <link href='' rel="stylesheet" type="text/css" />
        <div id="epoContentStandard">
        <img src="" align="right" />
        <br clear="all"/>
     <xsl:if test="fcs:logo/@source != ''">
        <xsl:variable name="logosource" select="fcs:logo/@source"/>
        <xsl:variable name="logoimage" select="fcs:logo/@image"/>
        <xsl:variable name="logo" select="'fcs:logo/@source'+'/'+'$logoimage'"/>
        <img src= "$logo"/>
         <h1 style="margin-bottom:0.3ex;"><xsl:value-of select="fcs:headline/fcs:paragraph"/></h1>
        <p style="margin-bottom:3.5ex;font-size:80%;color:#888888;"><xsl:value-of select="fcs:copyright"/></p>
    <xsl:apply-templates select="//fcs:leadParagraph"/>
    <xsl:apply-templates select="//fcs:tailParagraphs"/>
    <div id="epoFooter">
    <a href=''>Terms of use</a>&nbsp; &copy;200X Dow Jones Reuters Business Interactive LLC (trading as Factiva). All rights reserved.
<xsl:template match="fcs:leadParagraph">
     <xsl:apply-templates select="fcs:paragraph"/>
<xsl:template match="fcs:tailParagraphs">
     <xsl:apply-templates select="fcs:paragraph"/>

<xsl:template match="fcs:paragraph">
        <xsl:value-of select="."/>


1) What should I write in xsl:if statement
2) How can I add 2 variable with "/" to get a logo variable for img src?

Your attitude determines your altitude
Your attitude determines your altitude