[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook] xi:include problem
On 2013-12-12 23:50, davep wrote:
On 12/12/13 19:04, Alex Kleider wrote:The problem (already aluded to in the thread from which I've spun off this one) with a) using xmllint to expand xIncludes and then b) validating with jing, is that the validation must be done on the output of xmllint and whenjing reports an error it provides a location in the output file, but wewant to fix the problem in the original file. The way I'm solving the problem is making each xIncluded file a validDocBook file and validating each included file before using xmllint andthen doing a final validation. This restricts me to making eachxIncluded component an <article> since I think this is the lowest levelelement that can be a valid DocBook. Comments? Are there better ways?Sounds sensible, though if you just want to 'stop' and see the errors, simply stop processing when (if) xmllint reports an error? I do agree about the intermediate file being a nuisance though. regards
I have figured out how to solve my problem. It's probably 'old news' to most but ...
I use the following script: """ if [ -n "$2" ]; then outfile="$2"; else outfile="/dev/stdout"; fi infile=$1 rng=/usr/share/xml/docbook/schema/rng/5.0/docbook.rng xmllint --relaxng $rng --xinclude $infile > $outfile """