Re: xmldocument " and "
From: Rick Strahl [MVP] (rickstrahl_at_hotmail.com)
Date: 03/06/04
- Next message: Rick Strahl [MVP]: "Re: PassingObjectstoWebForms"
- Previous message: Colin Basterfield: "Re: Message not displayed"
- In reply to: martin: "xmldocument " and ""
- Next in thread: Peter Rilling: "Re: xmldocument " and ""
- Reply: Peter Rilling: "Re: xmldocument " and ""
- Reply: martin: "Re: xmldocument " and ""
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 6 Mar 2004 13:57:48 -1000
Martin,
That's because the escaped entity is " not &qout;
+++ Rick ---
-- Rick Strahl West Wind Technologies http://www.west-wind.com/ http://www.west-wind.com/weblog/ ---------------------------------- Making waves on the Web "martin" <marc_no_spam_1234@hotmail.com> wrote in message news:Ooxtf#8AEHA.1700@TK2MSFTNGP12.phx.gbl... > Hi, > > I would be extremly grateful for some help on producing an xml fragemt. > > The fragment that I wish to produce should look like this > > <Addresses> > <Address>&qout;Somebody's Name" <me@mydomain.com></Address> > </Addresses> > > This looks simple enough however I am having great difficulty getting the > string """ to appear in the above fragment. > The & sign alway get escaped to & so the line " always appears as > &quot; which is not what I require. > If I put in a " sign then the quote sign actually gets placed in the xml and > does not get escaped to " at all. > > any help is producing a fragment in the above format whould be greatly > appreciated. > > cheers > > martin. > > PS. to demonstate what I mean I have included the code below that can be > run from a console application/ > > Imports System.IO > > Imports System.Xml > > Module Module1 > > Sub Main() > > Dim xmlDoc As New XmlDocument > > Dim xmlElemAddress As XmlNode > > Dim root As XmlElement > > Try > > xmlDoc.LoadXml("<Addresses/>") > > xmlElemAddress = xmlDoc.CreateNode(XmlNodeType.Element, "Address", "") > > xmlElemAddress.InnerText = ""Somebody's Name" <me@mydomain.com>" > > root = xmlDoc.DocumentElement > > root.AppendChild(xmlElemAddress) > > xmlDoc.Save(Console.Out) > > Catch ex As Exception > > Console.WriteLine("***ERROR***") > > Console.WriteLine(ex.Message.ToString()) > > Finally > > End Try > > End Sub > > >
- Next message: Rick Strahl [MVP]: "Re: PassingObjectstoWebForms"
- Previous message: Colin Basterfield: "Re: Message not displayed"
- In reply to: martin: "xmldocument " and ""
- Next in thread: Peter Rilling: "Re: xmldocument " and ""
- Reply: Peter Rilling: "Re: xmldocument " and ""
- Reply: martin: "Re: xmldocument " and ""
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|