title: Pass List of Objects in XSLT Argument List and Access it in xsl in C#
body: <p>I 've a class which i use in XSL </p>
  
  <pre><code>public class PurchaseOrderDTO
  {
      public IList&lt;PurchaseOrderDetailsDTO&gt; PurchaseOrderDetailsDTOList { get; set; }
      public String PONo { get; set; }
      public Decimal POValue { get; set; }
      public DateTime? PODate { get; set; }
  }
  </code></pre>
  
  <p>Following is the xsl i use
      </p>
  
  <p></p>
  
  <pre><code>&lt;P&gt;
    Dear,
  &lt;/P&gt;
  Purchase Order No &lt;xsl:value-of select="PurchaseOrderDTO:get_PONo()" /&gt; has
  being created &lt;BR /&gt;
  Purchase Order Value &lt;xsl:value-of select="PurchaseOrderDTO:get_POValue()" /&gt; &lt;BR /&gt;
  &lt;BR /&gt;
  Purchase Order Date &lt;xsl:value-of select="PurchaseOrderDTO:get_PODate()" /&gt; &lt;BR /&gt;
  &lt;BR /&gt;
  
  &lt;xsl:for-each select="PurchaseOrderDTO:get_PurchaseOrderDetailsDTOList()"&gt;
    &lt;ul&gt;
      &lt;li&gt;
        &lt;p&gt;      
          Item name
        &lt;/p&gt;
        &lt;xsl:value-of select="PurchaseOrderDetailsDTO:get_Item()"&gt;&lt;/xsl:value-of&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/xsl:for-each&gt;
  </code></pre>
  
  <p></p>
  
  <p></p>
  
  <pre><code>  private static PurchaseOrderDTO GetPurchaseOrderDTO()
      {
          PurchaseOrderDTO _PurchaseOrderDTO = new PurchaseOrderDTO();
          Random rand = new Random();
  
          _PurchaseOrderDTO.PODate = DateTime.Now;
          _PurchaseOrderDTO.PONo = "PO3333";
          _PurchaseOrderDTO.POValue = rand.Next(40200, 960000);
  
          IList&lt;PurchaseOrderDetailsDTO&gt; _PurchaseOrderDetailsDTOList = new List&lt;PurchaseOrderDetailsDTO&gt;();
  
          for (int i = 1; i &lt; 3; i++)
          {
              PurchaseOrderDetailsDTO _PurchaseOrderDetailsDTO = new PurchaseOrderDetailsDTO();
              _PurchaseOrderDetailsDTO.ID = (Int16)i;
              _PurchaseOrderDetailsDTO.Item = "Item" + i;
              _PurchaseOrderDetailsDTO.Value = Convert.ToDecimal(rand.Next(100, 500) * i);
              _PurchaseOrderDetailsDTOList.Add(_PurchaseOrderDetailsDTO);
          }
  
          _PurchaseOrderDTO.PurchaseOrderDetailsDTOList = _PurchaseOrderDetailsDTOList;
  
          return _PurchaseOrderDTO;
  
  
      }
  
      private static void GetEmailTemplate()
      {
          PurchaseOrderDTO _PurchaseOrderDTO = GetPurchaseOrderDTO();
  
          XslTransform _XslTransform = new XslTransform();
          _XslTransform.Load("../../Transformer.xslt");
  
          XmlDocument _XmlDocument = new XmlDocument();
          _XmlDocument.AppendChild(_XmlDocument.CreateElement("Root"));
  
          XPathNavigator _XPathNavigator = _XmlDocument.CreateNavigator();
  
          XsltArgumentList _XsltArgumentList = new XsltArgumentList();
  
  
          Hashtable _Hashtable = new Hashtable();
          _Hashtable["PurchaseOrderDTO"] = _PurchaseOrderDTO;
  
          if (_Hashtable != null)
          {
              foreach (DictionaryEntry entry in _Hashtable)
              {
                  _XsltArgumentList.AddExtensionObject(entry.Key.ToString(), entry.Value);
              }
          }
  
          StringBuilder _sb = new StringBuilder();
          XmlTextWriter _XmlTextWriter = new XmlTextWriter(new StringWriter(_sb));
  
          _XslTransform.Transform(_XPathNavigator, _XsltArgumentList, _XmlTextWriter);
  
          Console.WriteLine(_sb.ToString());
  
  
  
      }
  </code></pre>
  
  <p>But in ouput i m not getting child properties values.Is it possible to access list item values in XsltArgumentList?</p>