In attribute value you still can not literally use (&), because (&)
indicates the start of entity reference. Instead you must use (&),
Besides, as you already knew, if you want to use inside attribute value,
then you have to pay special attention not to use the one you deliminate the
attribute value. For example, you said you are using quotation (") to
enclose your attribute value, then you must escape it inside the attribute
value, otherwise, the XmlReader or XmlDocument will recognize it as the end
of the attribute value.But you can still use (').
If you want to do preparation for Xml source file, the list of special
characters is here:
Character Name Entity Reference Character Reference Numeric Reference
Ampersand & & &
Left angle bracket < < &#60;
Right angle bracket > > >
Straight quotation mark " " '
Apostrophe ' ' "
Among the 5, (>), ("), and (') has been handled by the XmlReader and the
XmlDocument objects because only single character replacement is required
for these characters. The VB code you see on the page from the link in last
email actually don't do much more than escaping (&) and the 2nd (<).
HTH,
Jun Wang
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm. [quoted text, click to view] "MSFT" <lukezhan@online.microsoft.com> wrote in message
news:tsuow49gDHA.688@cpmsftngxa06.phx.gbl...
> Hi Matthew,
>
> For a list of these special characters, you may refer to:
>
> HOW TO: Locate and Replace Special Characters in an XML File with Visual
> Basic .NET
>
http://support.microsoft.com/default.aspx?scid=kb;EN-US;308060 >
> Hope this help,
>
> Luke
> Microsoft Online Support
>
> Get Secure!
www.microsoft.com/security > (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
>
>
--
"Matthew Wieder" <Development@SatoriGroupInc.com> wrote in message
news:3F731199.6090003@SatoriGroupInc.com...
> In my previous post, I asked about a routine which prepares a string for
> an XPath query by taking care of escape characters.
> Unable to find a list, I'm now wondering assumign I enclose the
> attribute value in quotes in my XPath query, what other escape
> characters need to be handled aside from a quotation mark? As I
> understand it, an apostrophe wouldn't be a problem since I'm enclosing
> the string in quotes.
> thanks!
>