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.

Reply via email to