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