ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* typeseting XML
@ 2001-05-16 23:54 Petr Ferdus
  2001-05-18 14:33 ` XML Petr Ferdus
  2002-02-03 19:51 ` typeseting XML Johannes Hüsing
  0 siblings, 2 replies; 7+ messages in thread
From: Petr Ferdus @ 2001-05-16 23:54 UTC (permalink / raw)


Hi,
how could be typeset backslash character parsed from XML stream?
I tryed:

\defineXMLsingular [backslash]  {$\backslash$}

having in XML doc an  empty element <backslash/>, with no success (no
error either, it was just silently discarded). 

Also, would it be possible to have # char in the name of XML entity? Like:

\defineXMLentity [#937] {$\Omega$} %instead of
\defineXMLentity [937] {$\Omega$} 

because it seems to be rather conforming to naming convention of entities
based on unicode position  of its glyph (&#937; in this case).

Thanks very much.

Petr Ferdus


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

* Re:typeseting XML
  2001-05-16 23:54 typeseting XML Petr Ferdus
@ 2001-05-18 14:33 ` Petr Ferdus
  2002-02-03 19:51 ` typeseting XML Johannes Hüsing
  1 sibling, 0 replies; 7+ messages in thread
From: Petr Ferdus @ 2001-05-18 14:33 UTC (permalink / raw)


> \defineXMLsingular [backslash]  {$\backslash$}
> having in XML doc an  empty element <backslash/>, with no success (no
> error either, it was just silently discarded). 
Sorry for bothering, there was a mistake on my side. This setup of course
typesets backslash, just my script was converting to elements everything
but backslashes...

Anyway I have another question. There was a note on direct XML processing
(texexec --env=yourenvironemntfile yourfile.xml) which works partly for me.
I can't force source document translation. I used to have in tex source 
files line like:
%interface=en output=pdf texttranslate=cp1250cs
When I try direct XML processing and have such line in my environment
file, it seems to ignore such directive (I guess, because it produces dvi
file without explicit command line switch). What could be done to inform
context about XML source encoding? (command line swich like
--translate-file=cp1250cs, process instruction or specifying  used
encoding directly in XML source does not seem to help as well) Any input
would be appreciated.

If I can have one more question, I would like see some hints, how to
implement separate handling of XML elements,  based on the value in
key="value" pairs. So if there is an element <p style="a"> what would
process p's separately for every value of style key. Is there some
shareable knowledge? (I can't figure it out with the aid of "example"
manual)
Thanks.

Peter Ferdus


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

* Re: typeseting XML
  2001-05-16 23:54 typeseting XML Petr Ferdus
  2001-05-18 14:33 ` XML Petr Ferdus
@ 2002-02-03 19:51 ` Johannes Hüsing
  2002-02-05  8:26   ` Hans Hagen
  1 sibling, 1 reply; 7+ messages in thread
From: Johannes Hüsing @ 2002-02-03 19:51 UTC (permalink / raw)


Hi all,

coming across a problem with encoding I searched my private 
mailing list archive and found this question:

On Thu, May 17, 2001 at 01:54:54AM +0200, Petr Ferdus wrote:
[...]
> Also, would it be possible to have # char in the name of XML entity? Like:
> 
> \defineXMLentity [#937] {$\Omega$} %instead of
> \defineXMLentity [937] {$\Omega$} 
> 
> because it seems to be rather conforming to naming convention of entities
> based on unicode position  of its glyph (&#937; in this case).
> 

That would be a feature I would value very much. Has this been accomplished 
already? I see ConTeXt in a quite confused state about the hash sign when 
I try the above.

Greetings

Johannes
-- 
Johannes Hüsing   There is something fascinating about science. One gets
hannes@ruhrau.de  such wholesale returns of conjecture from such a 
                  trifling investment of fact.                Mark Twain


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

* Re: typeseting XML
  2002-02-03 19:51 ` typeseting XML Johannes Hüsing
@ 2002-02-05  8:26   ` Hans Hagen
  2002-02-05 13:20     ` Taco Hoekwater
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2002-02-05  8:26 UTC (permalink / raw)
  Cc: ntg-context

At 08:51 PM 2/3/2002 +0100, Johannes Hüsing wrote:
>Hi all,
>
>coming across a problem with encoding I searched my private
>mailing list archive and found this question:
>
>On Thu, May 17, 2001 at 01:54:54AM +0200, Petr Ferdus wrote:
>[...]
> > Also, would it be possible to have # char in the name of XML entity? Like:
> >
> > \defineXMLentity [#937] {$\Omega$} %instead of
> > \defineXMLentity [937] {$\Omega$}
> >
> > because it seems to be rather conforming to naming convention of entities
> > based on unicode position  of its glyph (&#937; in this case).
> >
>
>That would be a feature I would value very much. Has this been accomplished
>already? I see ConTeXt in a quite confused state about the hash sign when
>I try the above.

hashes are very special to tex, and once they end up in macro bodies they 
spontaniously replicate etc etc

i even think (but taco should confirm that) that once the # is in the line 
buffer, there is no way to get rid of the # message

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
-------------------------------------------------------------------------
                                   fall-back web server: 
www.pragma-pod.nl
-------------------------------------------------------------------------


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

* Re: typeseting XML
  2002-02-05  8:26   ` Hans Hagen
@ 2002-02-05 13:20     ` Taco Hoekwater
  2002-02-05 13:57       ` Hans Hagen
  2002-02-05 21:40       ` Johannes Hüsing
  0 siblings, 2 replies; 7+ messages in thread
From: Taco Hoekwater @ 2002-02-05 13:20 UTC (permalink / raw)
  Cc: johannes.huesing, ntg-context

Hi Hans,

Hashes are very weird things, true. But the problem shouldn't occur.
ConTeXt should insert a hashmark behind the scenes as soon as it discovers
that the entity starts with a '9', or balk with an error message
about an invalid entity.

Entities that do not start with # are named entities, as opposed to
character references. And names are not allowed to start with a number.

Therefore, "&937;" is not valid XM. "&#937;" is the correct way.

Allowed alternative notations are "&#x3A9;" and "&#x3a9;".

All may have any number of leading zeroes, and the XML spec also
states that the character referenced itself should be a valid XML character
(so &#9999999; is also illegal)

It would be much cleaner if there was a new command \defineXMLchar,
that takes a number as argument instead of a csname string. Then the
Context XML parser could have support for all of the possible inputs.

Greetings, Taco

On Tue, 05 Feb 2002 09:26:13 +0100
"Hans Hagen" <pragma@wxs.nl> wrote:

> hashes are very special to tex, and once they end up in macro bodies they 
> spontaniously replicate etc etc

-- 
groeten,

Taco


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

* Re: typeseting XML
  2002-02-05 13:20     ` Taco Hoekwater
@ 2002-02-05 13:57       ` Hans Hagen
  2002-02-05 21:40       ` Johannes Hüsing
  1 sibling, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2002-02-05 13:57 UTC (permalink / raw)
  Cc: johannes.huesing, ntg-context

At 02:20 PM 2/5/2002 +0100, Taco Hoekwater wrote:

>Hashes are very weird things, true. But the problem shouldn't occur.

indeed, so Taco (and other tex-hackers), how about this:

\unprotected \def\bla{\bgroup\catcode`\#=\@@ignore\dobla}
\def\dobla[#1]{\egroup\dorecurse{#1}{hello }} \bla[#123]

\unprotected \def\bla{\bgroup\catcode`\#=\@@space\dobla}
\def\dobla[#1]{\egroup\dorecurse{#1}{hello }} \bla[#123]

 > .....

ok, i will look into that later (error messages/recovery and such, since i 
have to look into chars anyway).

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
-------------------------------------------------------------------------
                                   fall-back web server: 
www.pragma-pod.nl
-------------------------------------------------------------------------


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

* Re: typeseting XML
  2002-02-05 13:20     ` Taco Hoekwater
  2002-02-05 13:57       ` Hans Hagen
@ 2002-02-05 21:40       ` Johannes Hüsing
  1 sibling, 0 replies; 7+ messages in thread
From: Johannes Hüsing @ 2002-02-05 21:40 UTC (permalink / raw)


On Tue, Feb 05, 2002 at 02:20:28PM +0100, Taco Hoekwater wrote:
> Therefore, "&937;" is not valid XM. "&#937;" is the correct way.

ok, so for the moment I could just filter out all hash signs of my 
XML source and I'll be fine.

> 
> Allowed alternative notations are "&#x3A9;" and "&#x3a9;".

Yes, and I used hex codes and wrote a small emacs function that 
replaced it by single chars, but after Perl's XML::DOM parsed it
they were turned into decimals :-(

Thanks very much

Johannes
-- 
Johannes Hüsing   There is something fascinating about science. One gets
hannes@ruhrau.de  such wholesale returns of conjecture from such a 
                  trifling investment of fact.                Mark Twain


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

end of thread, other threads:[~2002-02-05 21:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-16 23:54 typeseting XML Petr Ferdus
2001-05-18 14:33 ` XML Petr Ferdus
2002-02-03 19:51 ` typeseting XML Johannes Hüsing
2002-02-05  8:26   ` Hans Hagen
2002-02-05 13:20     ` Taco Hoekwater
2002-02-05 13:57       ` Hans Hagen
2002-02-05 21:40       ` Johannes Hüsing

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