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 2360
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: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |