You're writing the XML the wrong way. The element:
<bk:title>the wind</bk:title>
is made of a prefix "bk" a name "title" and a string content "the wind".
The way to write this is:
xtw.WriteElementString("title", "http://myurnforbooks", "the wind");
Note that the prefix is irrelevant. What matters is the namespace. When you
read the xml back, the only thing you should care is the namespace and
local name of the element.
For input <book>stuff</book>, the reader will subsequently pass over the
document element, the text content, and the closing element in turn, each
time you call Read(). Remember the reader is a cursor over the underlying
XML. For each infoset item (element, attribute, text, etc.) the cursor is
advanced after each Read() call.
You get the "book" string in the output twice because first it's an open
elemnt and later a closing tag. If you ask for the reader's NodeType
property, you will see that it's XmlNodeType.Element the first time, and
XmlNodeType.EndElement the second.
They are different things.
> please reply via email to this post to x0td0x@hotmail.com
> i need some code that will generate code to read the xml file it is
[quoted text clipped - 36 lines]
>
> ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet
News==----
> http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000
Newsgroups
> ---=
=---