Questions tagged [xmlexception]

34 questions
2
votes
3 answers

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

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…
Thomas Owens
  • 114,398
  • 98
  • 311
  • 431
1
vote
1 answer

C# differentiate exceptions

In C# I need to catch an XMLException but I also have to differentiate it, because it can be either Xml_InvalidRootData or Xml_UnexpectedEOF. How can I achieve this? Those strings I can only see in debugger with an alias of "ResString". But I want…
Daniel
  • 2,318
  • 2
  • 22
  • 53
1
vote
0 answers

How to get text from channels.message when there's a XmlException?

I want to write in a file the content of a request of type System.ServiceModel.Channels.Message even when I can't read it because of an exception with the XML. Ex : I call request.CreateBufferedCopy(int.MaxValue); where request is my…
1
vote
1 answer

XDocumetn.Load from document with version 1.1 in head cause XmlException

I have xml in string var "xml" < insertCommand table=""Colors""> Red #FF0000 I try get XDocument. …
trueboroda
  • 2,650
  • 26
  • 24
1
vote
1 answer

XmlDocument from XML string that contains custom namespaces causes XmlException?

I need to create an XmlDocument partly by using old XML and partly by creating new. The problem is that the old XML contains custom namespaces and I can't seem to be able to use them as I get an XmlException. I've tried to add the namespace to many…
Joel Peltonen
  • 13,025
  • 6
  • 64
  • 100
0
votes
0 answers

XML Parser Error Message gives wrong row and character

I receive an error with incoming XML going through my WebAPI into the parser. I expect an error due to passing in a parameter as a wrong data type, but the row and character numbers are wrong in this error message: There is an error in XML document…
0
votes
1 answer

SSAS Tabular connection error - The server sent an unrecognizable response, XmlException 0x06 is an invalid character

I'm trying to connect to an Analysis Services Server with some C#. The server is using the Microsoft.AnalysisServices.Tabular Assembly namespace (SSAS Tabular). Here's my code: using var server = new Server(); server.Connect(myConnectionString); var…
LatentDenis
  • 2,839
  • 12
  • 48
  • 99
0
votes
1 answer

XmlException: Root element is missing (but it's not)

I have a VB.Net 4.7.2 desktop application that is throwing an exception occasionally. The exception is usually, "Root element is missing". When this happens, I am able to view the file after the fact and the root element is there. The file is…
0
votes
2 answers

Catch only character encoding issues in XmlException

I'm using System.Xml to parse xml documents. Sometimes the xml documents contain unencodable characters and then an XmlException gets thrown. In those cases, I want to retry parsing the document with a forced encoding, like this: try { var doc =…
Björn Lindqvist
  • 19,221
  • 20
  • 87
  • 122
0
votes
0 answers

Troubleshoot errors in the Visual Studio debug output window

I am working on a mvc5 project that wasn't created by me. The website itself works fine but I am seeing a lot of exceptions being thrown in the debug output window. It bugs me that I have no clue where the come from. But the website is also…
Dennis
  • 1
  • 3
0
votes
1 answer

Error deserializing Windows logs as PSObjects?

Trying to deserialize Powershell logs using "PSSerializer.Deserialize(log) as PSObject;" but keep getting error: "System.Xml.XmlException: 'Element 'Objs' with namespace name 'http://schemas.microsoft.com/powershell/2004/04' was not found. Line 1,…
nityomki
  • 1
  • 1
0
votes
1 answer

Error while decoding xml. "&" not valid marker. Waiting ";"

I have a xml file, when I'm trying to decode it. XmlElement cmd = data.DocumentElement; cmd.InnerXml = WebUtility.HtmlDecode(cmd.InnerXml); I getting an error "&" is not valid marker. Waiting ";". Xml file
Nickvaler
  • 1
  • 1
0
votes
1 answer

Azure, MVC Core Web App suddenly throw "XmlException: Root element is missing" + "CryptographicException"

I have a web application hosted by an Azure App service. It has worked fine for years but suddenly I get an Exception when i try to enter the Account/login action: -->"XmlException: Root element is missing" + "CryptographicException: An error…
0
votes
1 answer

How to determine which of several different errors might have caused XmlException?

The system I'm working on uses DataSet.ReadXml(XmlReader) to read an XML file and load its contents to a DataSet. The XML file is from a business partner and may not always be well-formed, but this system is expected to perform reasonable…
STLDev
  • 5,950
  • 25
  • 36
0
votes
1 answer

XmlException When Parsing Valid XML

I have a WPF application that calls an API and creates an System.Xml.Linq.XDocument using XDocument.Parse(string). I am running into a problem where an XmlException ("Root element is missing") is thrown when I try to do this, but my XML is…
Greg Whatley
  • 1,020
  • 1
  • 13
  • 32