What I would be interested in to learn more about is difference between Office 2003 XML and MSXML. Is one a subset of the other? Or are the APL Grid XML tags proprietary tags only recognized by the APL Grid?
In each case, I noticed that you can not open XML-files saved with Microsoft Excel with the APL Grid and vice versa.
The error is:
APL.Grid exception 80004005 Unexpected tag <Workbook> found outside <grid>.
..</grid> context
Could it make sense to write a parser that translates Office 2003 XML into APL Grid MSXML? Or are there any plans to migrate the APL Grid to Office 2003 XML?
I have written some functions for the APL Grid that rely on MSXML tags but I’m not sure if I should continue in this direction. For instance I have written a function for copying and sorting pages (see below) and also implemented an undo/redo facility using the sXML property of the grid.
grid fmAPL2000_grid_Sort new_order;i;t;xml;ŒELX;ŒWSELF
© sorts pages of grid according to new_order (=vec)
© can also be used to copy pages by doubling the page index in new_order
© MSXML tags are case sensitive (i.e. <page ...> tags are in lowercase letter)
ŒELX „ 'ŒERROR ŒDM'
(ŒWSELF „ grid)ŒWI'xXMLMode'1 © suppress line breaks and identation
xml „ (+\1,1‡((-½xml)†¯7‡'</page>'º(-(²t)¼1)†xml)Ÿt „ ('<page 'ºxml))›xml „ ŒWI'xXML' © partition pages
xml „ xml[1,(1+new_order),½xml] © new new_order order
:for i :in 1+¼½new_order © update page tag index="1" ...
(iœxml) „ (t†iœxml),(•i-1),(¯1+(t‡iœxml)¼'"')‡(t „ 6+('index="'ºiœxml)¼1)‡iœxml
:endfor
(1œxml) „ (t†1œxml),(•½new_order),(¯1+(t‡1œxml)¼'"')‡(t „ 6+('pages="'º1œxml)¼1)‡1œxml © adjust number of pages
ŒWI'Set'('noredraw'1)('xXML'(¹xml))('noredraw'0)('xXMLMode'0)
ŒWI'Redraw'