I don't even know if I am using the right terminology because I read some call it node, some call it child... I am
still mudding though XML structure, its far more complex once you dig into it then it appears at first glance.
Anyway, say I have an XML that looks like this: (Root elements...
I appreciate you all's patience with me. I admit I am not very smart and maybe my brain is kinda slow
(between ADHD and PTSS).
Making code work and learning from it gives me a great sense of accomplishment.
It really does mean a lot to me! Thank you!
Okay, I had to work with it to understand it... you pointed me in the right direction!!
THANK YOU!
Dim id As String = "99"
Dim Name As String = "Balto"
Dim sex As String = "Male"
Dim commenttxt As String = "<-- This is a new comment -->"
Dim filename As...
I tried that, just put it in the code as raw "<!-- This is a comment -->", but I would like to replace "This is a comment" with a string but I cant figure out how to do that
When I try to add a comment, I get this as the output:
<Employee>
<!-- <%= comment %> -->
<EmpId>99</EmpId>
<Name>Balto</Name>
<Sex>Male</Sex>
</Employee>
</Employees>
here is where I added the comment line, evidently I need to use an escape sequence??
Dim id As...
That worked a treat!
The only thing I couldnt figure out was how to add a comment.
<?xml version="1.0" encoding="utf-16"?>
<Employees>
<Employee>
<!--Only 3 elements for demo purposes-->
<EmpId>5</EmpId>
<Name>Kimmy</Name>
<Sex>Female</Sex>
</Employee>
<Employee>...
Here is what I am getting without adding line 6 in my original post, a well formed XML
<?xml version="1.0" encoding="utf-16"?>
<Employees>
<Employee>
<!--Only 3 elements for demo purposes-->
<EmpId>5</EmpId>
<Name>Kimmy</Name>
<Sex>Female</Sex>
</Employee>
</Employees>...
I got this edited and resolved errors during edit, but generated run time error:
An unhandled exception of type 'System.InvalidOperationException' occurred in System.Xml.Linq.dll
Additional information: This operation would create an incorrectly structured document.
' try to add another...
Wanting to add to XDocument to make more than one "entry" on a single write...
I think I am missing something here, not sure I understand how to do this.
I have some snippit code I massaged and got working fine, but when I add line ??? I get:
Severity Code Description Project File...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.