* Re: ConTeXt XML question
[not found] <Pine.LNX.4.44.0204121443200.28909-100000@mars.physik.fu-be rlin.de>
@ 2002-04-12 13:56 ` Hans Hagen
2002-04-12 14:45 ` Tobias Burnus
0 siblings, 1 reply; 15+ messages in thread
From: Hans Hagen @ 2002-04-12 13:56 UTC (permalink / raw)
Cc: ntg-context
At 02:45 PM 4/12/2002 +0200, you wrote:
>Hi,
>
>(Sorry for the only half send text I had mailer problems. I did a copy and
>past, but there must have been a ^X somewhere in between.)
>
>I somehow have problems with \XMLpar
>
>I have
> <url href="foo">bar</url>
> <url>http://www.bar</url>
>In the first case I want to get a link with the destination given in
>href.
>In the second case I want to get a link with the same destination as the
><url> enclosed text.
>But I get in both cases HREF:foo. If I switch the order I get "XXXX" and
>then "foo"which I had expected. (ConTeXt ver: 2002.3.4)
>
>I tried:
>\def\Url[#1]#2{{HREF:#1 URL:#2}}
>\defineXMLargument[url]{\Url[\XMLpar{url}{href}{XXXX}]}
\define...[url]{\expanded{\URL....}..
so, by expanding you fix the values
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] 15+ messages in thread
* Re: ConTeXt XML question
2002-04-12 13:56 ` ConTeXt XML question Hans Hagen
@ 2002-04-12 14:45 ` Tobias Burnus
2002-04-12 15:13 ` Hans Hagen
2002-04-12 19:02 ` Michael Wiedmann
0 siblings, 2 replies; 15+ messages in thread
From: Tobias Burnus @ 2002-04-12 14:45 UTC (permalink / raw)
Hi,
Hans Hagen schrieb:
> >I have
> > <url href="foo">bar</url>
> > <url>http://www.bar</url>
> >In the first case I want to get a link with the destination given in
> >href.
> >I tried:
> >\def\Url[#1]#2{{HREF:#1 URL:#2}}
> >\defineXMLargument[url]{\Url[\XMLpar{url}{href}{XXXX}]}
> \define...[url]{\expanded{\URL....}..
> so, by expanding you fix the values
It still doesn't seem to work :-(
---------------- This -----------------
\def\Url[#1]#2{Href:#1 / text:#2}
%\def\Url#1{{\useURL[foo][[\XMLpar{url}{href}{#1}]\goto{\url[foo]}[url(#1)]}}
\defineXMLargument[url]{\expanded\Url[\XMLpar{url}{href}{DEFAULT}]}
\starttext
\startXMLdata
<url>a link</url>
<url href="foo">another</url>
<url>a third</url>
\stopXMLdata
\stoptext
------------- produces ----------------
Href:DEFAULT / text:a link Href:foo / text:another Href:foo / text:a
third
I have three additional problems (with version 2002.3.27/beta):
* In the bookmarks/documentinfo of Acrobat Reader the umlauts are
followed by {}, e.g.
Eine Ü{}bersicht
* clicking on a link, the page is "fitted to window"
how can I set it to e.g. fit to width?
(as openaction, I know how to do so, but for links/bookmarks?)
* How can I set the keywords part of Acrobat's "Document Info"?
Since our indexer can use this information, I'd like to use it.
Tobias
--
This above all: To thine own self be true / And it must follow as
the night the day / Thou canst not then be false to any man.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: ConTeXt XML question
2002-04-12 14:45 ` Tobias Burnus
@ 2002-04-12 15:13 ` Hans Hagen
2002-04-12 16:08 ` Tobias Burnus
2002-04-12 19:02 ` Michael Wiedmann
1 sibling, 1 reply; 15+ messages in thread
From: Hans Hagen @ 2002-04-12 15:13 UTC (permalink / raw)
Cc: NTG-ConTeXt
At 04:45 PM 4/12/2002 +0200, Tobias Burnus wrote:
>Hi,
>
>Hans Hagen schrieb:
> > >I have
> > > <url href="foo">bar</url>
> > > <url>http://www.bar</url>
> > >In the first case I want to get a link with the destination given in
> > >href.
> > >I tried:
> > >\def\Url[#1]#2{{HREF:#1 URL:#2}}
> > >\defineXMLargument[url]{\Url[\XMLpar{url}{href}{XXXX}]}
> > \define...[url]{\expanded{\URL....}..
> > so, by expanding you fix the values
>
>It still doesn't seem to work :-(
>---------------- This -----------------
>\def\Url[#1]#2{Href:#1 / text:#2}
>%\def\Url#1{{\useURL[foo][[\XMLpar{url}{href}{#1}]\goto{\url[foo]}[url(#1)]}}
>\defineXMLargument[url]{\expanded\Url[\XMLpar{url}{href}{DEFAULT}]}
\expanded{\somecommand stuff to expand}
so, expanded takes an argument! and the first thing in there is not
expanded, you forgot the {}
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] 15+ messages in thread
* Re: ConTeXt XML question
2002-04-12 15:13 ` Hans Hagen
@ 2002-04-12 16:08 ` Tobias Burnus
2002-04-13 18:29 ` Hans Hagen
0 siblings, 1 reply; 15+ messages in thread
From: Tobias Burnus @ 2002-04-12 16:08 UTC (permalink / raw)
Cc: NTG-ConTeXt
Hi,
> >\def\Url[#1]#2{Href:#1 / text:#2}
> >\defineXMLargument[url]{\expanded\Url[\XMLpar{url}{href}{DEFAULT}]}
> \expanded{\somecommand stuff to expand}
> so, expanded takes an argument! and the first thing in there is not
> expanded, you forgot the {}
%This should be ok, I think
\def\Url[#1]#2{Href:#1 / text:#2}
% Now I have \expanded{\Url} it should work, shouldn't it?
\defineXMLargument[url]\expanded{\Url[\XMLpar{url}{href}{DEFAULT}]}
But I still get:
Href:DEFAULT / text:ONE Href:foo / text:TWO Href:foo / text:TREE
--- should be TREE---^^^
using
<url>ONE</url> <url href="foo">TWO</url> <url>TREE</url>
Tobias
--
This above all: To thine own self be true / And it must follow as
the night the day / Thou canst not then be false to any man.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: ConTeXt XML question
2002-04-12 14:45 ` Tobias Burnus
2002-04-12 15:13 ` Hans Hagen
@ 2002-04-12 19:02 ` Michael Wiedmann
2002-04-13 19:11 ` Hans Hagen
2002-04-15 9:37 ` Nigel King
1 sibling, 2 replies; 15+ messages in thread
From: Michael Wiedmann @ 2002-04-12 19:02 UTC (permalink / raw)
Cc: NTG-ConTeXt
* Tobias Burnus <burnus@gmx.de> [020412 16:45]:
...
> * clicking on a link, the page is "fitted to window"
> how can I set it to e.g. fit to width?
> (as openaction, I know how to do so, but for links/bookmarks?)
Did you try:
\setupinteractionscreen[width=fit]
> * How can I set the keywords part of Acrobat's "Document Info"?
> Since our indexer can use this information, I'd like to use it.
I'm also interested in a solution for this, because I tried
\setupinteraction[keywords=keyword1 keyword2,
...
]
without success :-(
Michael
--
mw@miwie.in-berlin.de http://www.miwie.org
mw@miwie.org
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: ConTeXt XML question
2002-04-12 16:08 ` Tobias Burnus
@ 2002-04-13 18:29 ` Hans Hagen
2002-04-14 14:13 ` Tobias Burnus
0 siblings, 1 reply; 15+ messages in thread
From: Hans Hagen @ 2002-04-13 18:29 UTC (permalink / raw)
Cc: NTG-ConTeXt
At 06:08 PM 4/12/2002 +0200, Tobias Burnus wrote:
>Hi,
>
> > >\def\Url[#1]#2{Href:#1 / text:#2}
> > >\defineXMLargument[url]{\expanded\Url[\XMLpar{url}{href}{DEFAULT}]}
> > \expanded{\somecommand stuff to expand}
> > so, expanded takes an argument! and the first thing in there is not
> > expanded, you forgot the {}
>
>%This should be ok, I think
>\def\Url[#1]#2{Href:#1 / text:#2}
>
>% Now I have \expanded{\Url} it should work, shouldn't it?
>\defineXMLargument[url]\expanded{\Url[\XMLpar{url}{href}{DEFAULT}]}
>
>But I still get:
> Href:DEFAULT / text:ONE Href:foo / text:TWO Href:foo / text:TREE
> --- should be TREE---^^^
>using
> <url>ONE</url> <url href="foo">TWO</url> <url>TREE</url>
Ah, i see:
\def\TobiasURL#1{\doifsomething{#1}{URL:#1}{no url given}}
\defineXMLargument[url]\TobiasURL
it's element content, not an attribute!
alternatively you can do an
\defineXMLenvironmentsave [url]
{\XMLerase{url}}
{so something with \XMLdata{url} ...}
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] 15+ messages in thread
* Re: ConTeXt XML question
2002-04-12 19:02 ` Michael Wiedmann
@ 2002-04-13 19:11 ` Hans Hagen
2002-04-15 13:16 ` Slawek Zak
2002-04-15 9:37 ` Nigel King
1 sibling, 1 reply; 15+ messages in thread
From: Hans Hagen @ 2002-04-13 19:11 UTC (permalink / raw)
Cc: Tobias Burnus, NTG-ConTeXt
At 09:02 PM 4/12/2002 +0200, Michael Wiedmann wrote:
>* Tobias Burnus <burnus@gmx.de> [020412 16:45]:
>...
> > * clicking on a link, the page is "fitted to window"
> > how can I set it to e.g. fit to width?
> > (as openaction, I know how to do so, but for links/bookmarks?)
>
>Did you try:
>
>\setupinteractionscreen[width=fit]
>
> > * How can I set the keywords part of Acrobat's "Document Info"?
> > Since our indexer can use this information, I'd like to use it.
>
>I'm also interested in a solution for this, because I tried
>
>\setupinteraction[keywords=keyword1 keyword2,
> ...
since this has been requested before we've reached a critical mass -)
next release will have
keyword=...
(singular but one may give a,b,c,d)
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] 15+ messages in thread
* Re: ConTeXt XML question
2002-04-13 18:29 ` Hans Hagen
@ 2002-04-14 14:13 ` Tobias Burnus
2002-04-14 15:19 ` Tobias Burnus
2002-04-14 20:15 ` Hans Hagen
0 siblings, 2 replies; 15+ messages in thread
From: Tobias Burnus @ 2002-04-14 14:13 UTC (permalink / raw)
Cc: NTG-ConTeXt
Hi Hans,
> Ah, i see:
> \def\TobiasURL#1{\doifsomething{#1}{URL:#1}{no url given}}
> \defineXMLargument[url]\TobiasURL
> it's element content, not an attribute!
Well that's not exactly what I want.
I try another example (see "XML in ConTeXt", page 13):
-------------------------------------
\version[temporary]
\defineXMLenvironment [text] {\starttext} {\stoptext}
\defineXMLargument [title] {\chapter[\XMLpar{title}{label}{}]}
\defineXMLgrouped [tt] {\tt}
\startXMLdata
<title>First chapter</title>
<title label="second">Second chapter</title>
<title>Third Chapter</title>
<?context-command {See also \in{chapter}[second]} ?>
\stopXMLdata
\bye
-------------------------------------
In this case I get the warning:
references : duplicate reference [][second] on page 3 (test2)
That is I get behind the scenes:
\chapter[]{First Chapter}
\chapter[second]{Second Chapter}
\chapter[second]{Third Chapter}
But the latter should be '[]' not '[second]'
* * *
Back to my problem. The URL syntax I need to use is:
<url>http://www.foo.com</url>
and
<url href="http://www.bar.com">The best Bar on the planet</url>
This should produce a
\goto{http://www.foo.com}[url(http://www.foo.com)]
and
\goto{The best Bar on the planet}[url(http://www.bar.com)]
respectively.
(The reason is that <url> gets usually a URL (=>use element content),
but sometimes only a descriptive content (=> then use the href
attribute).)
This fails since as soon a {url}{href} is set, it doesn't get reset
anywhere.
I need something like a \XMLeraseAttribute{url}{href}.
By the way I tried the \XMLdata{url} and it produced always "url" as
output. But that's another bug.
Tobias
--
This above all: To thine own self be true / And it must follow as
the night the day / Thou canst not then be false to any man.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: ConTeXt XML question
2002-04-14 14:13 ` Tobias Burnus
@ 2002-04-14 15:19 ` Tobias Burnus
2002-04-14 20:17 ` Hans Hagen
2002-04-14 20:15 ` Hans Hagen
1 sibling, 1 reply; 15+ messages in thread
From: Tobias Burnus @ 2002-04-14 15:19 UTC (permalink / raw)
Hi,
> I need something like a \XMLeraseAttribute{url}{href}.
Ok. I found a solution:
\unprotect
\def\XMLeraseattr#1#2{\@EA\let\csname\@@XMLvariable:#1:#2\endcsname\undefined}
\protect
\setupcolors[state=start]
\setupinteraction[state=start, color=blue]
\def\Url#1{%
\useURL[c][#1]%
\useURL[h][\XMLpar{url}{href}{#1}]%
\goto{\url[c]}[url(h)]%
\XMLeraseattr{url}{href}%
}
\defineXMLargument[url]\Url
\starttext
\startXMLdata
<url>ONE</url>
<url href="foo">TWO</url>
<url>TREE</url>
\stopXMLdata
\stoptext
--
This above all: To thine own self be true / And it must follow as
the night the day / Thou canst not then be false to any man.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: ConTeXt XML question
2002-04-14 14:13 ` Tobias Burnus
2002-04-14 15:19 ` Tobias Burnus
@ 2002-04-14 20:15 ` Hans Hagen
1 sibling, 0 replies; 15+ messages in thread
From: Hans Hagen @ 2002-04-14 20:15 UTC (permalink / raw)
Cc: NTG-ConTeXt
At 04:13 PM 4/14/2002 +0200, Tobias Burnus wrote:
>I try another example (see "XML in ConTeXt", page 13):
>-------------------------------------
>\version[temporary]
>
>\defineXMLenvironment [text] {\starttext} {\stoptext}
>\defineXMLargument [title] {\chapter[\XMLpar{title}{label}{}]}
>\defineXMLgrouped [tt] {\tt}
>
>\startXMLdata
><title>First chapter</title>
><title label="second">Second chapter</title>
><title>Third Chapter</title>
><?context-command {See also \in{chapter}[second]} ?>
>\stopXMLdata
Ah, then why not init the attribute each time and use the shorter \XMLop
(own parameter):
\defineXMLargument [title] [label=] {\chapter[\XMLop{label}]}
best combine this with:
\setuphead[chapter][expansion=yes]
An unreadable alternative (just illustrating expansion is):
\defineXMLenvironmentpush [title] [label=]
{}
{\expanded{\chapter[\XMLop{label}]{\XMLflush{title}}}}
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] 15+ messages in thread
* Re: ConTeXt XML question
2002-04-14 15:19 ` Tobias Burnus
@ 2002-04-14 20:17 ` Hans Hagen
0 siblings, 0 replies; 15+ messages in thread
From: Hans Hagen @ 2002-04-14 20:17 UTC (permalink / raw)
Cc: NTG-ConTeXt
At 05:19 PM 4/14/2002 +0200, Tobias Burnus wrote:
>Hi,
>
> > I need something like a \XMLeraseAttribute{url}{href}.
>
>Ok. I found a solution:
>
>\unprotect
>\def\XMLeraseattr#1#2{\@EA\let\csname\@@XMLvariable:#1:#2\endcsname\undefined}
>\protect
maybe i should indeed add such an eraser
>\setupcolors[state=start]
>\setupinteraction[state=start, color=blue]
>
>\def\Url#1{%
> \useURL[c][#1]%
> \useURL[h][\XMLpar{url}{href}{#1}]%
> \goto{\url[c]}[url(h)]%
> \XMLeraseattr{url}{href}%
>}
>\defineXMLargument[url]\Url
sorry for misunderstanding you requirement, this it the way:
\defineXMLargument [url] [href=] \Url
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] 15+ messages in thread
* Re: ConTeXt XML question
2002-04-12 19:02 ` Michael Wiedmann
2002-04-13 19:11 ` Hans Hagen
@ 2002-04-15 9:37 ` Nigel King
1 sibling, 0 replies; 15+ messages in thread
From: Nigel King @ 2002-04-15 9:37 UTC (permalink / raw)
>> * clicking on a link, the page is "fitted to window"
>> how can I set it to e.g. fit to width?
>> (as openaction, I know how to do so, but for links/bookmarks?)
> \setupinteractionscreen[width=fit]
This command gives a different sized paper (wider 261.4x297 rather than A4)
and does not do what Tobias and I wanted ie fitting to width.
Thanks
--
Nigel
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: ConTeXt XML question
2002-04-13 19:11 ` Hans Hagen
@ 2002-04-15 13:16 ` Slawek Zak
0 siblings, 0 replies; 15+ messages in thread
From: Slawek Zak @ 2002-04-15 13:16 UTC (permalink / raw)
Sat, Apr 13, 2002 at 09:11:35PM +0200, Hans Hagen wrote:
> At 09:02 PM 4/12/2002 +0200, Michael Wiedmann wrote:
> >* Tobias Burnus <burnus@gmx.de> [020412 16:45]:
> >...
> > > * clicking on a link, the page is "fitted to window"
> > > how can I set it to e.g. fit to width?
> > > (as openaction, I know how to do so, but for links/bookmarks?)
> >
> >Did you try:
> >
> >\setupinteractionscreen[width=fit]
> >
> > > * How can I set the keywords part of Acrobat's "Document Info"?
> > > Since our indexer can use this information, I'd like to use it.
> >
> >I'm also interested in a solution for this, because I tried
> >
> >\setupinteraction[keywords=keyword1 keyword2,
Why do you want to put this in setupinteractionscreen? It doesn't
belong to interaction in any way. Why not make it separate macro? Say
\setuppdfoutput[...].
BTW, keywords can already be defined anyway with pdftex's \pdfinfo as most of
you probably know. But it is not `The ConTeXt way' of doing it, that's for
sure ;)
/S
^ permalink raw reply [flat|nested] 15+ messages in thread
* ConTeXt XML question
@ 2002-04-12 12:45 Tobias Burnus
0 siblings, 0 replies; 15+ messages in thread
From: Tobias Burnus @ 2002-04-12 12:45 UTC (permalink / raw)
Hi,
(Sorry for the only half send text I had mailer problems. I did a copy and
past, but there must have been a ^X somewhere in between.)
I somehow have problems with \XMLpar
I have
<url href="foo">bar</url>
<url>http://www.bar</url>
In the first case I want to get a link with the destination given in
href.
In the second case I want to get a link with the same destination as the
<url> enclosed text.
But I get in both cases HREF:foo. If I switch the order I get "XXXX" and
then "foo"which I had expected. (ConTeXt ver: 2002.3.4)
I tried:
\def\Url[#1]#2{{HREF:#1 URL:#2}}
\defineXMLargument[url]{\Url[\XMLpar{url}{href}{XXXX}]}
Tobias
--
This above all: To thine own self be true / And it must follow as
the night the day / Thou canst not then be false to any man.
^ permalink raw reply [flat|nested] 15+ messages in thread
* ConTeXt XML question
@ 2002-04-12 12:43 Tobias Burnus
0 siblings, 0 replies; 15+ messages in thread
From: Tobias Burnus @ 2002-04-12 12:43 UTC (permalink / raw)
Hi,
I somehow have problems with \XMLpar
I have
<url href="foo">bar</url>
<url>http://www.bar</url>
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2002-04-15 13:16 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <Pine.LNX.4.44.0204121443200.28909-100000@mars.physik.fu-be rlin.de>
2002-04-12 13:56 ` ConTeXt XML question Hans Hagen
2002-04-12 14:45 ` Tobias Burnus
2002-04-12 15:13 ` Hans Hagen
2002-04-12 16:08 ` Tobias Burnus
2002-04-13 18:29 ` Hans Hagen
2002-04-14 14:13 ` Tobias Burnus
2002-04-14 15:19 ` Tobias Burnus
2002-04-14 20:17 ` Hans Hagen
2002-04-14 20:15 ` Hans Hagen
2002-04-12 19:02 ` Michael Wiedmann
2002-04-13 19:11 ` Hans Hagen
2002-04-15 13:16 ` Slawek Zak
2002-04-15 9:37 ` Nigel King
2002-04-12 12:45 Tobias Burnus
-- strict thread matches above, loose matches on Subject: below --
2002-04-12 12:43 Tobias Burnus
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).