diff options
Diffstat (limited to 'doc/context/sources/general/manuals/xml')
14 files changed, 75 insertions, 230 deletions
diff --git a/doc/context/sources/general/manuals/xml/xml-mkiv-03.xml b/doc/context/sources/general/manuals/xml/xml-mkiv-03.xml new file mode 100644 index 000000000..f565c50b5 --- /dev/null +++ b/doc/context/sources/general/manuals/xml/xml-mkiv-03.xml @@ -0,0 +1,11 @@ +<?xml version='1.0' standalone='yes?> + +<document> + <section> + <title>Some title</title> + <content> + <p>a paragraph of text</p> + <p>another paragraph of text</p> + </content> + </section> +</document> diff --git a/doc/context/sources/general/manuals/xml/xml-mkiv-commands.tex b/doc/context/sources/general/manuals/xml/xml-mkiv-commands.tex index 8d9e9ef47..b9659a4c2 100644 --- a/doc/context/sources/general/manuals/xml/xml-mkiv-commands.tex +++ b/doc/context/sources/general/manuals/xml/xml-mkiv-commands.tex @@ -1,3 +1,5 @@ +% language=us runpath=texruns:manuals/xml + \environment xml-mkiv-style \startcomponent xml-mkiv-commands diff --git a/doc/context/sources/general/manuals/xml/xml-mkiv-contents.tex b/doc/context/sources/general/manuals/xml/xml-mkiv-contents.tex index e0787ec5f..18cda18de 100644 --- a/doc/context/sources/general/manuals/xml/xml-mkiv-contents.tex +++ b/doc/context/sources/general/manuals/xml/xml-mkiv-contents.tex @@ -1,3 +1,5 @@ +% language=us runpath=texruns:manuals/xml + \environment xml-mkiv-style \startcomponent xml-mkiv-contents diff --git a/doc/context/sources/general/manuals/xml/xml-mkiv-converter.tex b/doc/context/sources/general/manuals/xml/xml-mkiv-converter.tex index a457f962b..e3464a57c 100644 --- a/doc/context/sources/general/manuals/xml/xml-mkiv-converter.tex +++ b/doc/context/sources/general/manuals/xml/xml-mkiv-converter.tex @@ -1,3 +1,5 @@ +% language=us runpath=texruns:manuals/xml + \environment xml-mkiv-style \startcomponent xml-mkiv-converter @@ -12,7 +14,7 @@ style with complex chapter openings using data coming from all kind of places, different styling of sections with the same name, selectively (out of order) flushed content, special formatting, etc. -\typefile{manual-demo-1.xml} +\typefile{xml-mkiv-03.xml} Say that this document is stored in the file \type {demo.xml}, then the following code can be used as starting point: diff --git a/doc/context/sources/general/manuals/xml/xml-mkiv-examples.tex b/doc/context/sources/general/manuals/xml/xml-mkiv-examples.tex index 064510d6d..bb3c25187 100644 --- a/doc/context/sources/general/manuals/xml/xml-mkiv-examples.tex +++ b/doc/context/sources/general/manuals/xml/xml-mkiv-examples.tex @@ -1,3 +1,5 @@ +% language=us runpath=texruns:manuals/xml + \environment xml-mkiv-style \startcomponent xml-mkiv-examples @@ -778,7 +780,7 @@ The \XML\ parser is also available outside \TEX. Here is an example of its usage We pipe the result to \TEX\ but you can do with \type {t} whatever you like. \startbuffer -local x = xml.load("manual-demo-1.xml") +local x = xml.load("xml-mkiv-03.xml") local t = { } for c in xml.collected(x,"//*") do @@ -848,7 +850,7 @@ end Usage is as follows: \startbuffer -local x = xml.load("manual-demo-1.xml") +local x = xml.load("xml-mkiv-03.xml") local t = xml.applylpath(x,"//*/taglist()") context.tocontext(t) @@ -863,7 +865,7 @@ And indeed we get: But we can also say: \startbuffer -local x = xml.load("manual-demo-1.xml") +local x = xml.load("xml-mkiv-03.xml") local t = xml.applylpath(x,"//*/taglist(true)") context.tocontext(t) diff --git a/doc/context/sources/general/manuals/xml/xml-mkiv-expressions.tex b/doc/context/sources/general/manuals/xml/xml-mkiv-expressions.tex index b063cab54..fe2670f86 100644 --- a/doc/context/sources/general/manuals/xml/xml-mkiv-expressions.tex +++ b/doc/context/sources/general/manuals/xml/xml-mkiv-expressions.tex @@ -1,3 +1,5 @@ +% language=us runpath=texruns:manuals/xml + \environment xml-mkiv-style \startcomponent xml-mkiv-expressions diff --git a/doc/context/sources/general/manuals/xml/xml-mkiv-filtering.tex b/doc/context/sources/general/manuals/xml/xml-mkiv-filtering.tex index 5bb5a35de..e751435ac 100644 --- a/doc/context/sources/general/manuals/xml/xml-mkiv-filtering.tex +++ b/doc/context/sources/general/manuals/xml/xml-mkiv-filtering.tex @@ -1,3 +1,5 @@ +% language=us runpath=texruns:manuals/xml + \environment xml-mkiv-style \startcomponent xml-mkiv-filtering @@ -35,11 +37,11 @@ conform the indentation in the whole \XML\ file. \footnote {The (probably outdated) \XML\ file contains the collection stores on my slimserver instance. You can use the \type {mtxrun --script flac} to generate such files.} -\doifmodeelse {atpragma} { - \getbuffer -} { +% \doifmodeelse {atpragma} { +% \getbuffer +% } { \typefile{xml-mkiv-01.xml} -} +% } An alternative written in \LUA\ looks as follows: @@ -56,11 +58,11 @@ An alternative written in \LUA\ looks as follows: This produces: -\doifmodeelse {atpragma} { - \getbuffer -} { +% \doifmodeelse {atpragma} { +% \getbuffer +% } { \typefile{xml-mkiv-02.xml} -} +% } You can use both methods mixed but in practice we will use the \TEX\ commands in regular styles and the mixture in modules, for instance in those dealing with diff --git a/doc/context/sources/general/manuals/xml/xml-mkiv-introduction.tex b/doc/context/sources/general/manuals/xml/xml-mkiv-introduction.tex index e7f0124da..9fb8f6462 100644 --- a/doc/context/sources/general/manuals/xml/xml-mkiv-introduction.tex +++ b/doc/context/sources/general/manuals/xml/xml-mkiv-introduction.tex @@ -1,3 +1,5 @@ +% language=us runpath=texruns:manuals/xml + \environment xml-mkiv-style \startcomponent xml-mkiv-introduction diff --git a/doc/context/sources/general/manuals/xml/xml-mkiv-lookups.tex b/doc/context/sources/general/manuals/xml/xml-mkiv-lookups.tex index e6afaa948..9711fc7eb 100644 --- a/doc/context/sources/general/manuals/xml/xml-mkiv-lookups.tex +++ b/doc/context/sources/general/manuals/xml/xml-mkiv-lookups.tex @@ -1,3 +1,5 @@ +% language=us runpath=texruns:manuals/xml + \environment xml-mkiv-style \startcomponent xml-mkiv-lookups diff --git a/doc/context/sources/general/manuals/xml/xml-mkiv-lpath.tex b/doc/context/sources/general/manuals/xml/xml-mkiv-lpath.tex deleted file mode 100644 index 9c8b853c8..000000000 --- a/doc/context/sources/general/manuals/xml/xml-mkiv-lpath.tex +++ /dev/null @@ -1,207 +0,0 @@ -\input lxml-ctx.mkiv - -\ctxlua{dofile("t:/sources/lxml-lpt.lua")} - -\startbuffer[xmltest] -<?xml version='1.0'?> - -<!-- this is a test file --> - -<something id='1'> - <x:whatever id='1.1'> - <whocares id='1.1.1'> - test a - </whocares> - <whocaresnot id='1.1.2'> - test b - </whocaresnot> - </x:whatever> - <whatever id='2'> - <whocares id='2.1'> - test c - </whocares> - <whocaresnot id='2.2'> - test d - </whocaresnot> - </whatever> - <whatever id='3'> - test e - </whatever> - <whatever id='4' test="xxx"> - <whocares id='4.1'> - test f - </whocares> - <whocares id='4.2'> - test g - </whocares> - </whatever> - <whatever id='5' test="xxx"> - <whoknows id='5.1'> - <whocares id='5.1.1'> - test h - </whocares> - </whoknows> - <whoknows id='5.2'> - <whocaresnot id='5.2.1'> - test i - </whocaresnot> - </whoknows> - <whoknows id='5.3'> - <whocares id='5.3.1'> - test j - </whocares> - </whoknows> - </whatever> -</something> -\stopbuffer - -% \enabletrackers[xml.lparse] - -\setuplayout[width=middle,height=middle,header=1cm,footer=1cm,topspace=2cm,backspace=2cm] -\setupbodyfont[10pt] - -\setfalse\xmllshowbuffer - -\starttext - -\xmllshow{/(*:library|figurelibrary)/*:figure/*:label} -\xmllshow{/(*:library|figurelibrary)/figure/*:label} -\xmllshow{/(*:library|figurelibrary)/figure/label} -\xmllshow{/(*:library|figurelibrary)/figure:*/label} - -% \xmllshow{collection[@version='all']/resources/manual[match()==1]/paper/command(xml:overview)} -% \xmllshow{collection/resources/manual[match()=1]/paper/command(xml:overview)} - -% \xmllshow{answer//oeps} -% \xmllshow{answer/*/oeps} -% \xmllshow{answer/**/oeps} -% \xmllshow{answer/***/oeps} -% \xmllshow{answer/x//oeps} -% \xmllshow{answer//x/oeps} -% \xmllshow{//x/oeps} -% \xmllshow{answer/test/*} -% \xmllshow{answer/test/child::} -% \xmllshow{answer/*} -% \xmllshow{ oeps / answer / .. / * [tag()='p' and position()=1 and text()!=''] / oeps()} - -% \xmllshow{ artist / name [text()='Randy Newman'] / .. / albums / album [position()=3] / command(first:demo:two)} -% \xmllshow{/exa:selectors/exa:selector/exa:list/component[count()>1]} - -\stoptext - -\xmllshow{/*} -\xmllshow{child::} -\xmllshow{child::test} -\xmllshow{/test/test} -\xmllshow{../theory/sections/section/exercises} -\xmllshow{../training/practicalassignments} -\xmllshow{../../Outcome[position()=rootposition()]/Condition/command(xml:answer:mc:condition)} - -% \stoptext - -% \typebuffer[xmltest] \page - -\xmllshowbuffer{xmltest}{**}{id} -\xmllshowbuffer{xmltest}{*}{id} -\xmllshowbuffer{xmltest}{..}{id} -\xmllshowbuffer{xmltest}{.}{id} -\xmllshowbuffer{xmltest}{//}{id} -\xmllshowbuffer{xmltest}{/}{id} - -\xmllshowbuffer{xmltest}{**/}{id} -\xmllshowbuffer{xmltest}{**/*}{id} -\xmllshowbuffer{xmltest}{**/.}{id} -\xmllshowbuffer{xmltest}{**//}{id} - -\xmllshowbuffer{xmltest}{*/}{id} -\xmllshowbuffer{xmltest}{*/*}{id} -\xmllshowbuffer{xmltest}{*/.}{id} -\xmllshowbuffer{xmltest}{*//}{id} - -\xmllshowbuffer{xmltest}{/**/}{id} -\xmllshowbuffer{xmltest}{/**/*}{id} -\xmllshowbuffer{xmltest}{/**/.}{id} -\xmllshowbuffer{xmltest}{/**//}{id} - -\xmllshowbuffer{xmltest}{/*/}{id} -\xmllshowbuffer{xmltest}{/*/*}{id} -\xmllshowbuffer{xmltest}{/*/.}{id} -\xmllshowbuffer{xmltest}{/*//}{id} - -\xmllshowbuffer{xmltest}{./}{id} -\xmllshowbuffer{xmltest}{./*}{id} -\xmllshowbuffer{xmltest}{./.}{id} -\xmllshowbuffer{xmltest}{.//}{id} - -\xmllshowbuffer{xmltest}{../}{id} -\xmllshowbuffer{xmltest}{../*}{id} -\xmllshowbuffer{xmltest}{../.}{id} -\xmllshowbuffer{xmltest}{..//}{id} - -\xmllshowbuffer{xmltest}{descendant::whocares/ancestor::whoknows}{id} -\xmllshowbuffer{xmltest}{descendant::whocares/ancestor::whoknows/parent::}{id} -\xmllshowbuffer{xmltest}{descendant::whocares/ancestor::}{id} -\xmllshowbuffer{xmltest}{child::something/child::whatever/child::whocares}{id} -\xmllshowbuffer{xmltest}{child::something/child::whatever/child::whocares|whoknows}{id} -\xmllshowbuffer{xmltest}{child::something/child::whatever/child::(whocares|whoknows)}{id} -\xmllshowbuffer{xmltest}{child::something/child::whatever/child::!(whocares|whoknows)}{id} -\xmllshowbuffer{xmltest}{child::something/child::whatever/child::(whocares)}{id} -\xmllshowbuffer{xmltest}{child::something/child::whatever/child::(whocares)[position()>2]}{id} -\xmllshowbuffer{xmltest}{child::something/child::whatever[position()>2][position()=1]}{id} -\xmllshowbuffer{xmltest}{child::something/child::whatever[whocares][whocaresnot]}{id} -\xmllshowbuffer{xmltest}{child::something/child::whatever[whocares][not(whocaresnot)]}{id} -\xmllshowbuffer{xmltest}{child::something/child::whatever/self::whatever}{id} -\xmllshowbuffer{xmltest}{/something/whatever}{id} -\xmllshowbuffer{xmltest}{something/whatever}{id} -\xmllshowbuffer{xmltest}{/**/whocares}{id} -\xmllshowbuffer{xmltest}{whoknows/whocares}{id} -\xmllshowbuffer{xmltest}{whoknows}{id} -\xmllshowbuffer{xmltest}{whocares[contains(text(),'f') or contains(text(),'g')]}{id} -\xmllshowbuffer{xmltest}{whocares/first()}{id} -\xmllshowbuffer{xmltest}{whocares/last()}{id} -\xmllshowbuffer{xmltest}{whatever/all()}{id} -\xmllshowbuffer{xmltest}{whocares/position(2)}{id} -\xmllshowbuffer{xmltest}{whocares/position(-2)}{id} -\xmllshowbuffer{xmltest}{whocares[1]}{id} -\xmllshowbuffer{xmltest}{whocares[-1]}{id} -\xmllshowbuffer{xmltest}{whocares[2]}{id} -\xmllshowbuffer{xmltest}{whocares[-2]}{id} -\xmllshowbuffer{xmltest}{whatever[3]/attribute(id)}{id} -\xmllshowbuffer{xmltest}{whatever[2]/attribute('id')}{id} -\xmllshowbuffer{xmltest}{whatever[3]/text()}{id} -\xmllshowbuffer{xmltest}{/whocares/first()}{id} -\xmllshowbuffer{xmltest}{/whocares/last()}{id} - -\xmllshowbuffer{xmltest}{xml://whatever/all()}{id} -\xmllshowbuffer{xmltest}{whatever/all()}{id} -\xmllshowbuffer{xmltest}{//whocares}{id} -\xmllshowbuffer{xmltest}{..[2]}{id} -\xmllshowbuffer{xmltest}{../*[2]}{id} - -\xmllshowbuffer{xmltest}{/(whocares|whocaresnot)}{id} -\xmllshowbuffer{xmltest}{/!(whocares|whocaresnot)}{id} -\xmllshowbuffer{xmltest}{/!whocares}{id} - -% \page - -% \xmllshow{/interface/command/command(xml:setups:register)} -% \xmllshow{/interface/command[@name='xxx']/command(xml:setups:typeset)} -% \xmllshow{/arguments/*} -% \xmllshow{/sequence/first()} -% \xmllshow{/arguments/text()} -% \xmllshow{/sequence/variable/first()} -% \xmllshow{/interface/define[@name='xxx']/first()} -% \xmllshow{/parameter/command(xml:setups:parameter:measure)} - -% \page - -% \xmllshow{interface/command/command(xml:setups:register)} -% \xmllshow{interface/command[@name='xxx']/command(xml:setups:typeset)} -% \xmllshow{arguments/*} -% \xmllshow{sequence/first()} -% \xmllshow{arguments/text()} -% \xmllshow{sequence/variable/first()} -% \xmllshow{interface/define[@name='xxx']/first()} -% \xmllshow{parameter/command(xml:setups:parameter:measure)} - -\stoptext diff --git a/doc/context/sources/general/manuals/xml/xml-mkiv-style.tex b/doc/context/sources/general/manuals/xml/xml-mkiv-style.tex index 8bcd74086..1b4ce995e 100644 --- a/doc/context/sources/general/manuals/xml/xml-mkiv-style.tex +++ b/doc/context/sources/general/manuals/xml/xml-mkiv-style.tex @@ -1,9 +1,12 @@ +% language=us runpath=texruns:manuals/xml + \startenvironment xml-mkiv-style \input lxml-ctx.mkiv -\settrue \xmllshowtitle -\setfalse\xmllshowwarning +\settrue \xmllshowtitletoo +\settrue \xmllshowbuffertoo +\setfalse\xmllshowwarningtoo \usemodule[set-11] @@ -138,10 +141,6 @@ rulethickness=1pt, corner=round] -\usemodule[punk] - -\usetypescript[punk] - \definelayer [page] [width=\paperwidth, diff --git a/doc/context/sources/general/manuals/xml/xml-mkiv-titlepage.tex b/doc/context/sources/general/manuals/xml/xml-mkiv-titlepage.tex index 427557214..db36c9349 100644 --- a/doc/context/sources/general/manuals/xml/xml-mkiv-titlepage.tex +++ b/doc/context/sources/general/manuals/xml/xml-mkiv-titlepage.tex @@ -1,18 +1,42 @@ +% language=us runpath=texruns:manuals/xml + \environment xml-mkiv-style \startcomponent xml-mkiv-titlepage \setuplayout[page] +\ifcase\contextlmtxmode + + \usemodule[punk] + + \usetypescript[punk] + + \definefont[PunkSmall][demo@punk at 18pt] + \definefont[PunkLarge][demo@punk at 90pt] + +\else + + \useMPlibrary[punk] + + \definefont[PunkSmall][Serif*punkrandom @ 18pt] + \definefont[PunkLarge][Serif*punkrandom @ 90pt] + +\fi + \startstandardmakeup \startfontclass[none] % nil the current fontclass since it may append its features - \EnableRandomPunk + \ifcase\contextlmtxmode + \EnableRandomPunk + \else + \enablerandomvariants + \fi \setlayerframed [page] [width=\paperwidth,height=\paperheight, background=color,backgroundcolor=colorone,backgroundoffset=1ex,frame=off] {} - \definedfont[demo@punk at 18pt] + \PunkSmall \setbox\scratchbox\vbox { \hsize\dimexpr\paperwidth+2ex\relax \setupinterlinespace @@ -24,14 +48,14 @@ [page] [preset=middle] {\vsplit\scratchbox to \dimexpr\paperheight+2ex\relax} - \definedfont[demo@punk at 90pt] + \PunkLarge \setstrut \setlayerframed [page] [preset=rightbottom,offset=10mm] [foregroundcolor=colorthree,align=flushright,offset=overlay,frame=off] {Dealing\\with XML in\\Con\TeX t MkIV} - \definedfont[demo@punk at 18pt] + \PunkSmall \setstrut \setlayerframed [page] diff --git a/doc/context/sources/general/manuals/xml/xml-mkiv-tricks.tex b/doc/context/sources/general/manuals/xml/xml-mkiv-tricks.tex index f8c65ecc9..b6905491c 100644 --- a/doc/context/sources/general/manuals/xml/xml-mkiv-tricks.tex +++ b/doc/context/sources/general/manuals/xml/xml-mkiv-tricks.tex @@ -1,3 +1,5 @@ +% language=us runpath=texruns:manuals/xml + \environment xml-mkiv-style \startcomponent xml-mkiv-tricks diff --git a/doc/context/sources/general/manuals/xml/xml-mkiv.tex b/doc/context/sources/general/manuals/xml/xml-mkiv.tex index 77054e79c..aa9702589 100644 --- a/doc/context/sources/general/manuals/xml/xml-mkiv.tex +++ b/doc/context/sources/general/manuals/xml/xml-mkiv.tex @@ -1,4 +1,4 @@ -% language=uk +% language=us runpath=texruns:manuals/xml % author : Hans Hagen % copyright : PRAGMA ADE & ConTeXt Development Team |