It would be straight forward to do -- but why?
Do you have some XML "UI" description from somewhere that you need to implement?
--
+--------------------------------+---------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+
Yes, I need to these xml files to generate dirrefent tables to
interact with tk applications. Or Is there any way out to do so?
Parse the XML with either tdom or tcldom. Walk the tree and generate the Tk
widgets being called for.
If you could point us to descriptions of this XML we may be able to give
better advise.
<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
<Author>dujuan</Author>
<LastAuthor>author_name</LastAuthor>
<Created>2007-08-22T01:02:53Z</Created>
<Company>xxx</Company>
<Version>11.5606</Version>
</DocumentProperties>
<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
<WindowHeight>12105</WindowHeight>
<WindowWidth>15225</WindowWidth>
<WindowTopX>480</WindowTopX>
<WindowTopY>45</WindowTopY>
<ProtectStructure>False</ProtectStructure>
<ProtectWindows>False</ProtectWindows>
</ExcelWorkbook>
<Styles>
<Style ss:ID="Default" ss:Name="Normal">
<Alignment ss:Vertical="Bottom"/>
<Borders/>
<Font/>
<Interior/>
<NumberFormat/>
<Protection/>
</Style>
</Styles>
<Worksheet ss:Name="Sheet1">
<Table ss:ExpandedColumnCount="2" ss:ExpandedRowCount="2"
x:FullColumns="1"
x:FullRows="1">
<Row>
<Cell><Data ss:Type="String">DR</Data></Cell>
<Cell><Data ss:Type="String">DL</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">DR2</Data></Cell>
<Cell><Data ss:Type="String">DL2</Data></Cell>
</Row>
</Table>
<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
<Selected/>
<Panes>
<Pane>
<Number>3</Number>
<ActiveRow>1</ActiveRow>
<ActiveCol>1</ActiveCol>
</Pane>
</Panes>
<ProtectObjects>False</ProtectObjects>
<ProtectScenarios>False</ProtectScenarios>
</WorksheetOptions>
</Worksheet>
<Worksheet ss:Name="Sheet2">
<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
<ProtectObjects>False</ProtectObjects>
<ProtectScenarios>False</ProtectScenarios>
</WorksheetOptions>
</Worksheet>
<Worksheet ss:Name="Sheet3">
<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
<ProtectObjects>False</ProtectObjects>
<ProtectScenarios>False</ProtectScenarios>
</WorksheetOptions>
</Worksheet>
</Workbook>
For example, the above xml file only include a simple table. It has
two coloumns and two rows. I know how to use tdom to parse xml to
output some text, but I don't know how to use it to "Display" table in
another top windows.
set xml_file "$env(UH)\\Book1.xml"
set xml [tDOM::xmlReadFile $xml_file]
puts "tdom::: [time {dom parse $xml} 10]"
Actually I use the above lines to parse a xml file(saved from MS
excel), and it did puts the content in the command console along with
my application. But what I want is to display UI described in the xml
file, not just puts something in the command console.
I found your "problem" so interessting, that I invested some time.
The results you can find at:
There is a sample using the tdom, BWidget and tablelist package to
create tables from the sample XML file you provided here in this
thread.
Much fun!
Best regards,
Martin Lemburg