Special Character inside XML string data | | |
I would like to be able to put in special character inside
an xml data string (#, <, >, &).
when it trys to parses out the XML String it errors out
strXML = "<?xml version='1.0'?>" & vbCRLF
strXML = strXML + "<WO_Step>" & vbCRLF
strXML = strXML + "<Test>Test Special Characters #, %, &,
<, > </Test>
strXML = strXML + "</WO_Step>"
What is the best way to pass this type of information?
Would changing the encoded of the XML string work. | | | | re: Special Character inside XML string data
"Norman Uhlenkott" <NBUhlenk@gapac.com> wrote in message
news:050301c3bb7b$bb0f75f0$a101280a@phx.gbl...[color=blue]
> I would like to be able to put in special character inside
> an xml data string (#, <, >, &).
> when it trys to parses out the XML String it errors out
>
> strXML = "<?xml version='1.0'?>" & vbCRLF
> strXML = strXML + "<WO_Step>" & vbCRLF
> strXML = strXML + "<Test>Test Special Characters #, %, &,
> <, > </Test>
> strXML = strXML + "</WO_Step>"
>
> What is the best way to pass this type of information?
> Would changing the encoded of the XML string work.[/color]
No, you can't store it this way, use XmlWriter. | | | | re: Special Character inside XML string data
You could try somthing like this. I think it will work.
<![CDATA[somedatahere&moredatahere]]> for example
"Norman Uhlenkott" <NBUhlenk@gapac.com> wrote in message
news:050301c3bb7b$bb0f75f0$a101280a@phx.gbl...[color=blue]
> I would like to be able to put in special character inside
> an xml data string (#, <, >, &).
> when it trys to parses out the XML String it errors out
>
> strXML = "<?xml version='1.0'?>" & vbCRLF
> strXML = strXML + "<WO_Step>" & vbCRLF
> strXML = strXML + "<Test>Test Special Characters #, %, &,
> <, > </Test>
> strXML = strXML + "</WO_Step>"
>
> What is the best way to pass this type of information?
> Would changing the encoded of the XML string work.[/color] | | | | re: Special Character inside XML string data
Let me clarify that a bit more. the somedatahere and the moredatehere is
straight text. The example would add the literal "somedatahere&moredatahere"
"vMike" <Michael.George@gewarren.com.nospam> wrote in message
news:bqr1d1$hah$1@ngspool-d02.news.aol.com...[color=blue]
> You could try somthing like this. I think it will work.
> <![CDATA[somedatahere&moredatahere]]> for example
>
> "Norman Uhlenkott" <NBUhlenk@gapac.com> wrote in message
> news:050301c3bb7b$bb0f75f0$a101280a@phx.gbl...[color=green]
> > I would like to be able to put in special character inside
> > an xml data string (#, <, >, &).
> > when it trys to parses out the XML String it errors out
> >
> > strXML = "<?xml version='1.0'?>" & vbCRLF
> > strXML = strXML + "<WO_Step>" & vbCRLF
> > strXML = strXML + "<Test>Test Special Characters #, %, &,
> > <, > </Test>
> > strXML = strXML + "</WO_Step>"
> >
> > What is the best way to pass this type of information?
> > Would changing the encoded of the XML string work.[/color]
>
>[/color] | | | | re: Special Character inside XML string data
"Norman Uhlenkott" <NBUhlenk@gapac.com> wrote in message
news:050301c3bb7b$bb0f75f0$a101280a@phx.gbl...[color=blue]
> I would like to be able to put in special character inside
> an xml data string (#, <, >, &).
> when it trys to parses out the XML String it errors out[/color]
For the following special chars in the 1st column use the sequences in the
2nd column.
& &
< <[color=blue]
> >[/color]
" "
' '
[color=blue]
> strXML = strXML + "</WO_Step>"[/color]
For example,
strXML = strXML + "</WO_Step>"
-- Alan | | | | re: Special Character inside XML string data
"Norman Uhlenkott" <NBUhlenk@gapac.com> wrote in message
news:050301c3bb7b$bb0f75f0$a101280a@phx.gbl...[color=blue]
> I would like to be able to put in special character inside
> an xml data string (#, <, >, &).
> when it trys to parses out the XML String it errors out[/color]
For the following special chars in the 1st column use the sequences in the
2nd column.
& &
< <[color=blue]
> >[/color]
" "
' '
[color=blue]
> strXML = strXML + "</WO_Step>"[/color]
For example,
strXML = strXML + "</WO_Step>"
-- Alan |  | Similar .NET Framework bytes | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,501 network members.
|