[docbook] Re: xi:include problem
Dew, Simon simon@sbdinc.com writes: xmllint ver 2.7.8 (on Windows 7 Ultimate, 32-bit) gives: xmllint --noout --relaxng %DOCBOOK_XML%\rng\docbook.rng Errors.docbook On my Mac, xmllint definitely gives confusing errors. $ xmllint --version xmllint: using libxml version 20800 compiled with: Threads Tree Output Push Reader Patterns Writer SAXv1 FTP HTTP DTDValid HTML Legacy C14N Catalog XPath XPointer XInclude Iconv ISO8859X Unicode Regexps Automata Expr Schemas Schematron Modules Debug Zlib Lzma $ xmllint --noout --relaxng /projects/docbook/docbook/relaxng/schemas/docbook.rng /tmp/err.xml /tmp/err.xml:14: element info: Relax-NG validity error : Element book has extra content: info /tmp/err.xml:11: element book: Relax-NG validity error : Expecting element abstract, got book /tmp/err.xml:11: element book: Relax-NG validity error : Did not expect element book there /tmp/err.xml:11: element book: Relax-NG validity error : Expecting element audiodata, got book /tmp/err.xml:11: element book: Relax-NG validity error : Expecting element example, got book /tmp/err.xml fails to validate It definitely appears to have gone off the rails, but the only thing wrong with that file is the conref attribute. Curiously, if you remove the conref attribute, the file validates. My guess is that xmllint percolates the validity error up from the bad attribute to the info element, decides that the info element doesn't match any patterns (which, it doesn't) and so it's an extra element. From there, I don't know what happens. Be seeing you, norm -- Norman Walsh n...@nwalsh.com | Time is the old justice that http://www.oasis-open.org/docbook/ | examines all offenders.-- Chair, DocBook Technical Committee | Shakespeare signature.asc Description: PGP signature
[docbook] Re: xi:include problem
Alex Kleider aklei...@sonic.net writes: The way I'm solving the problem is making each xIncluded file a valid DocBook file and validating each included file before using xmllint and then doing a final validation. This restricts me to making each xIncluded component an article since I think this is the lowest level element that can be a valid DocBook. You can go lower then article. You can go to anything with a title, roughly: start = (db.set | db.book | db.divisions | db.components | db.navigation.components | db.section | db.para) | (db.abstract | db.mediaobject.content | db.audiodata | db.imagedata | db.textdata | db.videodata | db.caption | db.publishing.blocks | db.formal.blocks | db.informal.blocks | db.formalpara | db.inlinemediaobject | db.list.blocks | db.legalnotice | db.verbatim.blocks | db.graphic.blocks | db.personblurb | db.revhistory | db.simpara | db.step | db.stepalternatives) | (db.partintro | db.simplesect) | db.annotation | (db.sect1 | db.sect2 | db.sect3 | db.sect4 | db.sect5) | (db.refentry | db.refsection | db.refsynopsisdiv) | (db.refsect1 | db.refsect2 | db.refsect3) | (db.glossary | db.glossdiv | db.glosslist) | (db.bibliodiv | db.bibliolist) | (db.setindex | db.index | db.indexdiv) | (db.toc | db.tocdiv) | (db.task | db.taskprerequisites | db.taskrelated | db.tasksummary) | (db.calloutlist | db.programlistingco | db.screenco | db.imageobjectco) | (db.productionset | db.constraintdef) | (db.msg | db.msgexplan | db.msgmain | db.msgrel | db.msgset | db.msgsub) | (db.qandadiv | db.qandaentry | db.qandaset) | (db.equation | db.informalequation) | db.cmdsynopsis | (db.synopsis.blocks | db.funcsynopsisinfo | db.classsynopsisinfo) | db.admonition.blocks | db.topic Comments? Are there better ways? Seems reasonable. Be seeing you, norm -- Norman Walsh n...@nwalsh.com | Everything in the universe goes by http://www.oasis-open.org/docbook/ | indirection. There are no straight Chair, DocBook Technical Committee | lines.-- Emerson signature.asc Description: PGP signature
[docbook] Re: xi:include problem
davep da...@dpawson.co.uk writes: That's how, not what Mr Walsh! Herrumph. Fair enough. Here's my everyday DocBook pipeline: p:declare-step version=1.0 name=main xmlns:exf=http://exproc.org/standard/functions; xmlns:p=http://www.w3.org/ns/xproc; p:input port=source/ p:output port=result/ p:input port=parameters kind=parameter/ !-- The style option specifies the stylesheet. The standard HTML one by default. -- p:option name=style select='/projects/docbook/xslt20/xslt/base/html/docbook.xsl'/ !-- The schema option specifies the schema. The RDFaLite one by default. -- p:option name=schema select='/projects/docbook/docbook/relaxng/schemas/dbrdfalite.rng'/ !-- Expand XIncludes -- p:xinclude/ !-- I've started using some ad-hoc shortcuts in my writing. For example, I write about XML so often that I use att instead of tag class=attribute. The ndw2db.xsl stylesheet normalizes my shortcut markup back into proper DocBook. -- p:xslt name=normalize p:input port=stylesheet p:document href=/Users/ndw/stylesheets/ndw2db.xsl/ /p:input /p:xslt !-- Load the stylesheet and the schema. If I specify them as options, I want them resolved relative to the current working directory, not this stylesheet, so I have to work a little harder. -- p:load name=style p:with-option name=href select=resolve-uri($style, exf:cwd())/ /p:load p:load name=schema p:with-option name=href select=resolve-uri($schema, exf:cwd())/ /p:load !-- Validate my (normlized) DocBook markup -- p:validate-with-relax-ng p:input port=source p:pipe step=normalize port=result/ /p:input p:input port=schema p:pipe step=schema port=result/ /p:input /p:validate-with-relax-ng !-- And...style it! -- p:xslt p:input port=stylesheet p:pipe step=style port=result/ /p:input /p:xslt /p:declare-step Be seeing you, norm -- Norman Walsh n...@nwalsh.com | To the man who is afraid http://www.oasis-open.org/docbook/ | everything rustles.-- Sophocles Chair, DocBook Technical Committee | signature.asc Description: PGP signature
Re: [docbook] Re: xi:include problem
On 11/12/13 13:33, Norman Walsh wrote: davep da...@dpawson.co.uk writes: That's how, not what Mr Walsh! Herrumph. Fair enough. Here's my everyday DocBook pipeline: Interesting. Thanks Norm p:declare-step version=1.0 name=main xmlns:exf=http://exproc.org/standard/functions; xmlns:p=http://www.w3.org/ns/xproc; p:input port=source/ p:output port=result/ p:input port=parameters kind=parameter/ !-- The style option specifies the stylesheet. The standard HTML one by default. -- p:option name=style select='/projects/docbook/xslt20/xslt/base/html/docbook.xsl'/ !-- The schema option specifies the schema. The RDFaLite one by default. -- p:option name=schema select='/projects/docbook/docbook/relaxng/schemas/dbrdfalite.rng'/ ??? Schema for . output? DBRDFa? Surely not the input docbook? !-- Expand XIncludes -- p:xinclude/ !-- I've started using some ad-hoc shortcuts in my writing. For example, I write about XML so often that I use att instead of tag class=attribute. The ndw2db.xsl stylesheet normalizes my shortcut markup back into proper DocBook. -- Catch up Mr W! I've had those for yonks. Wrong list for emacs macros though p:xslt name=normalize p:input port=stylesheet p:document href=/Users/ndw/stylesheets/ndw2db.xsl/ /p:input /p:xslt Ah... you're using XML as your macro processor Different. !-- Load the stylesheet and the schema. If I specify them as options, I want them resolved relative to the current working directory, not this stylesheet, so I have to work a little harder. -- p:load name=style p:with-option name=href select=resolve-uri($style, exf:cwd())/ /p:load p:load name=schema p:with-option name=href select=resolve-uri($schema, exf:cwd())/ /p:load exfproc... are these 'standard' inasmuch as ... Calabash has them? !-- Validate my (normlized) DocBook markup -- p:validate-with-relax-ng p:input port=source p:pipe step=normalize port=result/ /p:input p:input port=schema p:pipe step=schema port=result/ /p:input /p:validate-with-relax-ng !-- And...style it! -- p:xslt p:input port=stylesheet p:pipe step=style port=result/ /p:input /p:xslt /p:declare-step Be seeing you, norm Does this stop on error Norm? As per bash scripts or Ant script? Very tempted to try this. regards -- Dave Pawson XSLT XSL-FO FAQ. http://www.dpawson.co.uk - To unsubscribe, e-mail: docbook-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-h...@lists.oasis-open.org
[docbook] Re: xi:include problem
!-- The schema option specifies the schema. The RDFaLite one by default. -- p:option name=schema select='/projects/docbook/docbook/relaxng/schemas/dbrdfalite.rng'/ ??? Schema for . output? DBRDFa? Surely not the input docbook? The DocBook customization that adds RDFa Lite attributes. Which I deleted today because the DocBook TC decided to make them part of DocBook V5.1 :-) !-- I've started using some ad-hoc shortcuts in my writing. For example, I write about XML so often that I use att instead of tag class=attribute. The ndw2db.xsl stylesheet normalizes my shortcut markup back into proper DocBook. -- Catch up Mr W! I've had those for yonks. Wrong list for emacs macros though I don't use emacs macros for it, though. I literally write paraThe attrevisionflag/att attribute.../para !-- Load the stylesheet and the schema. If I specify them as options, I want them resolved relative to the current working directory, not this stylesheet, so I have to work a little harder. -- p:load name=style p:with-option name=href select=resolve-uri($style, exf:cwd())/ /p:load p:load name=schema p:with-option name=href select=resolve-uri($schema, exf:cwd())/ /p:load exfproc... are these 'standard' inasmuch as ... Calabash has them? They're standard exproc.org functions, if that helps. Does this stop on error Norm? Yes. Goes bang on error. Be seeing you, norm -- Norman Walsh n...@nwalsh.com | To think is not enough; you must http://www.oasis-open.org/docbook/ | think of something.--Jules Renard Chair, DocBook Technical Committee | signature.asc Description: PGP signature
[docbook] Re: xi:include problem
davep da...@dpawson.co.uk writes: Step 1, process the xinclude Step 2. Validate With, uh, a technology like, uhm, XProc maybe? :-) Be seeing you, norm -- Norman Walsh n...@nwalsh.com | Wandering in a vast forest at http://www.oasis-open.org/docbook/ | night, I have only a faint light Chair, DocBook Technical Committee | to guide me. A stranger appears | and says to me: My friend, you | should blow out your candle in | order to find your way more | clearly. This man is a | theologian.-- Diderot signature.asc Description: PGP signature
Re: [docbook] Re: xi:include problem
On 10/12/13 15:00, Norman Walsh wrote: davep da...@dpawson.co.uk writes: Step 1, process the xinclude Step 2. Validate With, uh, a technology like, uhm, XProc maybe? :-) Be seeing you, norm That's how, not what Mr Walsh! Herrumph. regards -- Dave Pawson XSLT XSL-FO FAQ. http://www.dpawson.co.uk - To unsubscribe, e-mail: docbook-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-h...@lists.oasis-open.org