5,935 questions
0
votes
3
answers
98
views
Loop through tags based on IgnoreCase attribute value
Please consider this xml:
<Interface>
<Header>...</Header>
<Body>...</Body>
<Footer>...</Footer>
<Parameters>
<...
0
votes
1
answer
50
views
Using LINQ to XML to query specific descendants in ADMX file [duplicate]
Trying to query with LINQ an ADMX file (Local Group Policy) which is in XML format, to get list of categories:
<?xml version="1.0" encoding="utf-8"?>
<!-- (c) 2006 ...
1
vote
2
answers
107
views
In VB 2010, using XDocument, how do I delete an XML node based on the value (innertext) of one of its descendants?
I need to delete all nodes with a specific attribute value.
Using XDocument.Descendants.Where clause with an inline function it's a snap to delete nodes based on a specific attribute value.
That works ...
1
vote
1
answer
57
views
XDocument validation throws exception on ##other
I'm trying to validate xml against xsd files with validation done with XDocument but it constantly fails on that element called ##other. I tried generating xml for that xsd here https://www.liquid-...
-5
votes
1
answer
70
views
How to release the large object memory which is occupied by xdocument immediately? [duplicate]
XDocument xDoc1 = XDocument.Load(XMLFilepath1, LoadOptions.PreserveWhitespace);
Please suggect any options other GC.Collect() for clearing large objects immediately. We tried below options-
GC....
1
vote
1
answer
49
views
Adding read elements without xmlns definition on each element
I'm trying to pull data out of a file in order to split it.
I need the Data element, the Header, Reference and Sender that
is being used for each splitted file, which will contain these elements
plus ...
2
votes
2
answers
85
views
Linq to XML : How to get element based on other elements in file
Consider the following xml file.
I would like to get the ConnectionString Element if I already have the Environment/Name value and Application/Name selected from different ComboBoxes.
<?xml version=...
2
votes
1
answer
140
views
C# - XmlDocument vs XDocument behaviour on invalid hexadecimal character
We are receiving xml documents that we process using XDocument, but which contain hex entity expressions. The documents have likely been created by a process invoking XmlDocument. The XDocument.Parse()...
0
votes
1
answer
57
views
XDocument/XElement/XAttribute: How do I create a document with namespaces by creating unattached elements?
I'm creating a DOM tree by creating XElement and XAttribute objects first and then adding them to the XDocument afterwards.
How would I do this if XNamespaces are involved?
Here's some simple MRE code,...
1
vote
1
answer
51
views
Get child node values from Linq C#
Trying to get values of some child elements in XML, however, when retrieving the values of these elements, they are stitched together.
Also, sometimes the file can have 1 reference number but there ...
1
vote
1
answer
217
views
XDocument - Convert Open and Close Tags to Self-Closing Tag
(Note: This is NOT a semantic question. This isn't asking about what self closing tags mean. This is about doing the opposite with XDocument than what is mentioned in this example post with C#: Remove ...
0
votes
0
answers
45
views
Query all XML Elements and subElements with the corresponding Value and Name [duplicate]
I have this XML File with the following content:
<?xml version="1.0" encoding="utf-8" ?>
<file>
<root>
<Sample-CA1-John>
<Name>John</...
1
vote
1
answer
187
views
Create XML using XDocument or from XSD schema using xsd.exe and XmlSerializer?
Why use xsd.exe tool to create class for XSD schema and then use serializer to create XML file, when you can use XDocument.
Should I be always using XDocument and manually create the XML document by ...
1
vote
0
answers
63
views
.NET XML validator doesn't give accurate error message for prohibited attributes
I am creating a validator in .NET8 for railML data format (based on XML) using XDocument.Validate() and XMLSchemaSet, but I encountered a situation when if I place an attribute in an element that, for ...
3
votes
1
answer
79
views
Will XElement.Parse process external DTD when input is complete xml string?
Our static code analyser reports a security issue on unrestricted document types on a line that does XElement.Parse. The input for that method is the result of some API call.
Acording to the ...