1

I created XML dynamically using C# with following data

XML

<employees>
<emp>
    <id>123</id>
    <name>Raja</name>
</emp>
<emp>
    <id>124</id>
    <name>Kumar</name>
    <manager>123</manager>
</emp>
<emp>
    <id>125</id>
    <name>Mani</name>
    <manager>123</manager>
</emp>
.
.
.
</employees>

I created XSLT stylesheet for this XML to convert HTML. In this XML, first <emp> element doesn't have <manager> element and subsequent <emp> element have.

How can I find whether <manager> element available or not in XSLT?

Jesuraja
  • 3,774
  • 4
  • 24
  • 48
  • Actually I am new to XSLT. I am not familiar with XSLT, XPath.... – Jesuraja Jun 16 '14 at 08:50
  • If you want to select **emp** nodes with a **manager**, the expression you probably want is `"emp[manager]"` (assuming you are positioned on the **employees** element). If you can't get this to work, you may be able to get the question re-opened if you post the XSLT you have tried so far, and the actual output you expect. Thank you! – Tim C Jun 16 '14 at 09:12
  • 1
    I referred the link `xpath find if node exists` and got the answer. Thanks ! – Jesuraja Jun 16 '14 at 10:37

0 Answers0