0

THIS IS MY xsl after Title I need to display VacancyID from below xml can you any help me how to get this value

unable to access atom-field in xsl need help to fix this

<?xml version="1.0" encoding="utf-8"?>
    <rss xmlns:a10="http://www.w3.org/2005/Atom" version="2.0">
       <channel>
           <title>abc</title>
           <link>https://google.com</link>
           <description>test</description>
           <item>
               <link>https://google.com</link>
               <title>abc</title>
               <a10:updated>2016-06-22T10:44:49Z</a10:updated>
               <a10:content type="text/xml">
                   <Vacancy>
                       <VacancyID>123</VacancyID>                
                   </Vacancy>
               </a10:content>
            </item>
       </channel>
    </rss>


    xsl:

    THIS IS MY xsl  after Title i need to display VacancyID from ablove xml can you any help me how to get this valu

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:atom="http://www.w3.org/2005/Atom">   
      <xsl:output omit-xml-declaration="yes" indent="no"/>
      <xsl:template match="/">
        <div id="press-release">
            <xsl:apply-templates select="rss/channel/item"/>
        </div> 
      </xsl:template>

      <xsl:template match="item">
        <div class="press-item">
          <a href="{./link}" target="_blank" class="title" title="{./title}">
            <xsl:value-of select="./title" disable-output-escaping="yes" />     
            vacancyID????????????(need heleher)
          </a>
          <xsl:template match="atom:content">
0

1 Answer 1

1

From within your template matching item, you can use:

<xsl:value-of select="atom:content/Vacancy/VacancyID"  />

to get the value of VacancyID.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.