I'm trying to use the Read XML activity to parse the following XML:
<Report Entity="Thing 1 & Thing 2" Name="Event Code Report">
<Parameters>
<Parameter Name="StartDate" Value="5/1/2012" />
<Parameter Name="EndDate" Value="5/31/2012" />
<Parameter Name="Fund" Value="[null]" />
<Parameter Name="ReportList" Value="Thing 1 & Thing 2" />
<Parameter Name="EventCode" Value="ISSUED" />
</Parameters>
</Report>
I create XPath Expression tokens, like //Parameter[@Name='ReportList']/@Value, but it doesn't like the ampersand and gives a warning of:
The value of the XML Source property is invalid. An error occurred while parsing EntityName. Line 8, position 53.
I tried adding the Encode XML function to the XML Source for the activity, and that gives a different error:
The value of the XML Source property is invalid. Data at the root level is invalid. Line 1, position 1.
Other xml files that I parse, not containing an ampersand, create the tokens properly and without error.
Is there a way I can handle this poorly formatted XML documents and extract the value successfully?