TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Andy
NA
1
0
XML namespaces and prefixes
Apr 11 2009 1:52 PM
Hi,
I am trying to create a XML document with specific prefixes, something like the following:
<
my
:doc>
<
book
:item
property
:changed="12/3/2009">Title </book>
<
author
:item
property
:changed="12/3/2009">admin</author>
</doc>
I am creating a node the following way:
XmlDocument
xmlDom;
XmlElement
xmlItem;
XmlText
xmlText;
xmlItem = xmlDom.CreateElement("MyTag");
XmlAttribute
attr = xmlDom.CreateAttribute("attribute");
attr.InnerText = "Text";
xmlItem.Attributes.Append(attr);
xmlText = xmlDom.CreateTextNode("some text");
xmlItem.AppendChild(xmlText);
And the result is something like:
<
MyTag attribute
="Text">some text</
MyTag
>
I tried to add these prefixes with the xmlDom.CreateAttribute("","",""); method, but this doesn't seem to work. I am also stuck at setting the prefix/namespace of the XML tag (e.g.
prefix
:MyTag).
Any help would be appreciated... thanks in advance.
Reply
Answers (
0
)
Random button color ?
Develop a function that can set a prefix on every number