ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: ntg-context@ntg.nl
Subject: Re: processing xml in mkiv
Date: Sun, 16 Mar 2008 14:56:26 +0100	[thread overview]
Message-ID: <20080316145626.4f379df1.schuster.wolfgang@googlemail.com> (raw)
In-Reply-To: <DA084D0B-9297-4FFC-919E-DD10186F1548@uni-bonn.de>

> > 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.
> >
> 
> OK, then this is a bug. The declaration has to be on the first line,  
> my editor (emacs in nxml mode) doesn't even let me save the file when  
> I introduce a first blank line before it.

No problems with Scite or EmEditor.

> >>>> \xmlprocess{main}{filename.xml}{} works for me.
> 
> Yes, but that would mean you need an environment for every xml file  
> you want to process. I have now tried
> \xmlprocess{main}{\inputfilename}{}
> 
> and this seems to work.
> 
> >> \startxmlsetups xml:section
> >> \section{\xmlatt{#1}{section}{title}}
> >> \stopxmlsetups
> >
> > \startxmlsetups xml:section
> > \section{\xmlatt{#1}{section}{title}}
> > \xmlflush{#1}
> > \stopxmlsetups
> 
> Thanks! I experimented a bit more; I think it has to be
> 
> \startxmlsetups xml:section
> \section{\xmlatt{#1}{title}}
> \xmlflush{#1}
> \stopxmlsetups
> 
> (at least, this seems to work for me...)

I did the same thing in my example but forgot it in my last mail.

> >> \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)
> > ]>
> 
> Hmm, but this isn't valid xml?

I know but it could help to find the wrong definition in the xml parser.

> > but the next one
> >
> > <!DOCTYPE document [
> > <!ELEMENT section (p)>
> > ]>
> 
> Whereas this is valid and processed without problems by mkii?

You should know, MkII read the xml code with TeX macros whereas MkIV
use lpeg to read the xml code.

> Hmm, either mkiv xml handling is still a bit immature, or I'm not  
> mature enough to use it yet :-)

The MkIV is new and still under development, tests like your one help
to find errors and to fix them.

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
___________________________________________________________________________________


  reply	other threads:[~2008-03-16 13:56 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
2008-03-16 13:40       ` Thomas A. Schmitz
2008-03-16 13:56         ` Wolfgang Schuster [this message]
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=20080316145626.4f379df1.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).