Questions tagged [system.xml]

System.Xml is a set of APIs that provide support for processing XML in .NET applications.

System.Xml is a set of APIs that provide support for processing XML in .NET applications. https://learn.microsoft.com/en-us/dotnet/api/system.xml

101 questions
0
votes
2 answers

XmlDocument - ParentNode and DocumentType are null

In .NET what does it mean if you LoadXml() into the XmlDocument object and then ParentNode and DocumentType are null? Also, I get this as the answer to xmldoc.FirstChild.Value: version="1.0" encoding="utf-8" Is this right? Been a while since I…
BuddyJoe
  • 69,735
  • 114
  • 291
  • 466
0
votes
1 answer

.net System.XML SelectSingleNode when child elements haven't got namespace

So trying to select node "NumSerieFacturaEmisor" from this XML:
Jack Casas
  • 914
  • 18
  • 37
0
votes
2 answers

How to use XmlDocument.SelectSingleNode() with a default namespace?

I'm trying to pull some values from some customer-supplied XML documents, using XmlDocument.SelectSingleNode(). SelectSingleNode() takes an XPATH string, and very simple searches are failing. E.g. with this:
Jeff Dege
  • 11,190
  • 22
  • 96
  • 165
0
votes
2 answers

XML File Editing with C#

So its my first time working with XML documents and i need some help. I have this segment in my XML file:
Zypherr
  • 53
  • 10
0
votes
0 answers

ASP.NET Core 2.0 + Swashbuckle (Odd Path Truncation)

So I have been writing up some ASP.NET Core training guides for my company, and came across an interesting bug on Windows. When using Swashbuckle to implement Swagger, the application will crash on startup, during what appears to be the automatic DI…
Xorcist
  • 3,129
  • 3
  • 21
  • 47
0
votes
1 answer

"'The ':' character, hexadecimal value 0x3A, cannot be included in a name" , when loading xml file usinf XDocument

I have to read an XML file, but it has ':' in the first node.I am getting this error when I am trying to load the file using XDocument or XElement or xmldocument.I do not know how to resolve this issue. string _filePath=…
user3874424
  • 3
  • 1
  • 6
0
votes
1 answer

How to use CancellationToken in XDocument.LoadAsync()

I am have the following code to load XDocument from Stream in .NET Core 2 CancellationTokenSource source = new CancellationTokenSource(); CancellationToken token = source.Token; XDocument xdocument = await XDocument.LoadAsync(xmlStream, new…
LP13
  • 30,567
  • 53
  • 217
  • 400
0
votes
1 answer

How to validate XML in .NET Core 1.1.2

How can i validate XML against XSD schema in .NET Core 1.1.2? i found this ms docs but i cannot use it with .NET core 1.1.2 using System; using System.Collections.Generic; using System.Text; using System.Xml; using System.Xml.Schema; namespace…
LP13
  • 30,567
  • 53
  • 217
  • 400
0
votes
3 answers

Disable/Enable module in magento using system.xml in magento

I already know how to disable module output in the system config by going to System>Configuration>Advanced and by setting false in etc/modules. What I want to know is how to disable module using the custom tab that I created using…
markaugustine
  • 77
  • 1
  • 9
0
votes
1 answer

Read each node in IEnumerable using XMlReader

I have IEnumerable theTestCaseNodes which has the following kind of XElements
Goto xxxxxxxxx
Diana
  • 49
  • 1
  • 7
0
votes
1 answer

get a node under a xsi:type in xml in c#

I have an XML file with the format below ....... ....... ....... ........ …
Philemon philip Kunjumon
  • 1,417
  • 1
  • 15
  • 34
0
votes
0 answers

C# Serialize xml sub element with type defined in attribut

I would like to serialize with System.Xml.Serialization the following XML code. Is there a way to have it inside an object containing the type (typeRef) of this variable (text) defined at runtime ?
dincan
  • 99
  • 1
  • 8
0
votes
1 answer

How to deep copy XDocument / XElement preserving Line Info

I have an XDocument loaded with LoadOptions.SetLineInfo. I need to take a copy of this object, preserving the line info. Unfortunately, the copy constructors seem to lose the line info - as does a ToString / Parse. Any ideas? Thanks.
0
votes
1 answer

Issue setting DocumentElement

I'm trying to set documentelement to what I want to be the root element. When i try to do so I get the following error Property 'DocumentElement' is readonly. I suppose that makes sense. I'm currently trying to convert msxml to system.xml. Public…
CBC_NS
  • 1,961
  • 4
  • 27
  • 47
0
votes
1 answer

Adding child element with attributes to XML using System.XML

I have the following XML file:
sarbo
  • 1,661
  • 6
  • 21
  • 26