write into a XML File

27/11/2007 - 17:52 von Stefan Theobald | Report spam
Hello,

I have a problem - how can I write a < > into the XML-File?

I have a DataGrid which is filled with Data.
Then I write the Grid with the folowing command into a file.
DS_ITEMS_IN.WriteXml(Ausgabeverzeichnis_XML_Datei & "ITEMS_IN.XML",
XmlWriteMode.IgnoreSchema)

That works fine. But now I need to format one Field as a CDATA-Section.
I tried to do
Datenzeile_Beschreibung.Item("BESCHREIBUNG_TEXT") = ChrW(60) & "![CDATA[" &
Datenzeile_aus_Meine_Artikeltabelle.Item("TEXT") & "]]" & ChrW(62)

But in the XML-File when I edit it with the Editor always stands:
<BESCHREIBUNG LongText="YES">&lt;![CDATA[blablabla]]&gt;</BESCHREIBUNG>

but it must look like:
<BESCHREIBUNG LongText="YES><![CDATA[blablabla]]></BESCHREIBUNG>

That´s the reason why CDATA-Section is not correctly shown.

Which syntax do I have to use for write < > correct to the XML-File?


Your´s
Stefan
 

Lesen sie die antworten

#1 Paul Retzer
28/11/2007 - 01:04 | Warnen spam
"Stefan Theobald" schrieb im
Newsbeitrag
news:
Hello,

I have a problem - how can I write a < > into the XML-File?

I have a DataGrid which is filled with Data.
Then I write the Grid with the folowing command into a file.
DS_ITEMS_IN.WriteXml(Ausgabeverzeichnis_XML_Datei &
"ITEMS_IN.XML",
XmlWriteMode.IgnoreSchema)

That works fine. But now I need to format one Field as a
CDATA-Section. I tried to do
Datenzeile_Beschreibung.Item("BESCHREIBUNG_TEXT")
= ChrW(60) & "![CDATA[" & Datenzeile_aus_Meine_Artikel-
tabelle.Item("TEXT") & "]]" & ChrW(62)

But in the XML-File when I edit it with the Editor always stands:
<BESCHREIBUNG LongText="YES">&lt;![CDATA[blabla-
bla]]&gt;</BESCHREIBUNG>

but it must look like:
<BESCHREIBUNG LongText="YES><![CDATA[blablabla]]></BESCHREIBUNG>
... [SNIP]




Hallo,
soll das ein schlechter faschingsscherz sein?!? Ein string-salat
aus englisch und deutsch - oder was? Bitte wàhle eine englisch NG
für dein problem (please select an english NG for your problem) ...
MFG: PR

Ähnliche fragen