This is a migrated thread and some comments may be shown as answers.

RadGrid shows no data for XML

1 Answer 69 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chris LaFrancis
Top achievements
Rank 1
Chris LaFrancis asked on 03 May 2010, 01:47 PM
I am using an XMLDataSource with RadGrid. When the grid loads it shows no data. I have an XML and an XSLT file and in Visual Studio when I choose the Show XSLT Output from the XML menu it shows correctly. Can someone take a look and see if I have something wrong or why Radgrid doesn't like the XML?
Here is my XML file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>  
<ns2:StorageVolume xmlns:ns2="http://www.nng.com/alertportal/processed/">  
  <companyNumber>179</companyNumber> 
  <gasDay>2009-12-18T00:00:00-06:00</gasDay> 
  <iddInjectionQuantity>739001</iddInjectionQuantity> 
  <nonPDDLPInjectionQuantity>185486</nonPDDLPInjectionQuantity> 
</ns2:StorageVolume> 
Here is my XSLT file:
<?xml version="1.0" encoding="UTF-8"?>  
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  version="1.0" 
  xmlns:ns2="http://www.nng.com/alertportal/processed/" 
  xmlns:xalan="http://xml.apache.org/xslt">  
 <xsl:output method="xml" indent="yes"/>  
 
 <xsl:template match="ns2:StorageVolume">  
  <ns2:StorageVolume> 
   <xsl:attribute name="companyNumber">  
    <xsl:value-of select="companyNumber" /> 
   </xsl:attribute> 
   <xsl:attribute name="gasDay">  
    <xsl:call-template name="formatDate">  
     <xsl:with-param name="dateTime" select="gasDay" /> 
    </xsl:call-template> 
   </xsl:attribute> 
   <xsl:attribute name="iddInjectionQuantity">  
    <xsl:value-of select="iddInjectionQuantity" /> 
   </xsl:attribute> 
   <xsl:attribute name="nonPDDLPInjectionQuantity">  
    <xsl:value-of select="nonPDDLPInjectionQuantity" /> 
   </xsl:attribute> 
  </ns2:StorageVolume> 
 </xsl:template> 
 
 <xsl:template name="formatDate">  
  <xsl:param name="dateTime" /> 
  <xsl:variable name="date" select="substring-before($dateTime, 'T')" /> 
  <xsl:variable name="year" select="substring-before($date, '-')" /> 
  <xsl:variable name="month" select="substring-before(substring-after($date, '-'), '-')" /> 
  <xsl:variable name="day" select="substring-after(substring-after($date, '-'), '-')" /> 
  <xsl:value-of select="concat($month, '/', $day, '/', $year)" /> 
 </xsl:template> 
   
</xsl:stylesheet> 
Thank you for your help.

1 Answer, 1 is accepted

Sort by
0
Chris LaFrancis
Top achievements
Rank 1
answered on 03 May 2010, 05:43 PM
Never mnd, got it figured out. I added <main></main> tags after the <ns2:StorageVolume> tag and that took care of it.
Tags
Grid
Asked by
Chris LaFrancis
Top achievements
Rank 1
Answers by
Chris LaFrancis
Top achievements
Rank 1
Share this question
or