..
/
download
.\" Automatically generated by Pandoc 2.3.1
.\"
.TH "xml\-merge" "1" "2020\-07\-07" "" "xml\-utils"
.hy
.SH NAME
.PP
xml\-merge \- Merge XML files on a common element
.SH SYNOPSIS
.IP
.nf
\f[C]
xml\-merge\ [\-fh?]\ <dst>\ <src>
\f[]
.fi
.SH DESCRIPTION
.PP
The \f[I]xml\-merge\f[] utility merges two XML files together, based on
a common element.
.SH OPTIONS
.TP
.B \-f, \-\-overwrite
Overwrite the <dst> file with the merged result, instead of writing to
stdout.
.RS
.RE
.TP
.B \-h, \-?, \-\-help
Show usage message.
.RS
.RE
.TP
.B \-\-version
Show version information.
.RS
.RE
.TP
.B <dst>
The XML file which <src> will be merged in to.
.RS
.RE
.TP
.B <src>
The XML file which will me merged in to <dst>.
The first occurence of an element in <dst> which matches the root
element of this file is where the merge will occur.
.RS
.RE
.PP
In addition, the following options allow configuration of the XML
parser:
.TP
.B \-\-dtdload
Load the external DTD.
.RS
.RE
.TP
.B \-\-huge
Remove any internal arbitrary parser limits.
.RS
.RE
.TP
.B \-\-net
Allow network access to load external DTD and entities.
.RS
.RE
.TP
.B \-\-noent
Resolve entities.
.RS
.RE
.TP
.B \-\-xinclude
Do XInclude processing.
.RS
.RE
.TP
.B \-\-xml\-catalog <file>
Use an XML catalog when resolving entities.
Multiple catalogs may be loaded by specifying this option multiple
times.
.RS
.RE
.SH EXAMPLE
.PP
Given the following two XML files:
.PP
\f[I]\f[CI]file1.xml\f[I]:\f[]
.IP
.nf
\f[C]
<root>
<metadata>...</metadata>
<content/>
</root>
\f[]
.fi
.PP
\f[I]\f[CI]file2.xml\f[I]:\f[]
.IP
.nf
\f[C]
<content>
<text>Hello\ world.</text>
</content>
\f[]
.fi
.PP
the xml\-merge utility will merge them on the element \f[C]content\f[]:
.IP
.nf
\f[C]
$\ xml\-merge\ file1.xml\ file2.xml\ >\ merged.xml
\f[]
.fi
.PP
to produce the merged file:
.PP
\f[I]\f[CI]merged.xml\f[I]:\f[]
.IP
.nf
\f[C]
<root>
<metadata>...</metadata>
<content>
<text>Hello\ world.</text>
</content>
</root>
\f[]
.fi
.SH AUTHORS
khzae.net.
gopher://khzae.net/0/s1kd/xml/xml-utils/src/utils/xml-merge/doc/xml-merge.1