-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
1,541 additions
and
2,272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,167 +1,92 @@ | ||
'\" t | ||
.\" Title: json2xml | ||
.\" Author: Ladislav Lhotka <[email protected]> | ||
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/> | ||
.\" Date: 2022-03-30 | ||
.\" Manual: pyang manual | ||
.\" Source: json2xml-2.5.3 | ||
.\" Language: English | ||
.\" Automatically generated by Pandoc 2.9.2.1 | ||
.\" | ||
.TH "JSON2XML" "1" "2022\-03\-30" "json2xml\-2\&.5\&.3" "pyang manual" | ||
.\" ----------------------------------------------------------------- | ||
.\" * Define some portability stuff | ||
.\" ----------------------------------------------------------------- | ||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
.\" http://bugs.debian.org/507673 | ||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html | ||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
.ie \n(.g .ds Aq \(aq | ||
.el .ds Aq ' | ||
.\" ----------------------------------------------------------------- | ||
.\" * set default formatting | ||
.\" ----------------------------------------------------------------- | ||
.\" disable hyphenation | ||
.nh | ||
.\" disable justification (adjust text to left margin only) | ||
.ad l | ||
.\" ----------------------------------------------------------------- | ||
.\" * MAIN CONTENT STARTS HERE * | ||
.\" ----------------------------------------------------------------- | ||
.SH "NAME" | ||
json2xml \- translates JSON documents conforming to a YANG data model into XML\&. | ||
.SH "SYNOPSIS" | ||
.HP \w'\fBjson2xml\fR\ 'u | ||
\fBjson2xml\fR [\-t\ \fItarget\fR] [\-o\ \fIoutput_file\fR] \fIdriver_file\fR \fIjson_file\fR | ||
.HP \w'\fBjson2xml\fR\ 'u | ||
\fBjson2xml\fR \-h | \-\-help | ||
.SH "DESCRIPTION" | ||
.PP | ||
This program translates | ||
\fIjson_file\fR | ||
into XML using the procedure specified in | ||
\m[blue]\fBRFC 7951\fR\m[]\&\s-2\u[1]\d\s+2\&. | ||
.PP | ||
The translation uses a second input file, | ||
\fIdriver_file\fR, which contains a concise JSON representation of the YANG data model to which | ||
\fIjson_file\fR | ||
should conform, at least structurally\&. Normally, | ||
\fIdriver_file\fR | ||
is obtained as the | ||
\fIjtox\fR | ||
output of | ||
\fBpyang\fR\&. | ||
.PP | ||
Using "\-" (hyphen) in place of | ||
\fIjson_file\fR | ||
instructs the program to read a JSON document from the standard input\&. | ||
.PP | ||
The | ||
\fItarget\fR | ||
argument specifies the document (root) element for the output XML document\&. This encapsulation is necessary because the input JSON document may contain multiple JSON objects at the top level\&. Supported values for the | ||
\fItarget\fR | ||
argument are: | ||
.PP | ||
.TH "JSON2XML" "1" "2023-11-03" "json2xml-2.6.0" "User Manual" | ||
.hy | ||
.SH NAME | ||
.PP | ||
json2xml - translates JSON documents conforming to a YANG data model | ||
into XML. | ||
.SH SYNOPSIS | ||
.PP | ||
\f[B]json2xml\f[R] [-t target] [-o \f[I]output_file\f[R]] | ||
\f[I]driver_file\f[R] \f[I]json_file\f[R] | ||
.PP | ||
\f[B]json2xml\f[R] -h | --help | ||
.SH DESCRIPTION | ||
.PP | ||
This program translates \f[I]json_file\f[R] into XML using the procedure | ||
specified in \f[B]RFC 7951\f[R]. | ||
.PP | ||
The translation uses a second input file, \f[I]driver_file\f[R], which | ||
contains a concise JSON representation of the YANG data model to which | ||
\f[I]json_file\f[R] should conform, at least structurally. | ||
Normally, \f[I]driver_file\f[R] is obtained as the \f[I]jtox\f[R] output | ||
of \f[B]pyang\f[R]. | ||
.PP | ||
Using \[dq]-\[dq] (hyphen) in place of \f[I]json_file\f[R] instructs the | ||
program to read a JSON document from the standard input. | ||
.PP | ||
The \f[I]target\f[R] argument specifies the document (root) element for | ||
the output XML document. | ||
This encapsulation is necessary because the input JSON document may | ||
contain multiple JSON objects at the top level. | ||
Supported values for the \f[I]target\f[R] argument are: | ||
.TP | ||
data | ||
.RS 4 | ||
The document element will be <nc:data>\&. This is the default\&. | ||
.RE | ||
.PP | ||
The document element will be <nc:data>. | ||
This is the default. | ||
.TP | ||
config | ||
.RS 4 | ||
The document element will be <nc:data>\&. | ||
.RE | ||
.PP | ||
The XML prefix "nc" represents the standard NETCONF namespace with URI "urn:ietf:params:xml:ns:netconf:base:1\&.0"\&. | ||
.SH "OPTIONS" | ||
.PP | ||
\fB\-t\fR \fItarget\fR, \fB\-\-target\fR \fItarget\fR | ||
.RS 4 | ||
Specifies the target type of the output XML document, i\&.e\&. its document element\&. The default is | ||
\fBdata\fR\&. | ||
.RE | ||
.PP | ||
\fB\-o\fR \fIoutput_file\fR, \fB\-\-output\fR \fIoutput_file\fR | ||
.RS 4 | ||
Write output to | ||
\fIoutput_file\fR | ||
instead of the standard output\&. | ||
.RE | ||
.PP | ||
\fB\-h\fR, \fB\-\-help\fR | ||
.RS 4 | ||
Displays help screen and exits\&. | ||
.RE | ||
.SH "EXAMPLE" | ||
.sp | ||
.if n \{\ | ||
.RS 4 | ||
.\} | ||
.nf | ||
$ pyang \-f jtox \-o dhcp\&.jtox dhcp\&.yang | ||
.fi | ||
.if n \{\ | ||
.RE | ||
.\} | ||
.sp | ||
.if n \{\ | ||
.RS 4 | ||
.\} | ||
The document element will be <nc:data>. | ||
.PP | ||
The XML prefix \[dq]nc\[dq] represents the standard NETCONF namespace | ||
with URI \[dq]urn:ietf:params:xml:ns:netconf:base:1.0\[dq]. | ||
.SH OPTIONS | ||
.TP | ||
\f[B]-t\f[R] \f[I]target\f[R], \f[B]target\f[R] \f[I]target\f[R] | ||
Specifies the target type of the output XML document, i.e., its document | ||
element. | ||
The default is \f[B]data\f[R]. | ||
.TP | ||
\f[B]-o\f[R] \f[I]output_file\f[R], \f[B]--output\f[R] \f[I]output_file\f[R] | ||
Write output to \f[I]output_file\f[R] instead of the standard output. | ||
.TP | ||
\f[B]-h\f[R], \f[B]--help\f[R] | ||
Displays help screen and exits. | ||
.SH EXAMPLES | ||
.IP | ||
.nf | ||
$ json2xml \-o dhcp\-data\&.xml dhcp\&.jtox dhcp\-data\&.json | ||
\f[C] | ||
$ pyang -f jtox -o dhcp.jtox dhcp.yang | ||
|
||
$ json2xml -o dhcp-data.xml dhcp.jtox dhcp-data.json | ||
\f[R] | ||
.fi | ||
.if n \{\ | ||
.RE | ||
.\} | ||
.PP | ||
The first command generates the driver file | ||
dhcp\&.jtox, which is then used for translating JSON file | ||
dhcp\-data\&.json | ||
to XML file | ||
dhcp\-data\&.xml\&. | ||
.SH "DIAGNOSTICS" | ||
.PP | ||
\fBjson2xml\fR | ||
return codes have the following meaning: | ||
The first command generates the driver file dhcp.jtox, which is then | ||
used for translating JSON file dhcp-data.json to XML file dhcp-data.xml. | ||
.SH DIAGNOSTICS | ||
.PP | ||
\f[B]json2xml\f[R] return codes have the following meaning: | ||
.TP | ||
0 | ||
.RS 4 | ||
No error (normal termination) | ||
.RE | ||
.PP | ||
.TP | ||
1 | ||
.RS 4 | ||
One of the input files cannot be read | ||
.RE | ||
.PP | ||
.TP | ||
2 | ||
.RS 4 | ||
Error in command line arguments | ||
.RE | ||
.PP | ||
.TP | ||
3 | ||
.RS 4 | ||
JSON to XML translation failed | ||
.RE | ||
.SH "SEE ALSO" | ||
.SH SEE ALSO | ||
.PP | ||
\m[blue]\fBRFC 7951\fR\m[]\&\s-2\u[1]\d\s+2, | ||
\fBpyang\fR(1), | ||
\m[blue]\fBJSON\fR\m[]\&\s-2\u[2]\d\s+2\&. | ||
.SH "AUTHOR" | ||
\f[B]RFC 7951\f[R], \f[B]pyang\f[R](1) | ||
.SH AUTHOR | ||
.PP | ||
\fBLadislav Lhotka\fR <\&lhotka@nic\&.cz\&> | ||
.br | ||
CZ\&.NIC | ||
.RS 4 | ||
.RE | ||
.SH "NOTES" | ||
.IP " 1." 4 | ||
RFC 7951 | ||
.RS 4 | ||
\%http://tools.ietf.org/html/rfc7951 | ||
.RE | ||
.IP " 2." 4 | ||
JSON | ||
.RS 4 | ||
\%http://www.json.org/ | ||
.RE | ||
\f[B]Ladislav Lhotka\f[R] <lhotka\[at]nic.cz> | ||
.PD 0 | ||
.P | ||
.PD | ||
CZ.NIC |
Oops, something went wrong.