Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Replacing Ampersand in a string for XML
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Titre:
Replacing Ampersand in a string for XML
Divers
Thread ID:
01662605
Message ID:
01662605
Vues:
54
Hi,

My code converts a string (field of a cursro) to an XML string and to a cursor. And if the string contains an ampersand sign (&), the process fails.

This is the segment of the code:
cAuditDescr = '<?xml version = "1.0" encoding="Windows-1252" standalone="yes"?><Changes>' +
ALLTRIM(C_POAUDIT.AUDIT_DESC) + '</Changes>'
XMLTOCURSOR( cAuditDescr, 'CUR_TEMP', 8192 )
The error happens on the line XMLTOCURSOR() when the string AUDIT_DESC has an ampersand. I can pre-process the entry and either strip all occurrences of ampersand or replace it? Getting rid is pretty straight forward. But if I want to replace it, what character should be used?

TIA
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform