Hi,
I would like to write the text of an element to an xml doc as that it look
like this
<Address>"Marty Jones" <mj@mydomain.com></Address>
however I can't seen to get the quote marks to come out correctly
the innertext property will change
"<" to <
">" to >
but not " to "
when I write " in the innerText string I get &quot;
I tried to use innerXml instead of innertext but it didn't like that, I
guess because I am not inserting into a cdata section.
my failed attempts are below,
_message.DocumentElement.SelectSingleNode("Address es/Address").InnerText =
""Marty Jones" <mj@mydomain.com>";
<Address>&quot;Marty Jones&quot;
&lt;mj@mydomain.com&gt;</Address>
_message.DocumentElement.SelectSingleNode("Address es/Address").InnerText =
"\"Marty Jones\" <mj@mydomain.com>";
<Address>"Marty Jones" <mj@mydomain.com></Address>
any help is appreciated
cheers
martin. 6 2298
Xml knows nothing about " so it is unable to process this entity. You
might take a look at the HtmlEncode and HtmlDecode methods which might work
on these entities.
"martin" <ma***************@hotmail.com> wrote in message
news:On**************@tk2msftngp13.phx.gbl... Hi,
I would like to write the text of an element to an xml doc as that it look like this
<Address>"Marty Jones" <mj@mydomain.com></Address>
however I can't seen to get the quote marks to come out correctly
the innertext property will change "<" to < ">" to >
but not " to "
when I write " in the innerText string I get &quot;
I tried to use innerXml instead of innertext but it didn't like that, I guess because I am not inserting into a cdata section.
my failed attempts are below,
_message.DocumentElement.SelectSingleNode("Address es/Address").InnerText = ""Marty Jones" <mj@mydomain.com>"; <Address>&quot;Marty Jones&quot; &lt;mj@mydomain.com&gt;</Address>
_message.DocumentElement.SelectSingleNode("Address es/Address").InnerText = "\"Marty Jones\" <mj@mydomain.com>"; <Address>"Marty Jones" <mj@mydomain.com></Address>
any help is appreciated
cheers
martin.
you can not do it with InnerText.
when you set innerText, it only quotes the chars it needs to. it does not
need to convert " to " as quotes are legal between tags. if you want to
control the quoting, then innerHtml is the answer
-- bruce (sqlwork.com)
"martin" <ma***************@hotmail.com> wrote in message
news:On**************@tk2msftngp13.phx.gbl... Hi,
I would like to write the text of an element to an xml doc as that it look like this
<Address>"Marty Jones" <mj@mydomain.com></Address>
however I can't seen to get the quote marks to come out correctly
the innertext property will change "<" to < ">" to >
but not " to "
when I write " in the innerText string I get &quot;
I tried to use innerXml instead of innertext but it didn't like that, I guess because I am not inserting into a cdata section.
my failed attempts are below,
_message.DocumentElement.SelectSingleNode("Address es/Address").InnerText = ""Marty Jones" <mj@mydomain.com>"; <Address>&quot;Marty Jones&quot; &lt;mj@mydomain.com&gt;</Address>
_message.DocumentElement.SelectSingleNode("Address es/Address").InnerText = "\"Marty Jones\" <mj@mydomain.com>"; <Address>"Marty Jones" <mj@mydomain.com></Address>
any help is appreciated
cheers
martin.
Thats fine,
so why is & being changed to &
and < to < , > to >
but not " to "
all I want is for " to appear in the element, the trouble is it always
change a & to &
I'll try HTML encode but I'm not holding out much hope cause they'll still
be a & in the expression.
cheers
martin.
"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:uj*************@tk2msftngp13.phx.gbl... Xml knows nothing about " so it is unable to process this entity.
You might take a look at the HtmlEncode and HtmlDecode methods which might
work on these entities.
"martin" <ma***************@hotmail.com> wrote in message news:On**************@tk2msftngp13.phx.gbl... Hi,
I would like to write the text of an element to an xml doc as that it
look like this
<Address>"Marty Jones" <mj@mydomain.com></Address>
however I can't seen to get the quote marks to come out correctly
the innertext property will change "<" to < ">" to >
but not " to "
when I write " in the innerText string I get &quot;
I tried to use innerXml instead of innertext but it didn't like that, I guess because I am not inserting into a cdata section.
my failed attempts are below,
_message.DocumentElement.SelectSingleNode("Address es/Address").InnerText
= ""Marty Jones" <mj@mydomain.com>"; <Address>&quot;Marty Jones&quot; &lt;mj@mydomain.com&gt;</Address>
_message.DocumentElement.SelectSingleNode("Address es/Address").InnerText
= "\"Marty Jones\" <mj@mydomain.com>"; <Address>"Marty Jones" <mj@mydomain.com></Address>
any help is appreciated
cheers
martin.
Hi bruce,
Can you give an exemple of using innerHTML please,
I am using xmldocument class and this is not a member,
I can't see any other innerhtml property, perhaps I am missing something.
cheers
martin.
"bruce barker" <no***********@safeco.com> wrote in message
news:OQ**************@TK2MSFTNGP11.phx.gbl... you can not do it with InnerText.
when you set innerText, it only quotes the chars it needs to. it does not need to convert " to " as quotes are legal between tags. if you want
to control the quoting, then innerHtml is the answer
-- bruce (sqlwork.com)
"martin" <ma***************@hotmail.com> wrote in message news:On**************@tk2msftngp13.phx.gbl... Hi,
I would like to write the text of an element to an xml doc as that it
look like this
<Address>"Marty Jones" <mj@mydomain.com></Address>
however I can't seen to get the quote marks to come out correctly
the innertext property will change "<" to < ">" to >
but not " to "
when I write " in the innerText string I get &quot;
I tried to use innerXml instead of innertext but it didn't like that, I guess because I am not inserting into a cdata section.
my failed attempts are below,
_message.DocumentElement.SelectSingleNode("Address es/Address").InnerText
= ""Marty Jones" <mj@mydomain.com>"; <Address>&quot;Marty Jones&quot; &lt;mj@mydomain.com&gt;</Address>
_message.DocumentElement.SelectSingleNode("Address es/Address").InnerText
= "\"Marty Jones\" <mj@mydomain.com>"; <Address>"Marty Jones" <mj@mydomain.com></Address>
any help is appreciated
cheers
martin.
Try the .xml property.
--
Thanks,
Eric Lawrence
Program Manager
Assistance and Worldwide Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"martin" <ma*****************@hotmail.com> wrote in message
news:#e**************@TK2MSFTNGP12.phx.gbl... Hi bruce,
Can you give an exemple of using innerHTML please,
I am using xmldocument class and this is not a member, I can't see any other innerhtml property, perhaps I am missing something.
cheers
martin.
"bruce barker" <no***********@safeco.com> wrote in message news:OQ**************@TK2MSFTNGP11.phx.gbl... you can not do it with InnerText.
when you set innerText, it only quotes the chars it needs to. it does
not need to convert " to " as quotes are legal between tags. if you want to control the quoting, then innerHtml is the answer
-- bruce (sqlwork.com)
"martin" <ma***************@hotmail.com> wrote in message news:On**************@tk2msftngp13.phx.gbl... Hi,
I would like to write the text of an element to an xml doc as that it look like this
<Address>"Marty Jones" <mj@mydomain.com></Address>
however I can't seen to get the quote marks to come out correctly
the innertext property will change "<" to < ">" to >
but not " to "
when I write " in the innerText string I get &quot;
I tried to use innerXml instead of innertext but it didn't like that,
I guess because I am not inserting into a cdata section.
my failed attempts are below,
_message.DocumentElement.SelectSingleNode("Address es/Address").InnerText = ""Marty Jones" <mj@mydomain.com>"; <Address>&quot;Marty Jones&quot; &lt;mj@mydomain.com&gt;</Address>
_message.DocumentElement.SelectSingleNode("Address es/Address").InnerText = "\"Marty Jones\" <mj@mydomain.com>"; <Address>"Marty Jones" <mj@mydomain.com></Address>
any help is appreciated
cheers
martin.
Hi Eric,
Thanks for the reply, but where will I find this .xml property.
I am using xmldocument and this does not have an xml property.
It has an innerXML property but this does not meet my needs. (""" still
get output as "&quot;" and this is not what I require)
I need to have the string """ appear in <address><address> tags as
<Addresses>
<Address>&qout;Somebody's Name" <me@mydomain.com></Address>
</Addresses>
if you could show me sample code to produce the above fragment then I would
very much appreciate it. My attempt is below.
cheers
martin.
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@webs>"
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
End Module This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Jeff |
last post by:
Hi!
I'm trying to update a number in a document with the following code. It
displays a number, a div block with a minus sign and a div block with a
plus sign. When I click the plus sign I want...
|
by: oembuilders |
last post by:
Having a bit of trouble figuring out how to get the innerText of
a cell other that the one selected. Any help would be apprecated
as I am very new to javascript. I got the working example from...
|
by: delraydog |
last post by:
I know that innerText is not supported in FireFox and I've found the
following code fragment which was originally designed in an HTMLElement
prototype for an innerText getter. I do not however want...
|
by: C# newbie |
last post by:
Hello group,
When I run an XPATH query first as:
//*[contains(translate(.,\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\",
\"abcdefghijklmnopqrstuvwxyz\")
|
by: Lyners |
last post by:
I have a web page writen in ASP.NET that contains some javascript so that
when a user presses a button, or edits a certain field in a datagrid, another
cell in the datagrid is filled with a value....
|
by: Angel |
last post by:
I want to concat a space in an HTML Control's innerText property. here is a
sample code
Dim celCreate As New HtmlControls.HtmlTableCell()
celCreate.innerText = " TEST"
When the page is...
|
by: Naresh1 |
last post by:
What is WebLogic Admin Training?
WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
|
by: antdb |
last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine
In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
|
by: Matthew3360 |
last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function.
Here is my code.
header("Location:".$urlback);
Is this the right layout the...
|
by: Matthew3360 |
last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
|
by: AndyPSV |
last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
|
by: Arjunsri |
last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
|
by: WisdomUfot |
last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
|
by: Matthew3360 |
last post by:
Hi,
I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
|
by: Carina712 |
last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
| |