.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "XML2JSON 1p" .TH XML2JSON 1p "2022-11-27" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" xml2json \- convert an XML message with a schema into JSON .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& xml2json xml\-file schema\-file(s) >json\-file \& \& xml2json \-x xml\-file \-s schema\-files \-o json\-file .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Convert an \s-1XML\s0 message into \s-1JSON\s0 with the same structure. A schema is required to enforce the correct syntax, especially for optionally repeated elements. .SS "Options" .IX Subsection "Options" You can either specify an \s-1XML\s0 message filename and one or more schema filenames as arguments, or use the options. .IP "\-\-xml|\-x filename" 4 .IX Item "--xml|-x filename" The file which contains the xml message. A single dash means \*(L"stdin\*(R". .IP "\-\-schema|\-s filename(s)" 4 .IX Item "--schema|-s filename(s)" This option can be repeated, or the filenames separated by comma's, if you have more than one schema file to parse. All imported and included schema components have to be provided explicitly. .IP "\-\-bigints|\-b (boolean)" 4 .IX Item "--bigints|-b (boolean)" By default, the translation is a little sloppy: Integer types are defined to support at least 18 digits in \s-1XML.\s0 However, this is usually unnecessary large and unreadible in \s-1JSON.\s0 .IP "\-\-no\-keep\-root (boolean)" 4 .IX Item "--no-keep-root (boolean)" Do not include the top node in the output. .IP "\-\-mixed \s-1HOW\s0" 4 .IX Item "--mixed HOW" [1.32] How to treat mixed elements. The default is \s-1TEXTUAL.\s0 Other values are \f(CW\*(C`ATTRIBUTES\*(C'\fR, \f(CW\*(C`XML_STRING\*(C'\fR, and \f(CW\*(C`STRUCTURAL\*(C'\fR. More details about mixed_elements in XML::Compile::Translate::Reader. .IP "\-\-type|\-t \s-1TYPE\s0" 4 .IX Item "--type|-t TYPE" The type of the root element, required if the \s-1XML\s0 is not namespaceo qualified, although the schema is. If not specified, the root element is automatically inspected. .Sp The \s-1TYPE\s0 notation is \f(CW\*(C`{namespace}localname\*(C'\fR. Be warned to use quoting on the \s-1UNIX\s0 command-line, because curly braces have a special meaning for the shell. .IP "\-\-output|\-o filename" 4 .IX Item "--output|-o filename" By default (or when the filename is a dash), the output is printed to stdout. .SH "SEE ALSO" .IX Header "SEE ALSO" This module is part of Perl's XML-Compile distribution. Website: \fIhttp://perl.overmeer.net/xml\-compile/\fR .SH "LICENSE" .IX Header "LICENSE" Copyrights 2017 by Slaven Rezic and Mark Overmeer. For other contributors see ChangeLog. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See \fIhttp://www.perl.com/perl/misc/Artistic.html\fR