xsl-list
[Top] [All Lists]

FW: XML/XSL output

2002-09-10 14:07:59

 Hi,

 I have xml element as follows :
 
- <metadata>
  <URL>www.yahoo.com</URL> 
  <DocTitle>June, July and August 2002 EDI Updates</DocTitle> 
  <DocType>ImportantUpdates</DocType> 
  <SecurityGroup>Public</SecurityGroup> 
  <ReleaseDate>8/28/2002 11:29 AM</ReleaseDate> 
  <Site>Extranet, Intranet</Site> 
  </metadata>

- <metadata>
  <URL>www.hotmail.com</URL> 
  <DocTitle>June, July and August 2002 EDI Updates</DocTitle> 
  <DocType>ImportantUpdates</DocType> 
  <SecurityGroup>Public</SecurityGroup> 
  <ReleaseDate>8/28/2002 11:28 AM</ReleaseDate> 
  <Company>Sun</Company> 
  <Site>Extranet, Intranet</Site> 
  </metadata>

  There are two main elements I am looking for 1) Account 2) Company. 
  Account element may or may not exists. 
  Company element may or may not exists.
  I am trying to write xsl style sheet to get html output depending upon
above conditions. 
  
            <xsl:when test="Account[.=''] and Company[.='']">
            <tr>              
              <td>
                <a>
                  <xsl:attribute name="href"><xsl:value-of
select="URL"/></xsl:attribute>
                  <xsl:value-of select="DocTitle"/>
                </a>
              </td>
              <td><xsl:value-of select="substring-before(ReleaseDate, '
')"/></td>
            </tr>
            <tr><td><br></br></td></tr>
          </xsl:when>

  if both Account and Company elements are missing then url(www.yahoo.com)
should be displayed on the html output. The xsl code is not working and
doesn't display any link on page. 

  Does xsl has any function that will check for element existence? OR
  How can we check for null object in xsl?  The above condition is checking
for blank value.

  Anybody has idea about this problem?

  Thanks in advance.

  



  

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



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