From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: ntg-context@ntg.nl
Subject: Re: processing xml in mkiv
Date: Sun, 16 Mar 2008 13:51:06 +0100 [thread overview]
Message-ID: <20080316135106.75223e86.schuster.wolfgang@googlemail.com> (raw)
In-Reply-To: <D78D5598-38F5-42D0-B3E5-22806EE3BF08@uni-bonn.de>
> OK, here is a minimal example:
>
> file test.xml:
>
> <?xml version="1.0" encoding="utf-8"?>
> <!DOCTYPE test [
> <!ELEMENT document (section)>
> <!ELEMENT section (#PCDATA)>
> ]>
>
> <document>
> <section title="First">
> <p>This is <quotation>an</quotation> xml file.</p>
> </section>
> </document>
>
> file testenvironment.tex
>
> \usemodule[xtag-ent]
>
> \defineXMLenvironment[document]
> {\starttext}
> {\stoptext}
>
> \defineXMLenvironment[section]
> {\section{\XMLpar{section}{title}{}}}
> {}
>
> \defineXMLenvironment[quotation]
> {\quotation\bgroup}
> {\egroup}
>
>
> When I process with mkii, I get the expected output. Processing with
>
> texexec --lua --env=testenvironment test.xml
>
> gives me the first line (here it's not an entire page) I described!
This seems like a bug to me. This did only happen with the content in
the first line because I inserted a empty first line at the begin of
the line the xml header disappeared from the pdf, could be related to
a wrong catcode for the "<" at the beginning of the line.
> >> 2. I'm really lost with the new xml mechanism. My first problem: In a
> >> message from September last year, Hans explained that the command to
> >> process xml files is:
> >>
> >>> The regular definitions still work but processing a file is done
> >>> differently:
> >>>
> >>> \xmlprocess{id}{filename}{optional initialization setup}
> >>
> >> I used to have environments with which to typeset a bunch of files.
> >> How can this be ported to the new mechanism, which appears to expect
> >> a filename?
> >
> > \xmlprocess{main}{filename.xml}{} works for me.
>
> I tried to translate this into the "new" mechanism and thought it
> should read like so:
>
> \startxmlsetups xml:mysetups
> \xmlsetsetup{\xmldocument}{text:p|section|quotation}{xml:*}
> \stopxmlsetups
>
> \xmlregistersetup{xml:mysetups}
>
> \startxmlsetups xml:p
> \xmlflush{#1}\endgraf
> \stopxmlsetups
>
> \startxmlsetups xml:quotation
> \quotation{\xmlflush{#1}}
> \stopxmlsetups
>
> \startxmlsetups xml:section
> \section{\xmlatt{#1}{section}{title}}
> \stopxmlsetups
\startxmlsetups xml:section
\section{\xmlatt{#1}{section}{title}}
\xmlflush{#1}
\stopxmlsetups
> \starttext
> \xmlprocess{main}{test.xml}{}
> \stoptext
>
> But then, I only get "invalid xml file" in the output.
Remove the DOCDATA definition from your xml file, seems the parser has
problems with "<>" pairs inside of the DOCDATA definition.
The following line give me a pdf file
<!DOCTYPE document [
<!ELEMENT section (p)
]>
but the next one
<!DOCTYPE document [
<!ELEMENT section (p)>
]>
give only "invalid xml file".
Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
next prev parent reply other threads:[~2008-03-16 12:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-16 10:29 Thomas A. Schmitz
2008-03-16 11:04 ` Wolfgang Schuster
2008-03-16 12:00 ` Thomas A. Schmitz
2008-03-16 12:51 ` Wolfgang Schuster [this message]
2008-03-16 13:40 ` Thomas A. Schmitz
2008-03-16 13:56 ` Wolfgang Schuster
2008-03-16 17:16 ` Hans Hagen
2008-03-17 6:36 ` Thomas A. Schmitz
2008-03-17 13:04 ` Taco Hoekwater
2008-03-18 15:59 ` Thomas A. Schmitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080316135106.75223e86.schuster.wolfgang@googlemail.com \
--to=schuster.wolfgang@googlemail.com \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).