Scenario where the problem occurs:
This error occurs when calling the Ctrip buy interface to deserialize the obtained XML string into the entity object.
Details:
There is such a statement in the XML document "
<description category= "1" title= "description" >
<content title= "description" >
<Text>
Exclusive <b> Hangzhou Zhongshan International Hotel Superior Room </b>1 Night + Free breakfast 2 parts + Free wifi+ more benefits! Hotel is located in the bustling Lakeside shopping district, adjacent to the subway line Line 1 long Xiang Station D exit, walk to the West Lake just 10 minutes, surrounded by shops, traffic is very convenient!
</Text>
</Content>
</Description>
”
Cause of Error:
Because the <Text></Text> tag has a <b></b> tag. <b></b> is not actually an XML node. There are no corresponding fields and attributes in the entity.
Workaround:
Remove the <b></b> tag from this sentence.
Principle Analysis:
The XML contains illegal characters or HTML tags. Workaround please refer to my XML for illegal characters translated into entities article.
Unexpected node type Element. The Readelementstring method can only be called on simple content or on empty content