Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Macxml class not sorting numerical fields
Message
From
18/05/2001 13:38:54
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Internet applications
Title:
Macxml class not sorting numerical fields
Miscellaneous
Thread ID:
00508863
Message ID:
00508863
Views:
62
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
Next
Reply
Map
View

Click here to load this message in the networking platform