From: Hans Hagen <pragma@wxs.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: two small questions about the mkiv roadmap
Date: Fri, 02 May 2008 08:50:03 +0200 [thread overview]
Message-ID: <481AB99B.3030104@wxs.nl> (raw)
In-Reply-To: <115224fb0805010212q7957b90chfad40b772082767d@mail.gmail.com>
Wolfgang Schuster wrote:
> On Thu, May 1, 2008 at 11:00 AM, Thomas A. Schmitz
> <thomas.schmitz@uni-bonn.de> wrote:
>> On Apr 30, 2008, at 6:10 PM, Hans Hagen wrote:
>>
>> > Wolfgang Schuster wrote:
>> >
>> >> The DTD is a problem with the ConTeXts XML parser and has
>> >> nothing to do with LuaTeX (hope this is right).
>> >
>> > i need a test file then (can look into it next week; i'm at bachotek
>> > now)
>>
>> OK, I hope this is a minimal test: I have this xml file (which, I
>> think, is valid xml):
>
> \startbuffer[test]
>> <?xml version="1.0" encoding="utf-8"?>
>> <!DOCTYPE context [
>> <!ELEMENT document (section)>
>> <!ELEMENT section (title,content)>
>> <!ELEMENT title (#PCDATA)>
>> <!ELEMENT content (#PCDATA)>
>> <!ENTITY ndash "–">
>> ]>
>>
>> <document>
>> <section>
>> <title>The Title</title>
>> <content>
>> <p>A line of text – with a dash.</p>
>> </content>
>> </section>
>> </document>
> \stopbuffer
>
>> and this environment myenv.tex:
>>
>> \startxmlsetups xml:mysetups
>> \xmlsetsetup{\xmldocument}{document|section|}{xml:*}
>> \stopxmlsetups
>>
>> \xmlregistersetup{xml:mysetups}
>>
>> \startxmlsetups xml:document
>> \xmlflush{#1}
>> \stopxmlsetups
>>
>> \startxmlsetups xml:section
>> \section{\xmlfirst{#1}{title}}
>> \xmlfirst{#1}{content}\par
>> \stopxmlsetups
>>
>> \enableregime[utf]
>>
>> \defineXMLentity[ndash]{--}
>>
>> \starttext
>> \xmlprocess{main}{\inputfilename}{}
> \xmlprocessbuffer{main}{est}{}
>> \stoptext
>
> Easier for test because you need only one file.
or just (for testing)
mtxrun --script blabla.lua :
str = [[
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE context [
<!ELEMENT document (section)>
<!ELEMENT section (title,content)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT content (#PCDATA)>
<!ENTITY ndash "–">
]>
<document>
<section>
<title>The Title</title>
<content>
<p>A line of text – with a dash.</p>
</content>
</section>
</document>
]]
x = xml.convert(str)
xml.merge_entities(x)
xml.resolve_entities(x)
print(table.serialize(x))
i fixed the bug but no upload yet; also, i'm still not sure about
merging entities defined in the document
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
| www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________
prev parent reply other threads:[~2008-05-02 6:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-30 7:54 Thomas A. Schmitz
2008-04-30 8:19 ` Wolfgang Schuster
2008-04-30 16:10 ` Hans Hagen
2008-04-30 19:28 ` luigi scarso
2008-05-01 9:00 ` Thomas A. Schmitz
2008-05-01 9:12 ` Wolfgang Schuster
2008-05-01 9:58 ` Thomas A. Schmitz
2008-05-02 6:50 ` Hans Hagen [this message]
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=481AB99B.3030104@wxs.nl \
--to=pragma@wxs.nl \
--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).