Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Macxml class not sorting numerical fields
Message
De
18/05/2001 13:38:54
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Titre:
Macxml class not sorting numerical fields
Divers
Thread ID:
00508863
Message ID:
00508863
Vues:
63
I try to use Erik Moore macxml class from file area.
It allows sorting of output table by clicking in column header.

However, sorting in numerical column sorts alphapedically !
I got

1
10
2
20

etc. order on numeric data !

To fix this, I changet a xmltable method to include data types.
However, the sorting remains wrong. Why ?

changed macxml.xmltable() method:
LPARA taHeaders, tcTableTags

LOCAL lcOutput
lcOutput = ""

IF EMPTY(tcTableTags)
  tcTableTags = [ BORDER="1" CELLSPACING="0"  style="font:8pt Verdana"]
  ENDIF

lcOutput = THIS.CreateSortScripts(ALIAS()) + CR

* Added code to create DTD
lcOutput = lcOutput + [<xml id="] + LOWER(ALIAS()) + [dtd" >] + CR
lcOutput = lcOutput + "<!DOCTYPE cursors [" + CR + ;
        '<!ELEMENT cursors ' + ' (' + alias() + ')>'  + CR
lcOutput = lcOutput + ;
    this.CreateDataStructureDTD(alias())+CR
lcOutput = lcOutput + "] > " + CR + CR
lcOutput = lcOutput + [</xml>] + CR + CR

lcOutput = lcOutput + [<xml id="] + LOWER(ALIAS()) + [style" >] + CR
lcOutput = lcOutput + THIS.CreateCursorXSL(@taHeaders, tcTabletags, .T.) + CR
lcOutput = lcOutput + [</xml>] + CR + CR

lcOutput = lcOutput + [<xml id="] + LOWER(ALIAS()) + [">] + CR
lcOutput = lcOutput + CHR(9) + [<cursors>] + CR
lcOutput = lcOutput + THIS.CreateCursorXML(ALIAS(),,2) + CR
lcOutput = lcOutput + CHR(9) + [</cursors>] + CR
lcOutput = lcOutput + [</xml>] + CR + CR

lcOutput = lcOutput + [<DIV id="] + LOWER(ALIAS()) + [target"></DIV>] + CR

RETURN lcOutput
Andrus
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform