how to write schema that fits my needs and is clean and efficient. I'm trying to write a schema for report generation using xsl-fo. The data may come from different sources so a middle layer is needed. An report contains mostly tables, graphs, sometimes other data records. Different reports may have same data but different presentations which in turn requires the data organization to be different, so that the xsl processing could be easier and faster. I'm looking for an advice.
Eclipse BIRT is damn good! 我没用过这样的报表生成工具，然而我们如果可以只创建一系列 data source (!! 竟然把 data source 和 DB 都作为组件，那样的拖来拖去)和 template，我们现在这样辛辛苦苦地手写 fo + svg 还有什么意思.. 不瞒诸位，看了那个视频，都为自己如此初级的工作而悲哀了。
然而还是要看看他们的 schema 有多少可以借鉴的地方。有大约十种左右的 chart。也定义了 table 和 list。定位非常灵活！
一篇很有好处的文章，至少我知道了天下还有 xs:group 这种东西，果然让唯一两个“集合”节点更像集合了。
XML Schema best practices
几个和 graph/chart 有关的 schema。实际上，XML 的应用并没有想象中那么多，特别是很难找到 schema
关于 element 和 attribute 的取舍。看来 coverpages 网站很有名啊！
有本书叫做 Definitive XML Schema，PrintiseHall；与 O'Relly 的 XML Schema 不知道哪个更好？
那个 Eclipse BIRT report 的视频下载：
BIRT is an Eclipse-based open source reporting system for web applications, especially those based on Java and J2EE. BIRT has two main components: a report designer based on Eclipse, and a runtime component that you can add to your app server. BIRT also offers a charting engine that lets you add charts to your own application. The current released version is 2.1.1. We encourage you to download BIRT, try it, and give us your feedback though the newsgroups and Bugzilla.
With BIRT, you can add a rich variety of reports to your application.
* Lists - The simplest reports are lists of data. As the lists get longer, you can add grouping to organize related data together (orders grouped by customer, products grouped by supplier). If your data is numeric, you can easily add totals, averages and other summaries.
* Charts - Numeric data is much easier to understand when presented as a chart. BIRT provides pie charts, line & bar charts and many more. BIRT charts can be rendered in SVG and support events to allow user interaction.
* Crosstabs - Crosstabs (also called a cross-tabulation or matrix) shows data in two dimensions: sales per quarter or hits per web page. (Crosstabs are not yet in Release 2.1.1, but are planned for a future release.)
* Letters & Documents - Notices, form letters, and other textual documents are easy to create with BIRT. Documents can include text, formatting, lists, charts and more.
* Compound Reports - Many reports need to combine the above into a single document. For example, a customer statement may list the information for the customer, provide text about current promotions, and provide side-by-side lists of payments and charges. A financial report may include disclaimers, charts, tables all with extensive formatting that matches corporate color schemes.
The Anatomy of a Report
BIRT reports consist of four main parts: data, data transforms, business logic and presentation.
* Data - Databases, web services, Java objects all can supply data to your BIRT report. Release 2.1.1 provides JDBC and XML support, as well as support for using code to get at other sources of data. BIRT's use of the Open Data Access (ODA) framework allows anyone to build new UI and runtime support for any kind of tabular data. Further, a single report can include data from any number of data sources. BIRT also supplies a feature that allows disparate data sources to be combined using inner and outer joins.
* Data Transforms - Reports present data sorted, summarized, filtered and grouped to fit the user's needs. While databases can do some of this work, BIRT must do it for "simple" data sources such as flat files or Java objects. BIRT allows sophisticated operations such as grouping on sums, percentages of overall totals and more.
* Presentation - Once the data is ready, you have a wide range of options for presenting it to the user. Tables, charts, text and more. A single data set can appear in multiple ways, and a single report can present data from multiple data sets.
其中，Data Transform 是对一张表的操作，而 Business Logic 可以视为对多张表交叉操作。
BIRT 可以把数据库、转换、输出紧密地组合在一起，在单一的 XML 配置文件中包含了数据库配置、操作包括 SQL 和 ECMAScript、定位布局、表/图等等的显示属性，真是太强大了！