Hello, Vicente!
[skipped]
VG> The problem is that I am not be able to add children using XmlDocument,
VG> XmlElement nor XmlNode...May anyone help me with this issue?
What's the problem? Give code sample, where you're trying to add children node.
--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Vicente Garcia - 21 Aug 2006 11:47 GMT
Thanks for the reply Vadym
This is my snippet code:
...
XmlNode fragments = root.SelectSingleNode("fragments"); //now I am in
fragments
...//My problem is that I don't know how to declare the node element and I
didn't find that on the Web
fragments.AppendChildNode(node); //I must add nodes
Apologies if my explanation insn't enough good, This is because of my mother
tongue isn't English
Thanks a lot!
> Hello, Vicente!
>
[quoted text clipped - 10 lines]
> Regards, Vadym Stetsyak
> www: http://vadmyst.blogspot.com
Vadym Stetsyak - 21 Aug 2006 12:14 GMT
Hello, Vicente!
VG> This is my snippet code:
VG> ...
VG> XmlNode fragments = root.SelectSingleNode("fragments"); //now I am in
VG> fragments
VG> ...//My problem is that I don't know how to declare the node element
VG> and I didn't find that on the Web
//assume that we have XmlDocument xmlDoc
XmlElement newElement = xmlDoc.CreateElement("element");
newElment.SetAttribute("name", "nameXXX");
fragments.AppendChild(newElement );
VG> Apologies if my explanation insn't enough good, This is because of my
VG> mother tongue isn't English
You're not alone :8-)
--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Vicente Garcia - 21 Aug 2006 12:26 GMT
Thanks a million!
I've just run it and it works fine :)
I was very confused because of the examples I found didn't serve
regards
> Hello, Vicente!
>
[quoted text clipped - 19 lines]
> Regards, Vadym Stetsyak
> www: http://vadmyst.blogspot.com
> hi,
> I have a xml file as shown:
[quoted text clipped - 20 lines]
> Thanks in advance
> regards
Vicente,
What technicial limitation prohibits you from using the XmlDocument object
to manipulate your doucment (other than the fact that this document is not
valid xml)?
Unless you can provide sound logical reasons and technical limitations there
isn't a solution for you here - only a hack.
The XmlDocument object conforms to the xml standards, unless you know
exactly what you are doing you should avoid the "I'm smarter than the
framework developers" approach to xml manipulation. Don't take offence to
this either. I've seen way to many solvable problems that people just don't
take the time to fix correctly. Some just apply a hack to get it working and
never go back. This will cause more problems in the long run.
<?xml version="1.0" encoding="utf-8"?>
<PIM>
<fragments>
</fragments>
</PIM>
</xml>
<!-- </xml> is not valid -
The <?xml version="1.0" ?> is a processing instruction and is required for
all xml documents, it doesn't required any ending tag, let alone one that was
never defined.
Vicente García - 21 Aug 2006 12:56 GMT
hi Jared
I type the last </xml> but it isn't in my code, I didn't realize
I could use XmlDocument, in fact this is my intention but I didn't Know how
to use it in this situation because my code always failed, but now Vadim
shows me how to use it.
many thanks
regards
> Vicente,
> What technicial limitation prohibits you from using the XmlDocument object
[quoted text clipped - 24 lines]
> was
> never defined.