Posts

Showing posts from June, 2010

Using Linq To XML to Parse XML with Multiple Namespaces

I am working on a SQL Server Reporting Services 2008 project. I decided to write a tool in C# that will document the reports that I have created. What should make this easy is that the structure of the RDL (report) file is XML, which makes it a perfect candidate for using LINQ to XML to dig through its information. Here’s the top of the RDL file I’m trying to process (C:\MyReport.RDL): <? xml version="1.0" encoding="utf-8" ?> < Report xmlns : rd = "http://schemas.microsoft.com/SQLServer/reporting/reportdesigner" xmlns = "http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition" > < DataSources > < DataSource Name = "SalesDM" > < DataSourceReference > SalesDM </ DataSourceReference > < rd : DataSourceID > 60c7781c-ab9c-4c5f-b779-24afa5d5bac3 </ rd : DataSourceID > < rd : SecurityType > None </ rd : SecurityType > </ Data