Tell us the parse error you are getting with XmlDocument
On Friday, March 4, 2016 at 3:12:43 PM UTC-5, Big Daddy Leon wrote:
>
> I'm using the .NET Client Library. AdWords API allows downloading report
> data in a number of formats. I am using the XML format as illustrated in
> the sample code:
>
> ReportDefinition definition = new ReportDefinition()
> {
> reportName = "GENDER_PERFORMANCE_REPORT",
> reportType =
> ReportDefinitionReportType.GENDER_PERFORMANCE_REPORT,
> downloadFormat = DownloadFormat.XML,
> ....
>
> The XML document that is created is of this format:
>
>
> <?xml version="1.0" encoding="UTF-8" standalone="true"?>
> -<report>
>
> <report-name name="GENDER_PERFORMANCE_REPORT"/>
>
> <date-range date="Feb 24, 2016"/>
> -<table>
> -<columns>
> <column name="currency" display="Currency"/>
> <column name="account" display="Account"/>
> <column name="timeZone" display="Time zone"/>
> ....
> 100 more columns
> ....
> <column name="viewThroughConv" display="View-through conv."/>
> <column name="week" display="Week"/>
> <column name="year" display="Year"/>
> </columns>
>
> <row year="2016" week="2016-02-22" viewThroughConv="0" views="0"
> ............ currency="USD"/>
> <row year="2016" week="2016-02-22" viewThroughConv="0" views="0"
> ............ currency="USD"/>
> <row year="2016" week="2016-02-22" viewThroughConv="0" views="0"
> ............ currency="USD"/>
> <row year="2016" week="2016-02-22" viewThroughConv="0" views="0"
> ............ currency="USD"/>
> <row year="2016" week="2016-02-22" viewThroughConv="0" views="0"
> ............ currency="USD"/>
> etc.
> </table>
> </report>
>
> Why is the data in this format? I can't seem to process this using .NET
> approaches such as XmlDocument(). I tried a couple of XML parsers that
> complain that the format above is invalid. I'm thrown off by this format,
> i.e. inclusion of a node for column names. I'm wondering why the data isn't
> in the standard format such as this:
> <rows>
> <row>
> <year>2016</year>
> <week>2016-02-22</week>
> ...
> </row>
> <row>
> <year>2016</year>
> <week>2016-02-22</week>
> ...
> </row>
> etc
> </rows>
>
> How do you suggest parsing this - I basically want to shred the data to a
> SQL Server table. The approach I've used in the past doesn't work with your
> report structure.
> Thanks
>
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/dd41665f-613b-4fce-8280-bca5712d7dec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.