xmlexception

What does the org.apache.xmlbeans.XmlException with a message of “Unexpected element: CDATA” mean?

泪湿孤枕 提交于 2020-01-02 10:17:26
问题 I'm trying to parse and load an XML document, however I'm getting this exception when I call the parse method on the class that extends XmlObject. Unfortunately, it gives me no ideas of what element is unexpected, which is my problem. I am not able to share the code for this, but I can try to provide more information if necessary. 回答1: Not being able to share code or input data, you may consider the following approach. That's a very common dichotomic approach to diagnostic , I'm afraid, and

What does the org.apache.xmlbeans.XmlException with a message of “Unexpected element: CDATA” mean?

天涯浪子 提交于 2020-01-02 10:17:20
问题 I'm trying to parse and load an XML document, however I'm getting this exception when I call the parse method on the class that extends XmlObject. Unfortunately, it gives me no ideas of what element is unexpected, which is my problem. I am not able to share the code for this, but I can try to provide more information if necessary. 回答1: Not being able to share code or input data, you may consider the following approach. That's a very common dichotomic approach to diagnostic , I'm afraid, and

XmlReader ReadStartElement causes XmlException

冷暖自知 提交于 2019-12-10 13:35:53
问题 I'm writing a file reader using the XmlReader in a Silverlight project. However, I'm getting some errors (specifically around the XmlReader.ReadStartElement method) and it's causing me to believe that I've misunderstood how to use it somewhere along the way. Basically, here is a sample of the format of the Xml I am using: <?xml version="1.0" encoding="utf-8" standalone="no"?> <root> <EmptyElement /> <NonEmptyElement Name="NonEmptyElement"> <SubElement Name="SubElement" /> </NonEmptyElement> <

XmlException while deserializing xml file in UTF-16 encoding format

狂风中的少年 提交于 2019-12-06 03:02:47
问题 Using C#'s XmlSerializer. In process of deserializing all xml files in a given folder, I see XmlException "There is an error in XML document (0, 0)". and InnerException is "There is no Unicode byte order mark. Cannot switch to Unicode". All the xmls in the directory are "UTF-16" encoded. Only difference being, some xml files have elements missing that are defined in the class whose object I am using while deserialization. For example, consider I have 3 different types of xmls in my folder:

Exceptions with DateTime parsing in RSS feed in C#

寵の児 提交于 2019-12-03 10:03:21
问题 I'm trying to parse Rss2, Atom feeds using SyndicationFeedFormatter and SyndicationFeed objects. But I'm getting XmlExceptions while parsing DateTime field like pubDate and/or lastBuildDate. Wed, 24 Feb 2010 18:56:04 GMT+00:00 does not work Wed, 24 Feb 2010 18:56:04 GMT works So, it's throwing due to the timezone field. As a workaround, for familiar feeds I would manually fix those DateTime nodes - by catching the XmlException, loading the Rss into an XmlDocument, fixing those nodes' value,

Exceptions with DateTime parsing in RSS feed in C#

依然范特西╮ 提交于 2019-12-03 00:33:16
I'm trying to parse Rss2, Atom feeds using SyndicationFeedFormatter and SyndicationFeed objects. But I'm getting XmlExceptions while parsing DateTime field like pubDate and/or lastBuildDate. Wed, 24 Feb 2010 18:56:04 GMT+00:00 does not work Wed, 24 Feb 2010 18:56:04 GMT works So, it's throwing due to the timezone field. As a workaround, for familiar feeds I would manually fix those DateTime nodes - by catching the XmlException, loading the Rss into an XmlDocument, fixing those nodes' value, creating a new XmlReader and then returning the formatter from this new XmlReader object (code not shown

XmlDocument.Load fails, LoadXml works:

江枫思渺然 提交于 2019-11-30 13:26:31
In answering this question , I came across a situation that I don't understand. The OP was trying to load XML from the following location: http://www.google.com/ig/api?weather=12414&hl=it The obvious solution is: string m_strFilePath = "http://www.google.com/ig/api?weather=12414&hl=it"; XmlDocument myXmlDocument = new XmlDocument(); myXmlDocument.Load(m_strFilePath); //Load NOT LoadXml However this fails with XmlException : Invalid character in the given encoding. Line 1, position 499. It seems to be choking on the à of Umidità . OTOH, the following works fine: var m_strFilePath = "http://www

XmlDocument.Load fails, LoadXml works:

半腔热情 提交于 2019-11-29 19:15:13
问题 In answering this question, I came across a situation that I don't understand. The OP was trying to load XML from the following location: http://www.google.com/ig/api?weather=12414&hl=it The obvious solution is: string m_strFilePath = "http://www.google.com/ig/api?weather=12414&hl=it"; XmlDocument myXmlDocument = new XmlDocument(); myXmlDocument.Load(m_strFilePath); //Load NOT LoadXml However this fails with XmlException : Invalid character in the given encoding. Line 1, position 499. It