At 12:27 11/09/2003 +0800, Guy Worthington wrote:
Pawel Jackowski na WP wrote:
There is a lot of ways to build ConTeXt macro which can handle something like i.e:
<chapter title="First Chapter"> ... or
<chapter> <title>First Chapter</title> ...
Hello Pawe³ (I, hope your name comes out OK; I cut & pasted your signature, which on my news-reader looks like "Pawe${}^3$")
The element <chapter title="First Chapter"> is wrong. By burying your title in an attribute you're making it neither easily searchable nor useble by other applications.
Your alternative XML snippet is much better:
<chapter> <title>First Chapter</title> ... </chapter>
The general rule of thumb for when to use attributes and when to use elements is: use elements for presentable data and attributes for system data. In this case where you're presenting the title "First Chapter" to the context-processor to be marked up as a chapter title, it is definitely presentable data, and therefore it belongs in an element.
indeed. concerning attributes, i use 'm for <title label="the first">First Chapter</title> permits you to analyze a label without the need to look into the element text. Hans ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com ------------------------------------------------------------------------- information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf -------------------------------------------------------------------------