Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What's in CURSORTOXML()?
Message
De
22/08/2002 13:12:28
 
 
À
22/08/2002 04:02:31
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Divers
Thread ID:
00692321
Message ID:
00692548
Vues:
27
>It won't solve your problem, but may help you to identify its source. This is a replacement for the STRCONV() function (takes a ISO-Latin-1 string and converts it to UFT-8 encoding to be used in XML documents):

It's not quite a replacement as STRCONV() doesn't convert the greater less signs. When my XML is ready to be converted, if I call your function, I will end up with an invalid XML as no tag is present anymore in the string. I had to comment those two ligns in order to achieve the same thing as STRCONV().

Also, if I do that on my entire XML string, it never work. The process runs indefinitely.

However, if I call your function for only one field, it'll convert it ok. What I mean by that, is presently, I use this approach:
SELECT Title,Message FROM ALIAS() INTO CURSOR Temp

* Create XML object
...

* Add root
...

SCAN
   ...

   * Add each field
   loXML.AddElement(loProperty,'Title',Titre)
   loXML.AddElement(loProperty,'Abstract',Message)

ENDSCAN
RETURN STRCONV(loXML.XML(),9)
However, the only way I was able to make use of your function was to use it against the field directly, such as:
SELECT Title,Message FROM ALIAS() INTO CURSOR Temp

* Create XML object
...

* Add root
...

SCAN
   ...

   * Add each field
   loXML.AddElement(loProperty,'Title',Titre)
   loXML.AddElement(loProperty,'Abstract',IsoToUTF8(Message))

ENDSCAN
RETURN loXML.XML()
If I do this, this will never work as it removes the tag recognition from the XML string:
SELECT Title,Message FROM ALIAS() INTO CURSOR Temp

* Create XML object
...

* Add root
...

SCAN
   ...

   * Add each field
   loXML.AddElement(loProperty,'Title',Titre)
   loXML.AddElement(loProperty,'Abstract',Message)

ENDSCAN
RETURN IsoToUTF8(loXML.XML())
IAC, the problem is at the Web Service level. I tried it at the Web app level to see if it was related to a memory problem. This doesn't seem to be case.

At the Web Service level, the conversion is the following:
RETURN STRCONV(STRCONV(loXML.XML,1),9)
So, what would I need to change in your function to support that double conversion?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform