ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* XML & ConTeXt -- handling many conventions
@ 2003-09-09 12:56 Pawel Jackowski na WP
  2003-09-11  4:27 ` Guy Worthington
  0 siblings, 1 reply; 4+ messages in thread
From: Pawel Jackowski na WP @ 2003-09-09 12:56 UTC (permalink / raw)


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ł

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: XML & ConTeXt -- handling many conventions
  2003-09-09 12:56 XML & ConTeXt -- handling many conventions Pawel Jackowski na WP
@ 2003-09-11  4:27 ` Guy Worthington
  2003-09-11  5:28   ` Pawel Jackowski na Onet
  2003-09-13 21:43   ` Hans Hagen
  0 siblings, 2 replies; 4+ messages in thread
From: Guy Worthington @ 2003-09-11  4:27 UTC (permalink / raw)


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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Re: XML & ConTeXt -- handling many conventions
  2003-09-11  4:27 ` Guy Worthington
@ 2003-09-11  5:28   ` Pawel Jackowski na Onet
  2003-09-13 21:43   ` Hans Hagen
  1 sibling, 0 replies; 4+ messages in thread
From: Pawel Jackowski na Onet @ 2003-09-11  5:28 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Re: XML & ConTeXt -- handling many conventions
  2003-09-11  4:27 ` Guy Worthington
  2003-09-11  5:28   ` Pawel Jackowski na Onet
@ 2003-09-13 21:43   ` Hans Hagen
  1 sibling, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2003-09-13 21:43 UTC (permalink / raw)
  Cc: ntg-context

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
-------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-09-13 21:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-09 12:56 XML & ConTeXt -- handling many conventions Pawel Jackowski na WP
2003-09-11  4:27 ` Guy Worthington
2003-09-11  5:28   ` Pawel Jackowski na Onet
2003-09-13 21:43   ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).