Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
XML datetime converted to {}
Message
De
09/10/2002 07:22:31
 
Information générale
Forum:
Visual FoxPro
Catégorie:
XML, XSD
Divers
Thread ID:
00709077
Message ID:
00709175
Vues:
21
>I'm getting some XML passed into my VFP COM component from as ASP.NET page. The XML has dates in the form
>
>
><xs:element name="date_in" type="xs:date" />
><date_in>2002-08-01T00:00:00.0000000-07:00</date_in>
>
>
>When I use XMLTOCURSOR(tcRecord,"cRecord",4) the date (datetime) field above is interpreted as {} instead of {^2002/08/01}. Anyone know how to correct this?

You may try to pre-process the XML document as proposed in Message #701408 prior to send it to XMLTOCURSOR(). Your reencoder string should be something like:
   m.lcReencoder = [<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">] + NL +;
            [<xsl:output method="xml" ] +;
            [encoding="] + LOWER(ALLTRIM(m.tcTargetEncoding)) + [" ] +;
            [omit-xml-declaration="no" indent="yes"/> ] + NL +;
            [<xsl:template match="/ | @* | node()">] + NL +;
            [<xsl:copy>] + NL +;
            [<xsl:apply-templates select="@* | node()"/>] + NL +;
            [</xsl:copy>] + NL +;
            [</xsl:template>] + NL +;
            [<xsl:template match="date_in">] + NL +;
            [<xsl:element name="date_in">] + ;
            [<xsl:value-of select="substring(current(),1,10)"/>] + ;
            [</xsl:element>] + NL +;
            [</xsl:template>] + NL +;
            [</xsl:stylesheet>] + NL
The transformation core is the substringing of first 10 characters in the datetime field.
----------------------------------
António Tavares Lopes
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform