Click here to Skip to main content
15,885,546 members
Articles / Programming Languages / C#

Power of Dynamic: Reading XML and CSV files made easy using DynamicObject in C#

Rate me:
Please Sign up or sign in to vote.
5.00/5 (12 votes)
10 Aug 2012CPOL8 min read 61.8K   2.2K   28  
DynamicObject wrapper for XML and CSV reading
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
  <xsl:output method="xml" indent="no" encoding="UTF-8"/>
  
  <xsl:template match="/|comment()|processing-instruction()">
    <xsl:copy>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:template>

  <xsl:template match="*">
    <xsl:element name="{local-name()}">
      <xsl:apply-templates select="@*|node()"/>
    </xsl:element>
  </xsl:template>

  <xsl:template match="@*">
    <xsl:attribute name="{local-name()}">
      <xsl:value-of select="."/>
    </xsl:attribute>
  </xsl:template>
  
</xsl:stylesheet>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
India India
Started my software development career in December 2007. Having 4+ years of experience in C#. More interested to learn deeper and share on Design Pattern, Parallel and Dynamic programming.
Started my career as PERL developer for few months and then moved to VC++ and then to C#. When i moved from Procedure oriented programming to Object oriented programming, i really enjoyed and appreciated the OOPS concepts.
Explored most of the language features of C# 3.5 and 4.0. In my current assignments, working on Biz Talk and WCF.

Comments and Discussions