Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to convert this?
Message
De
17/12/2003 15:00:29
 
 
À
17/12/2003 03:10:41
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Divers
Thread ID:
00859793
Message ID:
00860057
Vues:
25
>Hi,
>I have XML below returned by web services. However, XMLTOCURSOR() is not able to convert the lastModTime field. Any workaround?
>
>
><remoteDir>
>  <file>
>    <name>FWDDATA-HQ-22102003120746.CAB</name>
>    <size>30737</size>
>    <lastModTime m="12" d="17" y="2003" hh="16" mm="9" ss="0" />
>  </file>
></remoteDir>
>
>
>Thank you

Hi John,

XMLAdapter might help:
CLOSE DATABASES all
CLEAR


TEXT TO cXML NOSHOW
<?xml version="1.0" encoding="Windows-1251" standalone="yes"?>
<remoteDir>
  <file>
    <name>FWDDATA-HQ-22102003120746.CAB</name>
    <size>30737</size>
    <lastModTime m="12" d="17" y="2003" hh="16" mm="9" ss="0" />
  </file>
</remoteDir>
ENDTEXT

* use template cursors to describe schema
CREATE CURSOR FILE(name C(30),size I)
CREATE CURSOR lastModTime (m I, d I, y I, hh I, mm I, ss I)

LOCAL oXA as XMLAdapter, oXT as XMLTable

oXA=CREATEOBJECT("XMLAdapter")
oXA.LoadXML(cXML)

oXT=oXA.AddTableSchema("file")
oXT1=oXA.AddTableSchema("lastModTime",.F.)
oXA.Tables.Remove(2)

oXT.ChildTable=oXT1

CLOSE TABLES all

oXT.ToCursor()

SELECT file
LIST 
Thanks,
Aleksey.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform