Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

dbautosplit(1) [suse man page]

DBAUTOSPLIT(1)						      DocBook Splitting tools						    DBAUTOSPLIT(1)

NAME
dbautosplit - automaticaly split DocBook document SYNOPSIS
dbautosplit [options] input_file [output_template] dbautosplit --help DESCRIPTION
dbautosplit is tool for automaticaly splitting DocBook documents. It use XInclude (see <http://www.w3.org/TR/xinclude/>) for include docu- ment fragments. This allow split large XML file to smaler files withal preserve validation. Splitting is possible in any element. Default is "book", "part", "chapter", "article", "preface", "reference" and "refentry". Morewer you may specify maximum depth level. Output file names are full customizable. It is possible to get tree structure corespond to hiearchy of sections in DocBook document. All "xml:base" attributes (see <http://www.w3.org/TR/xmlbase/>) are processed and them removed. Relative references in "fileref" and "url" attributes are properly rewrited. So it is posible to use dbautosplit (with maximum level depth set to zero) as inteligent "xml:base" attribute remover and so as intelignet DocBook copyier. If no output teplate is specified, default out/index.xml is used. See TEMPALTE EXPANSION below. OPTIONS
--split=ELEMENTS Coma-separated list of XML elements in which is required spliting. Asterisk ('*') means any tag. The default is "book", "part", "chap- ter", "article", "preface" "reference" and "refentry". --split-add=ELEMENTS Coma-separate list of XML elements which are addeded to previously specified tags list or to the default list. See --split otpion. --split-del=ELEMENTS Coma-separated list of XML elements which are removed from previously specified tags list or from the default list. See --split option. -l DEPTH, --level=DEPTH Specify recursion maximum depth level to DEPTH. The default maximum depth is 1. --lo-dirs=PATHS Coma-separated list of paths in which are located local objects (see LOCAL OBJECTS below). All paths are expanded as the standart Unix shell would do, see File::Glob(3perl) for details. Relative paths is related to curent working directory. If path contains $XML_BASE at the begining it is replaced by real base of input document, see option --xmlbase below. Default paths are LocalObjects, MediaOb- jects, ImageObjects and #Pictures in base directory of input document. --lo-dirs-add=PATHS Coma-separeted list of paths which are addeded to preiously specified or the default local objects paths. See --lo-dirs option. --lo-dir=DIRECTORY Name of local objects directory for newly created documents (see LOCAL OBJECTS below). Relative path is related to newly created docu- ments. Default directory is LocalObjects. --lo-move Move local objects instead copy them. See LOCAL OBJECTS below. -o=TEMPLATE, --output-other=TEMPLATE TEMPLATE for other (included) output files (see TEMPALTE EXPANSIONS below). Relative path is related to parent. The default is %attr(id)?:%text(%name()-%02index())/index.xml. --xmlbase=URI XML base URI (Uniform Resource Identifier) for input document. See <http://www.w3.org/TR/xmlbase/> for details. You may need change default if you simple copy an DocBook document without copying referenced files nor changing "fileref" attributes. On this case set XML base to orginal location. Note, URI is required not (unix) file name. --xi-dtd[=FILE] Append minimal internal subset for support "xi:include" element. If FILE is specified then entiry reference to this external subset is inserted instead. Relative path is related to curent work directory. --encoding=ENCODING Enforce encoding for all output files. -v, --verbose Increase verbosity level. -q, --quiet Decrease verbosity level. -V, --version Dump version information and exit. -h, -?, --help Dump help screen and exit. --man Show this manual page and exit. LOCAL OBJECTS
Local objects are special files (pictures, audio files, ...) in directories specified by --lo-dirs option. If DocBook document refer (via "fileref" attribute) to this directory, the files are copied (or moved) to local "Local Objects Directory" specified by --lo-dir option. Moreower all files with same name and differ suffix (after last dot) are copied (or moved) too. TEMPLATE EXPANSIONS
In output file names are recognized special templates with following syntax: TEMPLATE := %[FORMAT]COMMAND(OPTIONS)[?TEMPLATE[:TEMPLATE]] where FORMAT is format modifier as for "%s" format in "printf" command, and COMMAND(OPTIONSB) is one of (case insensible): Attribute(NAME), Attr(NAME) Replace template by attribute value. NodeName(), Name() Replace template by name of node. Depth() Replace template by current depth. Index() Replace template by an unique increasing integer. Text(STRING), Txt(STRING) Replace template by arbritrary string. All templates in STRING are expanded at first. PerlEval(CODE), Eval(CODE) Replace template by result of evalution arbritraty perl code. All templates in CODE are expanded at first. Optionaly the first template can by folloved question mark, second temlate, colon mark and third temlpate. On this case if expansion of the first template is emty the second template is expanded otherwise third template is expanded. EXAMPLES
dbautosplit --level=0 --om=new/mydoc.xml old/mydoc.xml Copy file mydoc.xml from old/ to new/ directory, remove all xml:base attributes and properly rewrite all relative fileref references so they refer to same files. If they are reference to files in local objects directoryes, they will be copyed. dbautosplit --om=new/mydoc.xml --split-add="section" old/mydoc.xml Same as above, but new/mydox.xml is now splited in defaults elements plus in element "section". Name of output files according to default output template (except main output file which is specified) which is %attr(id)?:%text(%name()-%02index())/index.xml. That mean every splited part create own directory in new directory and file index.xml in this directory. Name of this directory will be the value of "id" attribute or name of splited element followed by dash and an integer if there is no "id" attribute specified. dbautosplit --oo='%eval(uc("%attr(id)?:%text(%name()-%index())/index.xml"))' old/mydoc.xml The output files names will have the same name as in default case but in uper case. BUGS AND TODO
o How about cross-document ID/IDREF? Help me. o Magnle entity referenced by entityref and targetdoent attributes. SEE ALSO
dbmerge(3), "DocBook: The Definitive Guide" <http://www.docbook.org/tdg/en/html/docbook.html> AUTHOR
Martin Lazar <mlazar@suse.cz> 0.6 2004-01-27 DBAUTOSPLIT(1)
Man Page