XML & ConTeXt -- handling many conventions
Hi! 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> ... But is there any way to handle both conventions in one defnition? Regards, Paweł
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.
Hi!
Hello Pawe³ (I, hope your name comes out OK)[...]
Actually no, but don't worry. I'm aware that polish 'lslash' may not be displayed properly. But using polish characters is the only way to protect them from extinction. I will think about some compromise.
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.
That is what I said to my boss. The problem is that J have to build something more or less universal because I don't known who will prepare XML documents and which convention will be used.
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.
Thanks, I will remember. It looks convincing. Regards, Pawe/l
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 -------------------------------------------------------------------------
participants (4)
-
Guy Worthington
-
Hans Hagen
-
Pawel Jackowski na Onet
-
Pawel Jackowski na WP