extracting RDL data using LINQ
- by BobC
I'm working with some SQL Report definition files (RDLs), using LINQ to extract component query statements for validation. I'm trying to extract the <DataSet> elements from under the <DataSets> element. I seem to be getting hung up with one of the elements under <DataSet><Fields><Field> which has a namespace qualifier <rd:TypeName>
I've been using LINQ to XML for other parts of the files where there is no namespace qualifiers with no trouble, by specifying a default namespace. The RDL specifies two namespaces:
xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
When I try to get the <DataSets> element, however, I get the following error:
System.Xml.XmlException - The ':' character, hexadecimal value 0x3A, cannot be included in a name.
I know it has to do with the namespace qualifier (rd:) in one of the child elements, but I'm having difficulty getting a LINQ expression that works. Any help would be appreciated. Thanks!