On Thu, 11 Sep 2008 10:42:09 -0700, standerby <st*******@yahoo.comwrote:
I am writing a XML file suing XElement. How can I output a file like
the following? I got an exception if if I use ':' in the element name
or attribute name.
What is the code you're trying to use? It's hard to say what you're doing
wrong if you don't say what you're doing.
If I've read the docs correctly, you should be able to create a proper
XName instance by combining an XNamespace instance with a string:
XNamespace ns = "xmlns";
XName nameEpo = ns + "epo",
nameXsi = ns + "xsi";
Then you'd pass the appropriate XName to the XElement.SetAttribute()
method (or just create the XName in the method call itself, rather than
putting it in a variable).
If that doesn't address your question, you should probably be more
specific. :)
Pete