Upgrade libxo to 0.3.2.

Obtained from:  https://github.com/Juniper/libxo/tree/0.3.2
Requested by: Phil Shafer <phil@juniper.net>

This import incorporates local change 279966.
Local change 276260 has been merged-in.
This commit is contained in:
Marcel Moolenaar 2015-04-27 17:23:19 +00:00
parent 483117a646
commit 788ca347b8
58 changed files with 4295 additions and 1265 deletions

View File

@ -10,7 +10,7 @@
ACLOCAL_AMFLAGS = -I m4 ACLOCAL_AMFLAGS = -I m4
SUBDIRS = libxo xo xolint tests doc SUBDIRS = libxo xo xolint xohtml tests doc
bin_SCRIPTS=libxo-config bin_SCRIPTS=libxo-config
dist_doc_DATA = Copyright dist_doc_DATA = Copyright

View File

@ -12,7 +12,7 @@
# #
AC_PREREQ(2.2) AC_PREREQ(2.2)
AC_INIT([libxo], [0.2.0], [phil@juniper.net]) AC_INIT([libxo], [0.3.2], [phil@juniper.net])
AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability]) AM_INIT_AUTOMAKE([-Wall -Werror foreign -Wno-portability])
# Support silent build rules. Requires at least automake-1.11. # Support silent build rules. Requires at least automake-1.11.
@ -133,6 +133,14 @@ AC_ARG_ENABLE([debug],
AC_MSG_RESULT([$LIBXO_DEBUG]) AC_MSG_RESULT([$LIBXO_DEBUG])
AM_CONDITIONAL([LIBXO_DEBUG], [test "$LIBXO_DEBUG" != "no"]) AM_CONDITIONAL([LIBXO_DEBUG], [test "$LIBXO_DEBUG" != "no"])
AC_MSG_CHECKING([whether to build with text-only rendering])
AC_ARG_ENABLE([text-only],
[ --enable-text-only Turn on text-only rendering],
[LIBXO_TEXT_ONLY=yes; AC_DEFINE([LIBXO_TEXT_ONLY], [1], [Enable text-only rendering])],
[LIBXO_TEXT_ONLY=no])
AC_MSG_RESULT([$LIBXO_TEXT_ONLY])
AM_CONDITIONAL([LIBXO_TEXT_ONLY], [test "$LIBXO_TEXT_ONLY" != "no"])
AC_CHECK_LIB([m], [lrint]) AC_CHECK_LIB([m], [lrint])
AM_CONDITIONAL([HAVE_LIBM], [test "$HAVE_LIBM" != "no"]) AM_CONDITIONAL([HAVE_LIBM], [test "$HAVE_LIBM" != "no"])
@ -233,6 +241,7 @@ AC_CONFIG_FILES([
libxo/xoversion.h libxo/xoversion.h
xo/Makefile xo/Makefile
xolint/Makefile xolint/Makefile
xohtml/Makefile
packaging/libxo.pc packaging/libxo.pc
doc/Makefile doc/Makefile
tests/Makefile tests/Makefile
@ -253,6 +262,7 @@ AC_MSG_NOTICE([summary of build options:
bindir: ${XO_BINDIR} bindir: ${XO_BINDIR}
includedir: ${XO_INCLUDEDIR} includedir: ${XO_INCLUDEDIR}
share dir: ${XO_SHAREDIR} share dir: ${XO_SHAREDIR}
oxtradoc dir: ${SLAX_OXTRADOCDIR}
compiler: ${CC} (${HAVE_GCC:-no}) compiler: ${CC} (${HAVE_GCC:-no})
compiler flags: ${CFLAGS} compiler flags: ${CFLAGS}
@ -262,4 +272,5 @@ AC_MSG_NOTICE([summary of build options:
debug: ${LIBXO_DEBUG:-no} debug: ${LIBXO_DEBUG:-no}
printf-like: ${HAVE_PRINTFLIKE:-no} printf-like: ${HAVE_PRINTFLIKE:-no}
libxo-options: ${LIBXO_OPTS:-no} libxo-options: ${LIBXO_OPTS:-no}
text-only: ${LIBXO_TEXT_ONLY:-no}
]) ])

View File

@ -134,7 +134,7 @@ A single libxo function call in source code is all that's required:
<host>my-box</host> <host>my-box</host>
<domain>example.com</domain> <domain>example.com</domain>
JSON: JSON:
"host": my-box", "host": "my-box",
"domain": "example.com" "domain": "example.com"
For brevity, the HTML output is emitted. For brevity, the HTML output is emitted.
@ -228,17 +228,17 @@ data, including data type, description, and an XPath location.
<div class="line"> <div class="line">
<div class="data" data-tag="blocks">36</div> <div class="data" data-tag="blocks">36</div>
<div class="padding"> </div> <div class="padding"> </div>
<div class="data data-tag="path">./src</div> <div class="data" data-tag="path">./src</div>
</div> </div>
<div class="line"> <div class="line">
<div class="data" data-tag="blocks">40</div> <div class="data" data-tag="blocks">40</div>
<div class="padding"> </div> <div class="padding"> </div>
<div class="data data-tag="path">./bin</div> <div class="data" data-tag="path">./bin</div>
</div> </div>
<div class="line"> <div class="line">
<div class="data" data-tag="blocks">90</div> <div class="data" data-tag="blocks">90</div>
<div class="padding"> </div> <div class="padding"> </div>
<div class="data data-tag="path">./</div> <div class="data" data-tag="path">./</div>
</div> </div>
** Format Strings @format-strings@ ** Format Strings @format-strings@
@ -285,6 +285,7 @@ content. The roles are listed below; only one role is permitted:
|---+--------------+-------------------------------------------------| |---+--------------+-------------------------------------------------|
| M | Name | Description | | M | Name | Description |
|---+--------------+-------------------------------------------------| |---+--------------+-------------------------------------------------|
| C | color/effect | Field has color and effect controls |
| D | decoration | Field is non-text (e.g., colon, comma) | | D | decoration | Field is non-text (e.g., colon, comma) |
| E | error | Field is an error message | | E | error | Field is an error message |
| L | label | Field is text that prefixes a value | | L | label | Field is text that prefixes a value |
@ -298,6 +299,56 @@ content. The roles are listed below; only one role is permitted:
| ] | stop anchor | End a section of anchored variable-width text | | ] | stop anchor | End a section of anchored variable-width text |
|---+--------------+-------------------------------------------------| |---+--------------+-------------------------------------------------|
**** The Color Role ({C:})
Colors and effects control how text values are displayed; they are
used for display styles (TEXT and HTML). The color content can be
either static, when placed directly within the field descriptor, or a
printf-style format descriptor can be used, if preceded by a slash ("/"):
xo_emit("{C:bold}{Lwc:Cost}{:cost/%u}{C:reset}\n", cost);
xo_emit("{C:/fg-%s,bg-%s}{Lwc:Cost}{:cost/%u}{C:reset}\n",
fg_color, bg_color, cost);
The content should be a comma-separated list of zero or more colors or
display effects. Colors and effects remain in effect until
modified by other "C" roles. If the content is empty, the "reset"
action is performed.
|---------------+-------------------------------------------------|
| Name | Description |
|---------------+-------------------------------------------------|
| bg-XXXXX | Change background color |
| bold | Start bold text effect |
| fg-XXXXX | Change foreground color |
| inverse | Start inverse (aka reverse) text effect |
| no-bold | Stop bold text effect |
| no-inverse | Stop inverse (aka reverse) text effect |
| no-underline | Stop underline text effect |
| normal | Reset effects (only) |
| reset | Reset colors and effects (restore defaults) |
| underline | Start underline text effect |
|---------------+-------------------------------------------------|
The following color names are supported:
|---------------|
| Name |
|---------------|
| black |
| blue |
| cyan |
| default |
| green |
| magenta |
| red |
| white |
| yellow |
|---------------|
Color names are prefixed with either "fg-" or "bg-" to change the
foreground and background colors, respectively.
**** The Decoration Role ({D:}) **** The Decoration Role ({D:})
Decorations are typically punctuation marks such as colons, Decorations are typically punctuation marks such as colons,
@ -1404,9 +1455,21 @@ functions like xo_failure, xo_warn, xo_err, etc. The program name is
initialized by xo_parse_args, but subsequent calls to xo_set_program initialized by xo_parse_args, but subsequent calls to xo_set_program
can override this value. can override this value.
xo_set_program(argv[0]);
Note that the value is not copied, so the memory passed to Note that the value is not copied, so the memory passed to
xo_set_program (and xo_parse_args) must be maintained by the caller. xo_set_program (and xo_parse_args) must be maintained by the caller.
*** xo_set_version
The xo_set_version function records a version number to be emitted as
part of the data for encoding styles (XML and JSON). This version
number is suitable for tracking changes in the content, allowing a
user of the data to discern which version of the data model is in use.
void xo_set_version (const char *version);
void xo_set_version_h (xo_handle_t *xop, const char *version);
*** Field Information (xo_info_t) @info@ *** Field Information (xo_info_t) @info@
HTML data can include additional information in attributes that HTML data can include additional information in attributes that
@ -1705,6 +1768,32 @@ The "-V" option does not report errors, but prints a complete list of
all field names, sorted alphabetically. The output can help spot all field names, sorted alphabetically. The output can help spot
inconsistencies and spelling errors. inconsistencies and spelling errors.
* xohtml
xohtml is a tool for turning the output of libxo-enabled commands into
html files suitable for display in modern HTML web browsers. It can
be used to test and debug HTML output, as well as to make the user
ache to escape the world of 70s terminal devices.
xohtml is given a command, either on the command line or via the "-c"
option. If not command is given, standard input is used. The
command's output is wrapped in HTML tags, with references to
supporting CSS and Javascript files, and written to standard output or
the file given in the "-f" option. The "-b" option can be used to
provide an alternative base path for the support files.
|--------------+---------------------------------------------------|
| Option | Meaning |
|--------------+---------------------------------------------------|
| -b <base> | Base path for finding css/javascript files |
| -c <command> | Command to execute |
| -f <file> | Output file name |
|--------------+---------------------------------------------------|
The "-c" option takes a full command with arguments, including
any libxo options needed to generate html ("--libxo=html"). This
value must be quoted if it consists of multiple tokens.
* FAQs * FAQs
This section contains the set of questions that users typically ask, This section contains the set of questions that users typically ask,

View File

@ -38,12 +38,15 @@ man_MANS = \
xo_no_setlocale.3 \ xo_no_setlocale.3 \
xo_open_container.3 \ xo_open_container.3 \
xo_open_list.3 \ xo_open_list.3 \
xo_open_marker.3 \
xo_parse_args.3 \ xo_parse_args.3 \
xo_set_allocator.3 \ xo_set_allocator.3 \
xo_set_flags.3 \ xo_set_flags.3 \
xo_set_info.3 \ xo_set_info.3 \
xo_set_options.3 \ xo_set_options.3 \
xo_set_style.3 \ xo_set_style.3 \
xo_set_version.3 \
xo_set_writer.3 xo_set_writer.3
EXTRA_DIST = EXTRA_DIST = ${man_MANS}

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,7 @@
*/ */
/** /**
* libxo provides a means of generating text, XML, and JSON output * libxo provides a means of generating text, XML, JSON, and HTML output
* using a single set of function calls, maximizing the value of output * using a single set of function calls, maximizing the value of output
* while minimizing the cost/impact on the code. * while minimizing the cost/impact on the code.
*/ */
@ -17,6 +17,27 @@
#ifndef INCLUDE_XO_H #ifndef INCLUDE_XO_H
#define INCLUDE_XO_H #define INCLUDE_XO_H
#include <sys/types.h>
#ifdef __dead2
#define NORETURN __dead2
#else
#define NORETURN
#endif /* __dead2 */
/*
* Normally we'd use the HAVE_PRINTFLIKE define triggered by the
* --enable-printflike option to configure, but we don't install
* our internal "xoconfig.h", and I'd rather not. Taking the
* coward's path, we'll turn it on inside a #if that allows
* others to turn it off where needed. Not ideal, but functional.
*/
#if !defined(NO_PRINTFLIKE) && !defined(__linux__)
#define PRINTFLIKE(_x, _y) __printflike(_x, _y)
#else
#define PRINTFLIKE(_x, _y)
#endif /* NO_PRINTFLIKE */
/** Formatting types */ /** Formatting types */
typedef unsigned xo_style_t; typedef unsigned xo_style_t;
#define XO_STYLE_TEXT 0 /** Generate text output */ #define XO_STYLE_TEXT 0 /** Generate text output */
@ -58,6 +79,8 @@ typedef unsigned long long xo_xof_flags_t;
#define XOF_FLUSH_LINE XOF_BIT(23) /** Flush after each newline */ #define XOF_FLUSH_LINE XOF_BIT(23) /** Flush after each newline */
#define XOF_NO_CLOSE XOF_BIT(24) /** xo_finish won't close open elements */ #define XOF_NO_CLOSE XOF_BIT(24) /** xo_finish won't close open elements */
#define XOF_COLOR_ALLOWED XOF_BIT(25) /** Allow color/effects to be enabled */
#define XOF_COLOR XOF_BIT(26) /** Enable color and effects */
/* /*
* The xo_info_t structure provides a mapping between names and * The xo_info_t structure provides a mapping between names and
@ -260,64 +283,116 @@ void
xo_set_leading_xpath (xo_handle_t *xop, const char *path); xo_set_leading_xpath (xo_handle_t *xop, const char *path);
void void
xo_warn_hc (xo_handle_t *xop, int code, const char *fmt, ...); xo_warn_hc (xo_handle_t *xop, int code, const char *fmt, ...) PRINTFLIKE(3, 4);
void void
xo_warn_c (int code, const char *fmt, ...); xo_warn_c (int code, const char *fmt, ...) PRINTFLIKE(2, 3);
void void
xo_warn (const char *fmt, ...); xo_warn (const char *fmt, ...) PRINTFLIKE(1, 2);
void void
xo_warnx (const char *fmt, ...); xo_warnx (const char *fmt, ...) PRINTFLIKE(1, 2);
void void
xo_err (int eval, const char *fmt, ...) __dead2; xo_err (int eval, const char *fmt, ...) NORETURN PRINTFLIKE(2, 3);
void void
xo_errx (int eval, const char *fmt, ...) __dead2; xo_errx (int eval, const char *fmt, ...) NORETURN PRINTFLIKE(2, 3);
void void
xo_errc (int eval, int code, const char *fmt, ...) __dead2; xo_errc (int eval, int code, const char *fmt, ...) NORETURN PRINTFLIKE(3, 4);
void void
xo_message_hcv (xo_handle_t *xop, int code, const char *fmt, va_list vap); xo_message_hcv (xo_handle_t *xop, int code, const char *fmt, va_list vap);
void void
xo_message_hc (xo_handle_t *xop, int code, const char *fmt, ...); xo_message_hc (xo_handle_t *xop, int code, const char *fmt, ...) PRINTFLIKE(3, 4);
void void
xo_message_c (int code, const char *fmt, ...); xo_message_c (int code, const char *fmt, ...) PRINTFLIKE(2, 3);
void void
xo_message (const char *fmt, ...); xo_message (const char *fmt, ...) PRINTFLIKE(1, 2);
void void
xo_no_setlocale (void); xo_no_setlocale (void);
/**
* @brief Lift libxo-specific arguments from a set of arguments
*
* libxo-enable programs typically use command line options to enable
* all the nifty-cool libxo features. xo_parse_args() makes this simple
* by pre-processing the command line arguments given to main(), handling
* and removing the libxo-specific ones, meaning anything starting with
* "--libxo". A full description of these arguments is in the base
* documentation.
* @param[in] argc Number of arguments (ala #main())
* @param[in] argc Array of argument strings (ala #main())
* @return New number of arguments, or -1 for failure.
*/
int int
xo_parse_args (int argc, char **argv); xo_parse_args (int argc, char **argv);
/* /**
* This is the "magic" number returned by libxo-supporting commands * This is the "magic" number returned by libxo-supporting commands
* when passed the equally magic "--libxo-check" option. If you * when passed the equally magic "--libxo-check" option. If you
* return this, we can assume that since you know the magic handshake, * return this, we can (unsafely) assume that since you know the magic
* you'll happily handle future --libxo options and not do something * handshake, you'll happily handle future --libxo options and not do
* violent like reboot the box or create another hole in the ozone * something violent like reboot the box or create another hole in the
* layer. * ozone layer.
*/ */
#define XO_HAS_LIBXO 121 #define XO_HAS_LIBXO 121
/* /**
* externs for our version number strings * externs for libxo's version number strings
*/ */
extern const char xo_version[]; extern const char xo_version[]; /** Base version triple string */
extern const char xo_version_extra[]; extern const char xo_version_extra[]; /** Extra version magic content */
/**
* @brief Dump the internal stack of a libxo handle.
*
* This diagnostic function is something I will ask you to call from
* your program when you write to tell me libxo has gone bat-stink
* crazy and has discarded your list or container or content. Output
* content will be what we lovingly call "developer entertainment".
* @param[in] xop A valid libxo handle, or NULL for the default handle
*/
void void
xo_dump_stack (xo_handle_t *xop); xo_dump_stack (xo_handle_t *xop);
/**
* @brief Recode the name of the program, suitable for error output.
*
* libxo will record the given name for use while generating error
* messages. The contents are not copied, so the value must continue
* to point to a valid memory location. This allows the caller to change
* the value, but requires the caller to manage the memory. Typically
* this is called with argv[0] from main().
* @param[in] name The name of the current application program
*/
void void
xo_set_program (const char *name); xo_set_program (const char *name);
/**
* @brief Add a version string to the output, where possible.
*
* Adds a version number to the output, suitable for tracking
* changes in the content. This is only important for the "encoding"
* format styles (XML and JSON) and allows a user of the data to
* discern which version of the data model is in use.
* @param[in] version The version number, encoded as a string
*/
void
xo_set_version (const char *version);
/**
* #xo_set_version with a handle.
* @param[in] xop A valid libxo handle, or NULL for the default handle
* @param[in] version The version number, encoded as a string
*/
void
xo_set_version_h (xo_handle_t *xop, const char *version);
#endif /* INCLUDE_XO_H */ #endif /* INCLUDE_XO_H */

View File

@ -28,12 +28,13 @@ The
argument is a string containing printf-style formatting argument is a string containing printf-style formatting
instructions that describe the remaining arguments. instructions that describe the remaining arguments.
.Pp .Pp
When converting an application to libxo, one can replace When converting an application to
.Nm libxo ,
one can replace
.Em "fprintf(stderr,...)" .Em "fprintf(stderr,...)"
calls with calls with
.Fn xo_error .Fn xo_error
calls. calls.
.Pp
.Sh ADDITIONAL DOCUMENTATION .Sh ADDITIONAL DOCUMENTATION
Complete documentation can be found on github: Complete documentation can be found on github:
.Bd -literal -offset indent .Bd -literal -offset indent
@ -53,7 +54,7 @@ is available at:
https://github.com/Juniper/libxo/releases https://github.com/Juniper/libxo/releases
.Ed .Ed
.Sh SEE ALSO .Sh SEE ALSO
.Xr printf 3 .Xr printf 3 ,
.Xr xo_emit 3 .Xr xo_emit 3
.Sh HISTORY .Sh HISTORY
The The

View File

@ -74,7 +74,7 @@ function as an unsigned integer.
.Ed .Ed
.Pp .Pp
This single line of code can generate text ("In stock: 65\\n"), XML This single line of code can generate text ("In stock: 65\\n"), XML
("<in-stock>65</in-stock>"), JSON ('"in-stock": 6'), or HTML (too ("<in-stock>65</in-stock>"), JSON ('"in-stock": 65'), or HTML (too
lengthy to be listed here). lengthy to be listed here).
.Ss Modifier Roles .Ss Modifier Roles
Modifiers are optional, and indicate the role and formatting of the Modifiers are optional, and indicate the role and formatting of the
@ -96,6 +96,55 @@ The roles are listed below; only one role is permitted:
.It \&] "stop anchor " "End a section of anchored variable-width text" .It \&] "stop anchor " "End a section of anchored variable-width text"
.El .El
.Pp .Pp
.Ss The Color Role ({C:})
Colors and effects control how text values are displayed; they are
used for display styles (TEXT and HTML).
The color content can be
either static, when placed directly within the field descriptor, or a
printf-style format descriptor can be used, if preceded by a slash ("/"):
.Bd -literal -offset indent
xo_emit("{C:bold}{Lwc:Cost}{:cost/%u}{C:reset}\n", cost);
xo_emit("{C:/fg-%s,bg-%s}{Lwc:Cost}{:cost/%u}{C:reset}\n",
fg_color, bg_color, cost);
.Ed
.Pp
The content should be a comma-separated list of zero or more colors or
display effects.
.Pp
Colors and effects remain in effect until modified by other "C" roles.
.Pp
If the content is empty, the "reset" action is performed.
.Pp
.Bl -column "no-underline"
.It Sy "Name Description"
.It "bg-xxxxx " "Change background color"
.It "bold " "Start bold text effect"
.It "fg-xxxxx " "Change foreground color"
.It "inverse " "Start inverse (aka reverse) text effect"
.It "no-bold " "Stop bold text effect"
.It "no-inverse " "Stop inverse (aka reverse) text effect"
.It "no-underline " "Stop underline text effect"
.It "normal " "Reset effects (only)"
.It "reset " "Reset colors and effects (restore defaults)"
.It "underline " "Start underline text effect"
.El
.Pp
The following color names are supported:
.Bl -column "no-underline"
.It Sy "Name"
.It black
.It blue
.It cyan
.It default
.It green
.It magenta
.It red
.It white
.It yellow
.El
.Pp
Color names are prefixed with either "fg-" or "bg-" to change the
foreground and background colors, respectively.
.Ss The Decoration Role ({D:}) .Ss The Decoration Role ({D:})
Decorations are typically punctuation marks such as colons, Decorations are typically punctuation marks such as colons,
semi-colons, and commas used to decorate the text and make it simpler semi-colons, and commas used to decorate the text and make it simpler
@ -230,6 +279,7 @@ content emitted for some output styles:
.It d "display " "Only emit field for display styles (text/HTML)" .It d "display " "Only emit field for display styles (text/HTML)"
.It e "encoding " "Only emit for encoding styles (XML/JSON)" .It e "encoding " "Only emit for encoding styles (XML/JSON)"
.It k "key " "Field is a key, suitable for XPath predicates" .It k "key " "Field is a key, suitable for XPath predicates"
.It l "leaf " "Field is a leaf-list, a list of leaf values"
.It n "no-quotes " "Do not quote the field when using JSON style" .It n "no-quotes " "Do not quote the field when using JSON style"
.It q "quotes " "Quote the field when using JSON style" .It q "quotes " "Quote the field when using JSON style"
.It w "white space " "A blank ("" "") is appended after the label" .It w "white space " "A blank ("" "") is appended after the label"
@ -269,8 +319,8 @@ the display output styles, TEXT and HTML.
The display modifier is the opposite of the encoding modifier, and The display modifier is the opposite of the encoding modifier, and
they are often used to give to distinct views of the underlying data. they are often used to give to distinct views of the underlying data.
.Ss The Encoding Modifier ({e:}) .Ss The Encoding Modifier ({e:})
The display modifier indicated the field should only be generated for The encoding modifier indicated the field should only be generated for
the display output styles, TEXT and HTML. the encoding output styles, such as JSON and XML.
.Bd -literal -offset indent .Bd -literal -offset indent
EXAMPLE: EXAMPLE:
xo_emit("{Lcw:Name}{:name} {e:id/%d}\\n", "phil", 1); xo_emit("{Lcw:Name}{:name} {e:id/%d}\\n", "phil", 1);

View File

@ -11,8 +11,8 @@
.Dt LIBXO 3 .Dt LIBXO 3
.Os .Os
.Sh NAME .Sh NAME
.Nm xo_emit .Nm xo_open_container
.Nd emit formatted output based on format string and arguments .Nd open (and close) container constructs
.Sh LIBRARY .Sh LIBRARY
.Lb libxo .Lb libxo
.Sh SYNOPSIS .Sh SYNOPSIS
@ -48,7 +48,7 @@
.Fn xo_close_container_d "void" .Fn xo_close_container_d "void"
.Sh DESCRIPTION .Sh DESCRIPTION
.Nm libxo .Nm libxo
represents to types of hierarchy: represents two types of hierarchy:
.Dq containers .Dq containers
and and
.Dq lists . .Dq lists .
@ -72,7 +72,7 @@ or
.Fn xo_close_container_h .Fn xo_close_container_h
functions. functions.
.Pp .Pp
Each open call must have a matching close call. Each open call should have a matching close call.
If the If the
.Dv XOF_WARN .Dv XOF_WARN
flag is set and the name given does not match the name of flag is set and the name given does not match the name of

View File

@ -0,0 +1,138 @@
.\" #
.\" # Copyright (c) 2015, Juniper Networks, Inc.
.\" # All rights reserved.
.\" # This SOFTWARE is licensed under the LICENSE provided in the
.\" # ../Copyright file. By downloading, installing, copying, or
.\" # using the SOFTWARE, you agree to be bound by the terms of that
.\" # LICENSE.
.\" # Phil Shafer, January 2015
.\"
.Dd January 22, 2015
.Dt LIBXO 3
.Os
.Sh NAME
.Nm xo_open_marker
.Nd prevent and allow closing of open constructs
.Sh LIBRARY
.Lb libxo
.Sh SYNOPSIS
.In libxo/xo.h
.Sh NAME
.Nm xo_open_marker
.Nm xo_open_marker_h
.Nm xo_close_marker
.Nm xo_close_marker_h
.Nd open and close markers
.Sh LIBRARY
.Lb libxo
.Sh SYNOPSIS
.Ft int
.Fn xo_open_marker "const char *name"
.Ft int
.Fn xo_open_marker_h "xo_handle_t *handle" "const char *name"
.Ft int
.Fn xo_close_marker "const char *name"
.Ft int
.Fn xo_close_marker_h "xo_handle_t *handle" "const char *name"
.Sh DESCRIPTION
.Nm libxo
represents hierarchy using two constructs:
.Dq containers
and
.Dq lists .
A marker can be used to affect how open constructs are closed, either
by preventing their (implicit or explicit) closure or by forcing their
closure.
While a marker is open, no other open constructs can be closed.
When a marker is closed, all constructs open since the marker was opened
will be closed.
A marker is used to "freeze" any open constructs.
Calls to
.Fn xo_close_*
functions that would normally close them will be ignored, effectively
blocking their closure.
However when
.Fn xo_close_marker
is called, any containers, lists, or leaf-lists open since the
matching
.Fn xo_open_marker
call will be close and the marker discarded.
Markers use names which are not user-visible, allowing the caller to
choose appropriate internal names.
The marker has no value and is not emitted in any form.
.Pp
To open a marker, call
.Fn xo_open_marker
or
.Fn xo_open_marker_h .
The former uses the default handle and
the latter accepts a specific handle.
.Pp
To close a marker, use the
.Fn xo_close_marker
or
.Fn xo_close_marker_h
functions.
.Pp
Each open call must have a matching close call.
.Pp
In this example, the
.Fn xo_close_container
call on line [1] will be ignored, since the open marker "outer"
will prevent close of any open constructs that precede it.
The
.Fn xo_close_marker
call on line [2] will close the "system" container, since it was
opened after the "outer" marker.
.Bd -literal -offset indent -compact
Example:
xo_open_container("top");
xo_open_marker("outer");
xo_open_container("system");
xo_emit("{:host-name/%s%s%s", hostname,
domainname ? "." : "", domainname ?: "");
xo_close_container("top"); /* [1] */
xo_close_marker("outer"); /* [2] */
xo_close_container("top");
.Ed
.Pp
In this example, the code whiffles through a list of fish, calling a
function to emit details about each fish. The marker "fish-guts" is
used to ensure that any constructs opened by the function are closed
properly.
.Bd -literal -offset indent
for (i = 0; fish[i]; i++) {
xo_open_instance("fish");
xo_open_marker("fish-guts");
dump_fish_details(i);
xo_close_marker("fish-guts");
}
.Ed
.Sh ADDITIONAL DOCUMENTATION
Complete documentation can be found on github:
.Bd -literal -offset indent
http://juniper.github.io/libxo/libxo-manual.html
.Ed
.Pp
.Nm libxo
lives on github as:
.Bd -literal -offset indent
https://github.com/Juniper/libxo
.Ed
.Pp
The latest release of
.Nm libxo
is available at:
.Bd -literal -offset indent
https://github.com/Juniper/libxo/releases
.Ed
.Sh SEE ALSO
.Xr xo_emit 3
.Sh HISTORY
The
.Nm libxo
library was added in
.Fx 11.0 .
.Sh AUTHOR
Phil Shafer

View File

@ -0,0 +1,59 @@
.\" #
.\" # Copyright (c) 2015, Juniper Networks, Inc.
.\" # All rights reserved.
.\" # This SOFTWARE is licensed under the LICENSE provided in the
.\" # ../Copyright file. By downloading, installing, copying, or
.\" # using the SOFTWARE, you agree to be bound by the terms of that
.\" # LICENSE.
.\" # Phil Shafer, July 2014
.\"
.Dd December 4, 2014
.Dt LIBXO 3
.Os
.Sh NAME
.Nm xo_set_version
.Nd record content version information in encoded output
.Sh LIBRARY
.Lb libxo
.Sh SYNOPSIS
.In libxo/xo.h
.Ft void
.Fn xo_set_version "const char *version"
.Ft void
.Fn xo_set_version_h "xo_handle_t *xop" "const char *version"
.Sh DESCRIPTION
The
.Nm xo_set_version
function records a version number to be emitted as
part of the data for encoding styles (XML and JSON).
This version number is suitable for tracking changes in the content,
allowing a user of the data to discern which version of the data model
is in use.
.Sh ADDITIONAL DOCUMENTATION
Complete documentation can be found on github:
.Bd -literal -offset indent
http://juniper.github.io/libxo/libxo-manual.html
.Ed
.Pp
.Nm libxo
lives on github as:
.Bd -literal -offset indent
https://github.com/Juniper/libxo
.Ed
.Pp
The latest release of
.Nm libxo
is available at:
.Bd -literal -offset indent
https://github.com/Juniper/libxo/releases
.Ed
.Sh SEE ALSO
.Xr xo_emit 3 ,
.Xr libxo 3
.Sh HISTORY
The
.Nm libxo
library was added in
.Fx 11.0 .
.Sh AUTHOR
Phil Shafer

View File

@ -150,8 +150,10 @@
/* Enable debugging */ /* Enable debugging */
/* #undef LIBXO_DEBUG */ /* #undef LIBXO_DEBUG */
/* Define to the sub-directory in which libtool stores uninstalled libraries. /* Enable text-only rendering */
*/ /* #undef LIBXO_TEXT_ONLY */
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#define LT_OBJDIR ".libs/" #define LT_OBJDIR ".libs/"
/* Name of package */ /* Name of package */
@ -164,7 +166,7 @@
#define PACKAGE_NAME "libxo" #define PACKAGE_NAME "libxo"
/* Define to the full name and version of this package. */ /* Define to the full name and version of this package. */
#define PACKAGE_STRING "libxo 0.2.0" #define PACKAGE_STRING "libxo 0.3.2"
/* Define to the one symbol short name of this package. */ /* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "libxo" #define PACKAGE_TARNAME "libxo"
@ -173,7 +175,7 @@
#define PACKAGE_URL "" #define PACKAGE_URL ""
/* Define to the version of this package. */ /* Define to the version of this package. */
#define PACKAGE_VERSION "0.2.0" #define PACKAGE_VERSION "0.3.2"
/* If using the C implementation of alloca, define if you know the /* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be direction of stack growth for your system; otherwise it will be
@ -187,7 +189,7 @@
#define STDC_HEADERS 1 #define STDC_HEADERS 1
/* Version number of package */ /* Version number of package */
#define VERSION "0.2.0" #define VERSION "0.3.2"
/* Define to `__inline__' or `__inline' if that's what the C compiler /* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */ calls it, or to nothing if 'inline' is not supported under any name. */

View File

@ -149,8 +149,10 @@
/* Enable debugging */ /* Enable debugging */
#undef LIBXO_DEBUG #undef LIBXO_DEBUG
/* Define to the sub-directory in which libtool stores uninstalled libraries. /* Enable text-only rendering */
*/ #undef LIBXO_TEXT_ONLY
/* Define to the sub-directory where libtool stores uninstalled libraries. */
#undef LT_OBJDIR #undef LT_OBJDIR
/* Name of package */ /* Name of package */

View File

@ -18,17 +18,17 @@
/** /**
* The version string * The version string
*/ */
#define LIBXO_VERSION "0.2.0" #define LIBXO_VERSION "0.3.2"
/** /**
* The version number * The version number
*/ */
#define LIBXO_VERSION_NUMBER 2000 #define LIBXO_VERSION_NUMBER 3002
/** /**
* The version number as a string * The version number as a string
*/ */
#define LIBXO_VERSION_STRING "2000" #define LIBXO_VERSION_STRING "3002"
/** /**
* The version number extra info as a string * The version number extra info as a string

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +1,14 @@
# Helper functions for option handling. -*- Autoconf -*- # Helper functions for option handling. -*- Autoconf -*-
# #
# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
# Inc. # Foundation, Inc.
# Written by Gary V. Vaughan, 2004 # Written by Gary V. Vaughan, 2004
# #
# This file is free software; the Free Software Foundation gives # This file is free software; the Free Software Foundation gives
# unlimited permission to copy and/or distribute it, with or without # unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved. # modifications, as long as this notice is preserved.
# serial 7 ltoptions.m4 # serial 8 ltoptions.m4
# This is to help aclocal find these macros, as it can't see m4_define. # This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
@ -29,7 +29,7 @@ m4_define([_LT_SET_OPTION],
[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]),
[m4_warning([Unknown $1 option `$2'])])[]dnl [m4_warning([Unknown $1 option '$2'])])[]dnl
]) ])
@ -75,13 +75,15 @@ m4_if([$1],[LT_INIT],[
dnl dnl
dnl If no reference was made to various pairs of opposing options, then dnl If no reference was made to various pairs of opposing options, then
dnl we run the default mode handler for the pair. For example, if neither dnl we run the default mode handler for the pair. For example, if neither
dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
dnl archives by default: dnl archives by default:
_LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
_LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
_LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
_LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
[_LT_ENABLE_FAST_INSTALL]) [_LT_ENABLE_FAST_INSTALL])
_LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
[_LT_WITH_AIX_SONAME([aix])])
]) ])
])# _LT_SET_OPTIONS ])# _LT_SET_OPTIONS
@ -112,7 +114,7 @@ AU_DEFUN([AC_LIBTOOL_DLOPEN],
[_LT_SET_OPTION([LT_INIT], [dlopen]) [_LT_SET_OPTION([LT_INIT], [dlopen])
AC_DIAGNOSE([obsolete], AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you [$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `dlopen' option into LT_INIT's first parameter.]) put the 'dlopen' option into LT_INIT's first parameter.])
]) ])
dnl aclocal-1.4 backwards compatibility: dnl aclocal-1.4 backwards compatibility:
@ -148,7 +150,7 @@ AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
_LT_SET_OPTION([LT_INIT], [win32-dll]) _LT_SET_OPTION([LT_INIT], [win32-dll])
AC_DIAGNOSE([obsolete], AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you [$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `win32-dll' option into LT_INIT's first parameter.]) put the 'win32-dll' option into LT_INIT's first parameter.])
]) ])
dnl aclocal-1.4 backwards compatibility: dnl aclocal-1.4 backwards compatibility:
@ -157,9 +159,9 @@ dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
# _LT_ENABLE_SHARED([DEFAULT]) # _LT_ENABLE_SHARED([DEFAULT])
# ---------------------------- # ----------------------------
# implement the --enable-shared flag, and supports the `shared' and # implement the --enable-shared flag, and supports the 'shared' and
# `disable-shared' LT_INIT options. # 'disable-shared' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
m4_define([_LT_ENABLE_SHARED], m4_define([_LT_ENABLE_SHARED],
[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([shared], AC_ARG_ENABLE([shared],
@ -172,14 +174,14 @@ AC_ARG_ENABLE([shared],
*) *)
enable_shared=no enable_shared=no
# Look at the argument we got. We use all the common list separators. # Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for pkg in $enableval; do for pkg in $enableval; do
IFS="$lt_save_ifs" IFS=$lt_save_ifs
if test "X$pkg" = "X$p"; then if test "X$pkg" = "X$p"; then
enable_shared=yes enable_shared=yes
fi fi
done done
IFS="$lt_save_ifs" IFS=$lt_save_ifs
;; ;;
esac], esac],
[enable_shared=]_LT_ENABLE_SHARED_DEFAULT) [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
@ -211,9 +213,9 @@ dnl AC_DEFUN([AM_DISABLE_SHARED], [])
# _LT_ENABLE_STATIC([DEFAULT]) # _LT_ENABLE_STATIC([DEFAULT])
# ---------------------------- # ----------------------------
# implement the --enable-static flag, and support the `static' and # implement the --enable-static flag, and support the 'static' and
# `disable-static' LT_INIT options. # 'disable-static' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
m4_define([_LT_ENABLE_STATIC], m4_define([_LT_ENABLE_STATIC],
[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([static], AC_ARG_ENABLE([static],
@ -226,14 +228,14 @@ AC_ARG_ENABLE([static],
*) *)
enable_static=no enable_static=no
# Look at the argument we got. We use all the common list separators. # Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for pkg in $enableval; do for pkg in $enableval; do
IFS="$lt_save_ifs" IFS=$lt_save_ifs
if test "X$pkg" = "X$p"; then if test "X$pkg" = "X$p"; then
enable_static=yes enable_static=yes
fi fi
done done
IFS="$lt_save_ifs" IFS=$lt_save_ifs
;; ;;
esac], esac],
[enable_static=]_LT_ENABLE_STATIC_DEFAULT) [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
@ -265,9 +267,9 @@ dnl AC_DEFUN([AM_DISABLE_STATIC], [])
# _LT_ENABLE_FAST_INSTALL([DEFAULT]) # _LT_ENABLE_FAST_INSTALL([DEFAULT])
# ---------------------------------- # ----------------------------------
# implement the --enable-fast-install flag, and support the `fast-install' # implement the --enable-fast-install flag, and support the 'fast-install'
# and `disable-fast-install' LT_INIT options. # and 'disable-fast-install' LT_INIT options.
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. # DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
m4_define([_LT_ENABLE_FAST_INSTALL], m4_define([_LT_ENABLE_FAST_INSTALL],
[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([fast-install], AC_ARG_ENABLE([fast-install],
@ -280,14 +282,14 @@ AC_ARG_ENABLE([fast-install],
*) *)
enable_fast_install=no enable_fast_install=no
# Look at the argument we got. We use all the common list separators. # Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for pkg in $enableval; do for pkg in $enableval; do
IFS="$lt_save_ifs" IFS=$lt_save_ifs
if test "X$pkg" = "X$p"; then if test "X$pkg" = "X$p"; then
enable_fast_install=yes enable_fast_install=yes
fi fi
done done
IFS="$lt_save_ifs" IFS=$lt_save_ifs
;; ;;
esac], esac],
[enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
@ -304,14 +306,14 @@ AU_DEFUN([AC_ENABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
AC_DIAGNOSE([obsolete], AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put [$0: Remove this warning and the call to _LT_SET_OPTION when you put
the `fast-install' option into LT_INIT's first parameter.]) the 'fast-install' option into LT_INIT's first parameter.])
]) ])
AU_DEFUN([AC_DISABLE_FAST_INSTALL], AU_DEFUN([AC_DISABLE_FAST_INSTALL],
[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) [_LT_SET_OPTION([LT_INIT], [disable-fast-install])
AC_DIAGNOSE([obsolete], AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put [$0: Remove this warning and the call to _LT_SET_OPTION when you put
the `disable-fast-install' option into LT_INIT's first parameter.]) the 'disable-fast-install' option into LT_INIT's first parameter.])
]) ])
dnl aclocal-1.4 backwards compatibility: dnl aclocal-1.4 backwards compatibility:
@ -319,11 +321,64 @@ dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
# _LT_WITH_AIX_SONAME([DEFAULT])
# ----------------------------------
# implement the --with-aix-soname flag, and support the `aix-soname=aix'
# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'.
m4_define([_LT_WITH_AIX_SONAME],
[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
shared_archive_member_spec=
case $host,$enable_shared in
power*-*-aix[[5-9]]*,yes)
AC_MSG_CHECKING([which variant of shared library versioning to provide])
AC_ARG_WITH([aix-soname],
[AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
[shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
[case $withval in
aix|svr4|both)
;;
*)
AC_MSG_ERROR([Unknown argument to --with-aix-soname])
;;
esac
lt_cv_with_aix_soname=$with_aix_soname],
[AC_CACHE_VAL([lt_cv_with_aix_soname],
[lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
with_aix_soname=$lt_cv_with_aix_soname])
AC_MSG_RESULT([$with_aix_soname])
if test aix != "$with_aix_soname"; then
# For the AIX way of multilib, we name the shared archive member
# based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
# and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
# Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
# the AIX toolchain works better with OBJECT_MODE set (default 32).
if test 64 = "${OBJECT_MODE-32}"; then
shared_archive_member_spec=shr_64
else
shared_archive_member_spec=shr
fi
fi
;;
*)
with_aix_soname=aix
;;
esac
_LT_DECL([], [shared_archive_member_spec], [0],
[Shared archive member basename, for filename based shared library versioning on AIX])dnl
])# _LT_WITH_AIX_SONAME
LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
# _LT_WITH_PIC([MODE]) # _LT_WITH_PIC([MODE])
# -------------------- # --------------------
# implement the --with-pic flag, and support the `pic-only' and `no-pic' # implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
# LT_INIT options. # LT_INIT options.
# MODE is either `yes' or `no'. If omitted, it defaults to `both'. # MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'.
m4_define([_LT_WITH_PIC], m4_define([_LT_WITH_PIC],
[AC_ARG_WITH([pic], [AC_ARG_WITH([pic],
[AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
@ -334,19 +389,17 @@ m4_define([_LT_WITH_PIC],
*) *)
pic_mode=default pic_mode=default
# Look at the argument we got. We use all the common list separators. # Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for lt_pkg in $withval; do for lt_pkg in $withval; do
IFS="$lt_save_ifs" IFS=$lt_save_ifs
if test "X$lt_pkg" = "X$lt_p"; then if test "X$lt_pkg" = "X$lt_p"; then
pic_mode=yes pic_mode=yes
fi fi
done done
IFS="$lt_save_ifs" IFS=$lt_save_ifs
;; ;;
esac], esac],
[pic_mode=default]) [pic_mode=m4_default([$1], [default])])
test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
])# _LT_WITH_PIC ])# _LT_WITH_PIC
@ -359,7 +412,7 @@ AU_DEFUN([AC_LIBTOOL_PICMODE],
[_LT_SET_OPTION([LT_INIT], [pic-only]) [_LT_SET_OPTION([LT_INIT], [pic-only])
AC_DIAGNOSE([obsolete], AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you [$0: Remove this warning and the call to _LT_SET_OPTION when you
put the `pic-only' option into LT_INIT's first parameter.]) put the 'pic-only' option into LT_INIT's first parameter.])
]) ])
dnl aclocal-1.4 backwards compatibility: dnl aclocal-1.4 backwards compatibility:

View File

@ -1,6 +1,6 @@
# ltversion.m4 -- version numbers -*- Autoconf -*- # ltversion.m4 -- version numbers -*- Autoconf -*-
# #
# Copyright (C) 2004 Free Software Foundation, Inc. # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004 # Written by Scott James Remnant, 2004
# #
# This file is free software; the Free Software Foundation gives # This file is free software; the Free Software Foundation gives
@ -9,15 +9,15 @@
# @configure_input@ # @configure_input@
# serial 3337 ltversion.m4 # serial 4179 ltversion.m4
# This file is part of GNU Libtool # This file is part of GNU Libtool
m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_VERSION], [2.4.6])
m4_define([LT_PACKAGE_REVISION], [1.3337]) m4_define([LT_PACKAGE_REVISION], [2.4.6])
AC_DEFUN([LTVERSION_VERSION], AC_DEFUN([LTVERSION_VERSION],
[macro_version='2.4.2' [macro_version='2.4.6'
macro_revision='1.3337' macro_revision='2.4.6'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0) _LT_DECL(, macro_revision, 0)
]) ])

View File

@ -20,7 +20,8 @@ test_05.c \
test_06.c \ test_06.c \
test_07.c \ test_07.c \
test_08.c \ test_08.c \
test_09.c test_09.c \
test_10.c
test_01_test_SOURCES = test_01.c test_01_test_SOURCES = test_01.c
test_02_test_SOURCES = test_02.c test_02_test_SOURCES = test_02.c
@ -31,6 +32,7 @@ test_06_test_SOURCES = test_06.c
test_07_test_SOURCES = test_07.c test_07_test_SOURCES = test_07.c
test_08_test_SOURCES = test_08.c test_08_test_SOURCES = test_08.c
test_09_test_SOURCES = test_09.c test_09_test_SOURCES = test_09.c
test_10_test_SOURCES = test_10.c
# TEST_CASES := $(shell cd ${srcdir} ; echo *.c ) # TEST_CASES := $(shell cd ${srcdir} ; echo *.c )

View File

@ -91,7 +91,11 @@
}, },
"data": { "data": {
"item": [ "item": [
"gum", "rope", "ladder", "bolt", "water" "gum",
"rope",
"ladder",
"bolt",
"water"
] ]
}, },
"cost": 425, "cost": 425,

View File

@ -26,7 +26,9 @@
"cur": 20, "cur": 20,
"max": 125, "max": 125,
"flag": [ "flag": [
"one", "two", "three" "one",
"two",
"three"
], ],
"empty-tag": true, "empty-tag": true,
"t1": "1000", "t1": "1000",

View File

@ -1 +1 @@
<div class="line"><div class="text">Οὐχὶ ταὐτὰ παρίσταταί μοι </div><div class="data" data-tag="v1">γιγνώσκειν</div><div class="text">, </div><div class="data" data-tag="v2">ὦ ἄνδρες ᾿Αθηναῖοι</div></div><div class="line"><div class="text">გთხოვთ </div><div class="data" data-tag="v1">ახლავე გაიაროთ რეგისტრაცია</div><div class="text"> </div><div class="data" data-tag="v2">Unicode-ის მეათე საერთაშორისო</div></div><div class="line"><div class="title">First Name </div><div class="title">Last Name </div><div class="title">Department </div><div class="title">Time (%)</div></div><div class="line"><div class="data" data-tag="first-name">Jim</div><div class="text"> (</div><div class="data" data-tag="nic-name">"რეგტ"</div><div class="text">)</div><div class="padding"> </div><div class="data" data-tag="last-name">გთხოვთ ახ </div><div class="data" data-tag="department"> 431</div><div class="data" data-tag="percent-time"> 90</div></div><div class="line"><div class="data" data-tag="first-name">Terry</div><div class="text"> (</div><div class="data" data-tag="nic-name">"&lt;one"</div><div class="text">)</div><div class="padding"> </div><div class="data" data-tag="last-name">Οὐχὶ ταὐτὰ παρ</div><div class="data" data-tag="department"> 660</div><div class="data" data-tag="percent-time"> 90</div></div><div class="line"><div class="data" data-tag="first-name">Leslie</div><div class="text"> (</div><div class="data" data-tag="nic-name">"Les"</div><div class="text">)</div><div class="padding"> </div><div class="data" data-tag="last-name">Patterson </div><div class="data" data-tag="department"> 341</div><div class="data" data-tag="percent-time"> 60</div></div><div class="line"><div class="data" data-tag="first-name">Ashley</div><div class="text"> (</div><div class="data" data-tag="nic-name">"Ash"</div><div class="text">)</div><div class="padding"> </div><div class="data" data-tag="last-name">Meter &amp; Smith </div><div class="data" data-tag="department"> 1440</div><div class="data" data-tag="percent-time"> 40</div></div><div class="line"><div class="data" data-tag="first-name">0123456789</div><div class="text"> (</div><div class="data" data-tag="nic-name">"0123456789"</div><div class="text">)</div><div class="data" data-tag="last-name">01234567890123</div><div class="data" data-tag="department"> 1440</div><div class="data" data-tag="percent-time"> 40</div></div><div class="line"><div class="data" data-tag="first-name">ახლა</div><div class="text"> (</div><div class="data" data-tag="nic-name">"გაიარო"</div><div class="text">)</div><div class="padding"> </div><div class="data" data-tag="last-name">საერთაშორისო </div><div class="data" data-tag="department"> 123</div><div class="data" data-tag="percent-time"> 90</div></div> <div class="line"><div class="text">Οὐχὶ ταὐτὰ παρίσταταί μοι </div><div class="data" data-tag="v1">γιγνώσκειν</div><div class="text">, </div><div class="data" data-tag="v2">ὦ ἄνδρες ᾿Αθηναῖοι</div></div><div class="line"><div class="text">გთხოვთ </div><div class="data" data-tag="v1">ახლავე გაიაროთ რეგისტრაცია</div><div class="text"> </div><div class="data" data-tag="v2">Unicode-ის მეათე საერთაშორისო</div></div><div class="line"><div class="title">Width</div><div class="decoration">:</div><div class="padding"> </div><div class="data" data-tag="width">63</div></div><div class="line"><div class="text">[</div><div class="data" data-tag="sinhala">෴ණ්ණ෴</div><div class="text">]</div></div><div class="line"><div class="title">Width</div><div class="decoration">:</div><div class="padding"> </div><div class="data" data-tag="width">7</div></div><div class="line"><div class="text">[</div><div class="data" data-tag="sinhala">෴</div><div class="text">]</div></div><div class="line"><div class="title">Width</div><div class="decoration">:</div><div class="padding"> </div><div class="data" data-tag="width">3</div></div><div class="line"><div class="text">[</div><div class="data" data-tag="sinhala">෴ණ්ණ</div><div class="text">]</div></div><div class="line"><div class="text">[</div><div class="data" data-tag="not-sinhala">1234</div><div class="text">]</div></div><div class="line"><div class="text">[</div><div class="data" data-tag="tag">ර්‍ඝ</div><div class="text">]</div></div><div class="line"><div class="title">Width</div><div class="decoration">:</div><div class="padding"> </div><div class="data" data-tag="width">5</div></div><div class="line"><div class="title">First Name </div><div class="title">Last Name </div><div class="title">Department </div><div class="title">Time (%)</div></div><div class="line"><div class="data" data-tag="first-name">Jim</div><div class="text"> (</div><div class="data" data-tag="nic-name">"რეგტ"</div><div class="text">)</div><div class="padding"> </div><div class="data" data-tag="last-name">გთხოვთ ახ </div><div class="data" data-tag="department"> 431</div><div class="data" data-tag="percent-time"> 90</div></div><div class="line"><div class="data" data-tag="first-name">Terry</div><div class="text"> (</div><div class="data" data-tag="nic-name">"&lt;one"</div><div class="text">)</div><div class="padding"> </div><div class="data" data-tag="last-name">Οὐχὶ ταὐτὰ παρ</div><div class="data" data-tag="department"> 660</div><div class="data" data-tag="percent-time"> 90</div></div><div class="line"><div class="data" data-tag="first-name">Leslie</div><div class="text"> (</div><div class="data" data-tag="nic-name">"Les"</div><div class="text">)</div><div class="padding"> </div><div class="data" data-tag="last-name">Patterson </div><div class="data" data-tag="department"> 341</div><div class="data" data-tag="percent-time"> 60</div></div><div class="line"><div class="data" data-tag="first-name">Ashley</div><div class="text"> (</div><div class="data" data-tag="nic-name">"Ash"</div><div class="text">)</div><div class="padding"> </div><div class="data" data-tag="last-name">Meter &amp; Smith </div><div class="data" data-tag="department"> 1440</div><div class="data" data-tag="percent-time"> 40</div></div><div class="line"><div class="data" data-tag="first-name">0123456789</div><div class="text"> (</div><div class="data" data-tag="nic-name">"0123456789"</div><div class="text">)</div><div class="data" data-tag="last-name">01234567890123</div><div class="data" data-tag="department"> 1440</div><div class="data" data-tag="percent-time"> 40</div></div><div class="line"><div class="data" data-tag="first-name">ახლა</div><div class="text"> (</div><div class="data" data-tag="nic-name">"გაიარო"</div><div class="text">)</div><div class="padding"> </div><div class="data" data-tag="last-name">საერთაშორისო </div><div class="data" data-tag="department"> 123</div><div class="data" data-tag="percent-time"> 90</div></div><div class="line"><div class="data" data-tag="first-name">෴ණ්ණ෴෴ණ්ණ෴</div><div class="text"> (</div><div class="data" data-tag="nic-name">"Mick"</div><div class="text">)</div><div class="padding"> </div><div class="data" data-tag="last-name">෴ණ්ණ෴෴ණ්ණ෴෴ණ්ණ</div><div class="data" data-tag="department"> 110</div><div class="data" data-tag="percent-time"> 20</div></div>

View File

@ -10,6 +10,55 @@
<div class="text"> </div> <div class="text"> </div>
<div class="data" data-tag="v2" data-xpath="/employees/v2">Unicode-ის მეათე საერთაშორისო</div> <div class="data" data-tag="v2" data-xpath="/employees/v2">Unicode-ის მეათე საერთაშორისო</div>
</div> </div>
<div class="line">
<div class="title">Width</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="width" data-xpath="/employees/width">63</div>
</div>
<div class="line">
<div class="text">[</div>
<div class="data" data-tag="sinhala" data-xpath="/employees/sinhala">෴ණ්ණ෴</div>
<div class="text">]</div>
</div>
<div class="line">
<div class="title">Width</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="width" data-xpath="/employees/width">7</div>
</div>
<div class="line">
<div class="text">[</div>
<div class="data" data-tag="sinhala" data-xpath="/employees/sinhala">෴</div>
<div class="text">]</div>
</div>
<div class="line">
<div class="title">Width</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="width" data-xpath="/employees/width">3</div>
</div>
<div class="line">
<div class="text">[</div>
<div class="data" data-tag="sinhala" data-xpath="/employees/sinhala">෴ණ්ණ</div>
<div class="text">]</div>
</div>
<div class="line">
<div class="text">[</div>
<div class="data" data-tag="not-sinhala" data-xpath="/employees/not-sinhala">1234</div>
<div class="text">]</div>
</div>
<div class="line">
<div class="text">[</div>
<div class="data" data-tag="tag" data-xpath="/employees/tag">ර්‍ඝ</div>
<div class="text">]</div>
</div>
<div class="line">
<div class="title">Width</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="width" data-xpath="/employees/width">5</div>
</div>
<div class="line"> <div class="line">
<div class="title">First Name </div> <div class="title">First Name </div>
<div class="title">Last Name </div> <div class="title">Last Name </div>
@ -75,3 +124,13 @@
<div class="data" data-tag="department" data-xpath="/employees/employee/department"> 123</div> <div class="data" data-tag="department" data-xpath="/employees/employee/department"> 123</div>
<div class="data" data-tag="percent-time" data-xpath="/employees/employee/percent-time" data-type="number" data-help="Percentage of full &amp; part time (%)"> 90</div> <div class="data" data-tag="percent-time" data-xpath="/employees/employee/percent-time" data-type="number" data-help="Percentage of full &amp; part time (%)"> 90</div>
</div> </div>
<div class="line">
<div class="data" data-tag="first-name" data-xpath="/employees/employee/first-name" data-type="string" data-help="First name of employee">෴ණ්ණ෴෴ණ්ණ෴</div>
<div class="text"> (</div>
<div class="data" data-tag="nic-name" data-xpath="/employees/employee/nic-name">"Mick"</div>
<div class="text">)</div>
<div class="padding"> </div>
<div class="data" data-tag="last-name" data-xpath="/employees/employee/last-name" data-type="string" data-help="Last name of employee">෴ණ්ණ෴෴ණ්ණ෴෴ණ්ණ</div>
<div class="data" data-tag="department" data-xpath="/employees/employee/department"> 110</div>
<div class="data" data-tag="percent-time" data-xpath="/employees/employee/percent-time" data-type="number" data-help="Percentage of full &amp; part time (%)"> 20</div>
</div>

View File

@ -10,6 +10,55 @@
<div class="text"> </div> <div class="text"> </div>
<div class="data" data-tag="v2">Unicode-ის მეათე საერთაშორისო</div> <div class="data" data-tag="v2">Unicode-ის მეათე საერთაშორისო</div>
</div> </div>
<div class="line">
<div class="title">Width</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="width">63</div>
</div>
<div class="line">
<div class="text">[</div>
<div class="data" data-tag="sinhala">෴ණ්ණ෴</div>
<div class="text">]</div>
</div>
<div class="line">
<div class="title">Width</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="width">7</div>
</div>
<div class="line">
<div class="text">[</div>
<div class="data" data-tag="sinhala">෴</div>
<div class="text">]</div>
</div>
<div class="line">
<div class="title">Width</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="width">3</div>
</div>
<div class="line">
<div class="text">[</div>
<div class="data" data-tag="sinhala">෴ණ්ණ</div>
<div class="text">]</div>
</div>
<div class="line">
<div class="text">[</div>
<div class="data" data-tag="not-sinhala">1234</div>
<div class="text">]</div>
</div>
<div class="line">
<div class="text">[</div>
<div class="data" data-tag="tag">ර්‍ඝ</div>
<div class="text">]</div>
</div>
<div class="line">
<div class="title">Width</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="width">5</div>
</div>
<div class="line"> <div class="line">
<div class="title">First Name </div> <div class="title">First Name </div>
<div class="title">Last Name </div> <div class="title">Last Name </div>
@ -75,3 +124,13 @@
<div class="data" data-tag="department"> 123</div> <div class="data" data-tag="department"> 123</div>
<div class="data" data-tag="percent-time"> 90</div> <div class="data" data-tag="percent-time"> 90</div>
</div> </div>
<div class="line">
<div class="data" data-tag="first-name">෴ණ්ණ෴෴ණ්ණ෴</div>
<div class="text"> (</div>
<div class="data" data-tag="nic-name">"Mick"</div>
<div class="text">)</div>
<div class="padding"> </div>
<div class="data" data-tag="last-name">෴ණ්ණ෴෴ණ්ණ෴෴ණ්ණ</div>
<div class="data" data-tag="department"> 110</div>
<div class="data" data-tag="percent-time"> 20</div>
</div>

View File

@ -1,2 +1,2 @@
{"employees": {"v1":"γιγνώσκειν","v2":"ὦ ἄνδρες ᾿Αθηναῖοι","v1":"ახლავე გაიაროთ რეგისტრაცია","v2":"Unicode-ის მეათე საერთაშორისო", "employee": [{"first-name":"Jim","nic-name":"\"რეგტ\"","last-name":"გთხოვთ ახ","department":431,"percent-time":90,"benefits":"full"}, {"first-name":"Terry","nic-name":"\"<one\"","last-name":"Οὐχὶ ταὐτὰ παρίσταταί μοι Jones","department":660,"percent-time":90,"benefits":"full"}, {"first-name":"Leslie","nic-name":"\"Les\"","last-name":"Patterson","department":341,"percent-time":60,"benefits":"full"}, {"first-name":"Ashley","nic-name":"\"Ash\"","last-name":"Meter & Smith","department":1440,"percent-time":40}, {"first-name":"0123456789","nic-name":"\"0123456789\"","last-name":"012345678901234567890","department":1440,"percent-time":40}, {"first-name":"ახლა","nic-name":"\"გაიარო\"","last-name":"საერთაშორისო","department":123,"percent-time":90,"benefits":"full"}]} {"employees": {"v1":"γιγνώσκειν","v2":"ὦ ἄνδρες ᾿Αθηναῖοι","v1":"ახლავე გაიაროთ რეგისტრაცია","v2":"Unicode-ის მეათე საერთაშორისო","width":55,"sinhala":"෴ණ්ණ෴","width":5,"sinhala":"෴","width":1,"sinhala":"෴ණ්ණ෴෴ණ්ණ෴","not-sinhala":"123456","tag":"ර්‍ඝ","width":3, "employee": [{"first-name":"Jim","nic-name":"\"რეგტ\"","last-name":"გთხოვთ ახ","department":431,"percent-time":90,"benefits":"full"}, {"first-name":"Terry","nic-name":"\"<one\"","last-name":"Οὐχὶ ταὐτὰ παρίσταταί μοι Jones","department":660,"percent-time":90,"benefits":"full"}, {"first-name":"Leslie","nic-name":"\"Les\"","last-name":"Patterson","department":341,"percent-time":60,"benefits":"full"}, {"first-name":"Ashley","nic-name":"\"Ash\"","last-name":"Meter & Smith","department":1440,"percent-time":40}, {"first-name":"0123456789","nic-name":"\"0123456789\"","last-name":"012345678901234567890","department":1440,"percent-time":40}, {"first-name":"ახლა","nic-name":"\"გაიარო\"","last-name":"საერთაშორისო","department":123,"percent-time":90,"benefits":"full"}, {"first-name":"෴ණ්ණ෴෴ණ්ණ෴","nic-name":"\"Mick\"","last-name":"෴ණ්ණ෴෴ණ්ණ෴෴ණ්ණ෴෴෴","department":110,"percent-time":20}]}
} }

View File

@ -4,6 +4,15 @@
"v2": "ὦ ἄνδρες ᾿Αθηναῖοι", "v2": "ὦ ἄνδρες ᾿Αθηναῖοι",
"v1": "ახლავე გაიაროთ რეგისტრაცია", "v1": "ახლავე გაიაროთ რეგისტრაცია",
"v2": "Unicode-ის მეათე საერთაშორისო", "v2": "Unicode-ის მეათე საერთაშორისო",
"width": 55,
"sinhala": "෴ණ්ණ෴",
"width": 5,
"sinhala": "෴",
"width": 1,
"sinhala": "෴ණ්ණ෴෴ණ්ණ෴",
"not-sinhala": "123456",
"tag": "ර්‍ඝ",
"width": 3,
"employee": [ "employee": [
{ {
"first-name": "Jim", "first-name": "Jim",
@ -50,6 +59,13 @@
"department": 123, "department": 123,
"percent-time": 90, "percent-time": 90,
"benefits": "full" "benefits": "full"
},
{
"first-name": "෴ණ්ණ෴෴ණ්ණ෴",
"nic-name": "\"Mick\"",
"last-name": "෴ණ්ණ෴෴ණ්ණ෴෴ණ්ණ෴෴෴",
"department": 110,
"percent-time": 20
} }
] ]
} }

View File

@ -1,5 +1,14 @@
Οὐχὶ ταὐτὰ παρίσταταί μοι γιγνώσκειν, ὦ ἄνδρες ᾿Αθηναῖοι Οὐχὶ ταὐτὰ παρίσταταί μοι γιγνώσκειν, ὦ ἄνδρες ᾿Αθηναῖοι
გთხოვთ ახლავე გაიაროთ რეგისტრაცია Unicode-ის მეათე საერთაშორისო გთხოვთ ახლავე გაიაროთ რეგისტრაცია Unicode-ის მეათე საერთაშორისო
Width: 63
[෴ණ්ණ෴]
Width: 7
[෴]
Width: 3
[෴ණ්ණ]
[1234]
[ර්‍ඝ]
Width: 5
First Name Last Name Department Time (%) First Name Last Name Department Time (%)
Jim ("რეგტ") გთხოვთ ახ 431 90 Jim ("რეგტ") გთხოვთ ახ 431 90
Terry ("<one") Οὐχὶ ταὐτὰ παρ 660 90 Terry ("<one") Οὐχὶ ταὐτὰ παρ 660 90
@ -7,3 +16,4 @@ Leslie ("Les") Patterson 341 60
Ashley ("Ash") Meter & Smith 1440 40 Ashley ("Ash") Meter & Smith 1440 40
0123456789 ("0123456789")01234567890123 1440 40 0123456789 ("0123456789")01234567890123 1440 40
ახლა ("გაიარო") საერთაშორისო 123 90 ახლა ("გაიარო") საერთაშორისო 123 90
෴ණ්ණ෴෴ණ්ණ෴ ("Mick") ෴ණ්ණ෴෴ණ්ණ෴෴ණ්ණ 110 20

View File

@ -1 +1 @@
<employees><v1>γιγνώσκειν</v1><v2>ὦ ἄνδρες ᾿Αθηναῖοι</v2><v1>ახლავე გაიაროთ რეგისტრაცია</v1><v2>Unicode-ის მეათე საერთაშორისო</v2><employee><first-name>Jim</first-name><nic-name>"რეგტ"</nic-name><last-name>გთხოვთ ახ</last-name><department>431</department><percent-time>90</percent-time><benefits full-time="honest &amp; for true">full</benefits></employee><employee><first-name>Terry</first-name><nic-name>"&lt;one"</nic-name><last-name>Οὐχὶ ταὐτὰ παρίσταταί μοι Jones</last-name><department>660</department><percent-time>90</percent-time><benefits full-time="honest &amp; for true">full</benefits></employee><employee><first-name>Leslie</first-name><nic-name>"Les"</nic-name><last-name>Patterson</last-name><department>341</department><percent-time>60</percent-time><benefits full-time="honest &amp; for true">full</benefits></employee><employee><first-name>Ashley</first-name><nic-name>"Ash"</nic-name><last-name>Meter &amp; Smith</last-name><department>1440</department><percent-time>40</percent-time></employee><employee><first-name>0123456789</first-name><nic-name>"0123456789"</nic-name><last-name>012345678901234567890</last-name><department>1440</department><percent-time>40</percent-time></employee><employee><first-name>ახლა</first-name><nic-name>"გაიარო"</nic-name><last-name>საერთაშორისო</last-name><department>123</department><percent-time>90</percent-time><benefits full-time="honest &amp; for true">full</benefits></employee></employees> <employees><v1>γιγνώσκειν</v1><v2>ὦ ἄνδρες ᾿Αθηναῖοι</v2><v1>ახლავე გაიაროთ რეგისტრაცია</v1><v2>Unicode-ის მეათე საერთაშორისო</v2><width>55</width><sinhala>෴ණ්ණ෴</sinhala><width>5</width><sinhala>෴</sinhala><width>1</width><sinhala>෴ණ්ණ෴෴ණ්ණ෴</sinhala><not-sinhala>123456</not-sinhala><tag>ර්‍ඝ</tag><width>3</width><employee><first-name>Jim</first-name><nic-name>"რეგტ"</nic-name><last-name>გთხოვთ ახ</last-name><department>431</department><percent-time>90</percent-time><benefits full-time="honest &amp; for true">full</benefits></employee><employee><first-name>Terry</first-name><nic-name>"&lt;one"</nic-name><last-name>Οὐχὶ ταὐτὰ παρίσταταί μοι Jones</last-name><department>660</department><percent-time>90</percent-time><benefits full-time="honest &amp; for true">full</benefits></employee><employee><first-name>Leslie</first-name><nic-name>"Les"</nic-name><last-name>Patterson</last-name><department>341</department><percent-time>60</percent-time><benefits full-time="honest &amp; for true">full</benefits></employee><employee><first-name>Ashley</first-name><nic-name>"Ash"</nic-name><last-name>Meter &amp; Smith</last-name><department>1440</department><percent-time>40</percent-time></employee><employee><first-name>0123456789</first-name><nic-name>"0123456789"</nic-name><last-name>012345678901234567890</last-name><department>1440</department><percent-time>40</percent-time></employee><employee><first-name>ახლა</first-name><nic-name>"გაიარო"</nic-name><last-name>საერთაშორისო</last-name><department>123</department><percent-time>90</percent-time><benefits full-time="honest &amp; for true">full</benefits></employee><employee><first-name>෴ණ්ණ෴෴ණ්ණ෴</first-name><nic-name>"Mick"</nic-name><last-name>෴ණ්ණ෴෴ණ්ණ෴෴ණ්ණ෴෴෴</last-name><department>110</department><percent-time>20</percent-time></employee></employees>

View File

@ -3,6 +3,15 @@
<v2>ὦ ἄνδρες ᾿Αθηναῖοι</v2> <v2>ὦ ἄνδρες ᾿Αθηναῖοι</v2>
<v1>ახლავე გაიაროთ რეგისტრაცია</v1> <v1>ახლავე გაიაროთ რეგისტრაცია</v1>
<v2>Unicode-ის მეათე საერთაშორისო</v2> <v2>Unicode-ის მეათე საერთაშორისო</v2>
<width>55</width>
<sinhala>෴ණ්ණ෴</sinhala>
<width>5</width>
<sinhala>෴</sinhala>
<width>1</width>
<sinhala>෴ණ්ණ෴෴ණ්ණ෴</sinhala>
<not-sinhala>123456</not-sinhala>
<tag>ර්‍ඝ</tag>
<width>3</width>
<employee> <employee>
<first-name>Jim</first-name> <first-name>Jim</first-name>
<nic-name>"რეგტ"</nic-name> <nic-name>"რეგტ"</nic-name>
@ -49,4 +58,11 @@
<percent-time>90</percent-time> <percent-time>90</percent-time>
<benefits full-time="honest &amp; for true">full</benefits> <benefits full-time="honest &amp; for true">full</benefits>
</employee> </employee>
<employee>
<first-name>෴ණ්ණ෴෴ණ්ණ෴</first-name>
<nic-name>"Mick"</nic-name>
<last-name>෴ණ්ණ෴෴ණ්ණ෴෴ණ්ණ෴෴෴</last-name>
<department>110</department>
<percent-time>20</percent-time>
</employee>
</employees> </employees>

View File

@ -3,17 +3,29 @@
"data": { "data": {
"contents": { "contents": {
"name": [ "name": [
"gum", "rope", "ladder", "bolt", "water" "gum",
"rope",
"ladder",
"bolt",
"water"
] ]
}, },
"contents": { "contents": {
"item": [ "item": [
"gum", "rope", "ladder", "bolt", "water" "gum",
"rope",
"ladder",
"bolt",
"water"
] ]
}, },
"contents": { "contents": {
"item": [ "item": [
"gum", "rope", "ladder", "bolt", "water" "gum",
"rope",
"ladder",
"bolt",
"water"
], ],
"total": "six", "total": "six",
"one": "one", "one": "one",

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,316 @@
<div class="line">
<div class="title color-fg-blue">blue</div>
<div class="title color-fg-green color-bg-blue">green</div>
<div class="title color-fg-red color-bg-green">red</div>
<div class="title color-fg-yellow color-bg-red">yellow</div>
<div class="title color-bg-yellow">default</div>
</div>
<div class="line">
<div class="data effect-bold" data-tag="data" data-xpath="/top/data/data">bold</div>
<div class="text effect-bold"> </div>
<div class="data effect-bold effect-underline" data-tag="data" data-xpath="/top/data/data">bold-ul</div>
<div class="text effect-bold effect-underline"> </div>
<div class="data effect-bold effect-underline effect-inverse color-fg-inverse color-bg-inverse" data-tag="data" data-xpath="/top/data/data">triple</div>
<div class="text effect-bold effect-underline effect-inverse color-fg-inverse color-bg-inverse"> </div>
<div class="data effect-underline effect-inverse color-fg-inverse color-bg-inverse" data-tag="data" data-xpath="/top/data/data">inv-ul</div>
<div class="text effect-underline effect-inverse color-fg-inverse color-bg-inverse"> </div>
<div class="data effect-underline" data-tag="data" data-xpath="/top/data/data">underline</div>
<div class="text effect-underline"> </div>
<div class="data" data-tag="data" data-xpath="/top/data/data">plain</div>
</div>
<div class="line">
<div class="title">Item </div>
<div class="title effect-bold effect-underline"> Total Sold</div>
<div class="title effect-underline"> In Stock</div>
<div class="title effect-underline effect-inverse color-fg-inverse color-bg-inverse"> On Order</div>
<div class="title"> SKU</div>
</div>
<div class="line">
<div class="data" data-tag="name" data-xpath="/top/data/item/name" data-type="string" data-help="Name of the item" data-key="key">gum </div>
<div class="data" data-tag="sold" data-xpath="/top/data/item[sku = 'GRO-000-415'][name = 'gum']/sold" data-type="number" data-help="Number of items sold"> 1412</div>
<div class="data" data-tag="in-stock" data-xpath="/top/data/item[sku = 'GRO-000-415'][name = 'gum']/in-stock" data-type="number" data-help="Number of items in stock"> 54</div>
<div class="data color-fg-yellow" data-tag="on-order" data-xpath="/top/data/item[sku = 'GRO-000-415'][name = 'gum']/on-order" data-type="number" data-help="Number of items on order"> 10</div>
<div class="data" data-tag="sku" data-xpath="/top/data/item/sku" data-type="string" data-help="Stock Keeping Unit" data-key="key"> GRO-000-415</div>
</div>
<div class="line">
<div class="data" data-tag="name" data-xpath="/top/data/item/name" data-type="string" data-help="Name of the item" data-key="key">rope </div>
<div class="data" data-tag="sold" data-xpath="/top/data/item[sku = 'HRD-000-212'][name = 'rope']/sold" data-type="number" data-help="Number of items sold"> 85</div>
<div class="data effect-inverse color-fg-inverse color-bg-inverse" data-tag="in-stock" data-xpath="/top/data/item[sku = 'HRD-000-212'][name = 'rope']/in-stock" data-type="number" data-help="Number of items in stock"> 4</div>
<div class="data" data-tag="on-order" data-xpath="/top/data/item[sku = 'HRD-000-212'][name = 'rope']/on-order" data-type="number" data-help="Number of items on order"> 2</div>
<div class="data" data-tag="sku" data-xpath="/top/data/item/sku" data-type="string" data-help="Stock Keeping Unit" data-key="key"> HRD-000-212</div>
</div>
<div class="line">
<div class="data" data-tag="name" data-xpath="/top/data/item/name" data-type="string" data-help="Name of the item" data-key="key">ladder </div>
<div class="data" data-tag="sold" data-xpath="/top/data/item[sku = 'HRD-000-517'][name = 'ladder']/sold" data-type="number" data-help="Number of items sold"> 0</div>
<div class="data effect-inverse color-fg-inverse color-bg-inverse" data-tag="in-stock" data-xpath="/top/data/item[sku = 'HRD-000-517'][name = 'ladder']/in-stock" data-type="number" data-help="Number of items in stock"> 2</div>
<div class="data" data-tag="on-order" data-xpath="/top/data/item[sku = 'HRD-000-517'][name = 'ladder']/on-order" data-type="number" data-help="Number of items on order"> 1</div>
<div class="data" data-tag="sku" data-xpath="/top/data/item/sku" data-type="string" data-help="Stock Keeping Unit" data-key="key"> HRD-000-517</div>
</div>
<div class="line">
<div class="data" data-tag="name" data-xpath="/top/data/item/name" data-type="string" data-help="Name of the item" data-key="key">bolt </div>
<div class="data" data-tag="sold" data-xpath="/top/data/item[sku = 'HRD-000-632'][name = 'bolt']/sold" data-type="number" data-help="Number of items sold"> 4123</div>
<div class="data" data-tag="in-stock" data-xpath="/top/data/item[sku = 'HRD-000-632'][name = 'bolt']/in-stock" data-type="number" data-help="Number of items in stock"> 144</div>
<div class="data color-fg-yellow" data-tag="on-order" data-xpath="/top/data/item[sku = 'HRD-000-632'][name = 'bolt']/on-order" data-type="number" data-help="Number of items on order"> 42</div>
<div class="data" data-tag="sku" data-xpath="/top/data/item/sku" data-type="string" data-help="Stock Keeping Unit" data-key="key"> HRD-000-632</div>
</div>
<div class="line">
<div class="data" data-tag="name" data-xpath="/top/data/item/name" data-type="string" data-help="Name of the item" data-key="key">water </div>
<div class="data" data-tag="sold" data-xpath="/top/data/item[sku = 'GRO-000-2331'][name = 'water']/sold" data-type="number" data-help="Number of items sold"> 17</div>
<div class="data" data-tag="in-stock" data-xpath="/top/data/item[sku = 'GRO-000-2331'][name = 'water']/in-stock" data-type="number" data-help="Number of items in stock"> 14</div>
<div class="data" data-tag="on-order" data-xpath="/top/data/item[sku = 'GRO-000-2331'][name = 'water']/on-order" data-type="number" data-help="Number of items on order"> 2</div>
<div class="data" data-tag="sku" data-xpath="/top/data/item/sku" data-type="string" data-help="Stock Keeping Unit" data-key="key"> GRO-000-2331</div>
</div>
<div class="line">
</div>
<div class="line">
</div>
<div class="line">
<div class="label">Item</div>
<div class="text"> '</div>
<div class="data" data-tag="name" data-xpath="/top/data/item/name" data-type="string" data-help="Name of the item" data-key="key">gum</div>
<div class="text">':</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">Total sold</div>
<div class="text">: </div>
<div class="data" data-tag="sold" data-xpath="/top/data/item[sku = 'GRO-000-415'][name = 'gum']/sold" data-type="number" data-help="Number of items sold">1412.0</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">In stock</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data effect-inverse color-fg-inverse color-bg-inverse" data-tag="in-stock" data-xpath="/top/data/item[sku = 'GRO-000-415'][name = 'gum']/in-stock" data-type="number" data-help="Number of items in stock">54</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">On order</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="on-order" data-xpath="/top/data/item[sku = 'GRO-000-415'][name = 'gum']/on-order" data-type="number" data-help="Number of items on order">10</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">SKU</div>
<div class="text">: </div>
<div class="data" data-tag="sku" data-xpath="/top/data/item/sku" data-type="string" data-help="Stock Keeping Unit" data-key="key">GRO-000-415</div>
</div>
<div class="line">
<div class="label">Item</div>
<div class="text"> '</div>
<div class="data" data-tag="name" data-xpath="/top/data/item/name" data-type="string" data-help="Name of the item" data-key="key">rope</div>
<div class="text">':</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">Total sold</div>
<div class="text">: </div>
<div class="data" data-tag="sold" data-xpath="/top/data/item[sku = 'HRD-000-212'][name = 'rope']/sold" data-type="number" data-help="Number of items sold">85.0</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">In stock</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data effect-inverse color-fg-inverse color-bg-inverse" data-tag="in-stock" data-xpath="/top/data/item[sku = 'HRD-000-212'][name = 'rope']/in-stock" data-type="number" data-help="Number of items in stock">4</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">On order</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="on-order" data-xpath="/top/data/item[sku = 'HRD-000-212'][name = 'rope']/on-order" data-type="number" data-help="Number of items on order">2</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">SKU</div>
<div class="text">: </div>
<div class="data" data-tag="sku" data-xpath="/top/data/item/sku" data-type="string" data-help="Stock Keeping Unit" data-key="key">HRD-000-212</div>
</div>
<div class="line">
<div class="label">Item</div>
<div class="text"> '</div>
<div class="data" data-tag="name" data-xpath="/top/data/item/name" data-type="string" data-help="Name of the item" data-key="key">ladder</div>
<div class="text">':</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">Total sold</div>
<div class="text">: </div>
<div class="data" data-tag="sold" data-xpath="/top/data/item[sku = 'HRD-000-517'][name = 'ladder']/sold" data-type="number" data-help="Number of items sold">0</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">In stock</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data effect-inverse color-fg-inverse color-bg-inverse" data-tag="in-stock" data-xpath="/top/data/item[sku = 'HRD-000-517'][name = 'ladder']/in-stock" data-type="number" data-help="Number of items in stock">2</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">On order</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="on-order" data-xpath="/top/data/item[sku = 'HRD-000-517'][name = 'ladder']/on-order" data-type="number" data-help="Number of items on order">1</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">SKU</div>
<div class="text">: </div>
<div class="data" data-tag="sku" data-xpath="/top/data/item/sku" data-type="string" data-help="Stock Keeping Unit" data-key="key">HRD-000-517</div>
</div>
<div class="line">
<div class="label">Item</div>
<div class="text"> '</div>
<div class="data" data-tag="name" data-xpath="/top/data/item/name" data-type="string" data-help="Name of the item" data-key="key">bolt</div>
<div class="text">':</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">Total sold</div>
<div class="text">: </div>
<div class="data" data-tag="sold" data-xpath="/top/data/item[sku = 'HRD-000-632'][name = 'bolt']/sold" data-type="number" data-help="Number of items sold">4123.0</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">In stock</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data effect-inverse color-fg-inverse color-bg-inverse" data-tag="in-stock" data-xpath="/top/data/item[sku = 'HRD-000-632'][name = 'bolt']/in-stock" data-type="number" data-help="Number of items in stock">144</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">On order</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="on-order" data-xpath="/top/data/item[sku = 'HRD-000-632'][name = 'bolt']/on-order" data-type="number" data-help="Number of items on order">42</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">SKU</div>
<div class="text">: </div>
<div class="data" data-tag="sku" data-xpath="/top/data/item/sku" data-type="string" data-help="Stock Keeping Unit" data-key="key">HRD-000-632</div>
</div>
<div class="line">
<div class="label">Item</div>
<div class="text"> '</div>
<div class="data" data-tag="name" data-xpath="/top/data/item/name" data-type="string" data-help="Name of the item" data-key="key">water</div>
<div class="text">':</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">Total sold</div>
<div class="text">: </div>
<div class="data" data-tag="sold" data-xpath="/top/data/item[sku = 'GRO-000-2331'][name = 'water']/sold" data-type="number" data-help="Number of items sold">17.0</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">In stock</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data effect-inverse color-fg-inverse color-bg-inverse" data-tag="in-stock" data-xpath="/top/data/item[sku = 'GRO-000-2331'][name = 'water']/in-stock" data-type="number" data-help="Number of items in stock">14</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">On order</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="on-order" data-xpath="/top/data/item[sku = 'GRO-000-2331'][name = 'water']/on-order" data-type="number" data-help="Number of items on order">2</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">SKU</div>
<div class="text">: </div>
<div class="data" data-tag="sku" data-xpath="/top/data/item/sku" data-type="string" data-help="Stock Keeping Unit" data-key="key">GRO-000-2331</div>
</div>
<div class="line">
<div class="label">Item</div>
<div class="text"> '</div>
<div class="data" data-tag="name" data-xpath="/top/data/item/name" data-type="string" data-help="Name of the item" data-key="key">fish</div>
<div class="text">':</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label effect-bold color-fg-white color-bg-blue">Total sold</div>
<div class="text effect-bold color-fg-white color-bg-blue">: </div>
<div class="data effect-bold color-fg-white color-bg-blue" data-tag="sold" data-xpath="/top/data/item[sku = 'GRO-000-533'][name = 'fish']/sold" data-type="number" data-help="Number of items sold">1321.0</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">In stock</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="in-stock" data-xpath="/top/data/item[sku = 'GRO-000-533'][name = 'fish']/in-stock" data-type="number" data-help="Number of items in stock">45</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">On order</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="on-order" data-xpath="/top/data/item[sku = 'GRO-000-533'][name = 'fish']/on-order" data-type="number" data-help="Number of items on order">1</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">SKU</div>
<div class="text">: </div>
<div class="data" data-tag="sku" data-xpath="/top/data/item/sku" data-type="string" data-help="Stock Keeping Unit" data-key="key">GRO-000-533</div>
</div>
<div class="line">
<div class="label">Item</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="item" data-xpath="/top/data/item">gum</div>
</div>
<div class="line">
<div class="label">Item</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="item" data-xpath="/top/data/item">rope</div>
</div>
<div class="line">
<div class="label">Item</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="item" data-xpath="/top/data/item">ladder</div>
</div>
<div class="line">
<div class="label">Item</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="item" data-xpath="/top/data/item">bolt</div>
</div>
<div class="line">
<div class="label">Item</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="item" data-xpath="/top/data/item">water</div>
</div>
<div class="line">
<div class="text">X</div>
<div class="text">X</div>
<div class="text">X</div>
<div class="text">X</div>
<div class="text">X</div>
<div class="text">X</div>
<div class="text">X</div>
<div class="text">X</div>
</div>
<div class="line">
<div class="text">X</div>
<div class="padding"> </div>
<div class="text">X</div>
<div class="label">Cost</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="cost" data-xpath="/top/cost">425</div>
</div>
<div class="line">
<div class="text">X</div>
<div class="padding"> </div>
<div class="text">X</div>
<div class="label">Cost</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="cost" data-xpath="/top/cost">455</div>
</div>

View File

@ -0,0 +1,316 @@
<div class="line">
<div class="title color-fg-blue">blue</div>
<div class="title color-fg-green color-bg-blue">green</div>
<div class="title color-fg-red color-bg-green">red</div>
<div class="title color-fg-yellow color-bg-red">yellow</div>
<div class="title color-bg-yellow">default</div>
</div>
<div class="line">
<div class="data effect-bold" data-tag="data">bold</div>
<div class="text effect-bold"> </div>
<div class="data effect-bold effect-underline" data-tag="data">bold-ul</div>
<div class="text effect-bold effect-underline"> </div>
<div class="data effect-bold effect-underline effect-inverse color-fg-inverse color-bg-inverse" data-tag="data">triple</div>
<div class="text effect-bold effect-underline effect-inverse color-fg-inverse color-bg-inverse"> </div>
<div class="data effect-underline effect-inverse color-fg-inverse color-bg-inverse" data-tag="data">inv-ul</div>
<div class="text effect-underline effect-inverse color-fg-inverse color-bg-inverse"> </div>
<div class="data effect-underline" data-tag="data">underline</div>
<div class="text effect-underline"> </div>
<div class="data" data-tag="data">plain</div>
</div>
<div class="line">
<div class="title">Item </div>
<div class="title effect-bold effect-underline"> Total Sold</div>
<div class="title effect-underline"> In Stock</div>
<div class="title effect-underline effect-inverse color-fg-inverse color-bg-inverse"> On Order</div>
<div class="title"> SKU</div>
</div>
<div class="line">
<div class="data" data-tag="name" data-key="key">gum </div>
<div class="data" data-tag="sold"> 1412</div>
<div class="data" data-tag="in-stock"> 54</div>
<div class="data color-fg-yellow" data-tag="on-order"> 10</div>
<div class="data" data-tag="sku" data-key="key"> GRO-000-415</div>
</div>
<div class="line">
<div class="data" data-tag="name" data-key="key">rope </div>
<div class="data" data-tag="sold"> 85</div>
<div class="data effect-inverse color-fg-inverse color-bg-inverse" data-tag="in-stock"> 4</div>
<div class="data" data-tag="on-order"> 2</div>
<div class="data" data-tag="sku" data-key="key"> HRD-000-212</div>
</div>
<div class="line">
<div class="data" data-tag="name" data-key="key">ladder </div>
<div class="data" data-tag="sold"> 0</div>
<div class="data effect-inverse color-fg-inverse color-bg-inverse" data-tag="in-stock"> 2</div>
<div class="data" data-tag="on-order"> 1</div>
<div class="data" data-tag="sku" data-key="key"> HRD-000-517</div>
</div>
<div class="line">
<div class="data" data-tag="name" data-key="key">bolt </div>
<div class="data" data-tag="sold"> 4123</div>
<div class="data" data-tag="in-stock"> 144</div>
<div class="data color-fg-yellow" data-tag="on-order"> 42</div>
<div class="data" data-tag="sku" data-key="key"> HRD-000-632</div>
</div>
<div class="line">
<div class="data" data-tag="name" data-key="key">water </div>
<div class="data" data-tag="sold"> 17</div>
<div class="data" data-tag="in-stock"> 14</div>
<div class="data" data-tag="on-order"> 2</div>
<div class="data" data-tag="sku" data-key="key"> GRO-000-2331</div>
</div>
<div class="line">
</div>
<div class="line">
</div>
<div class="line">
<div class="label">Item</div>
<div class="text"> '</div>
<div class="data" data-tag="name" data-key="key">gum</div>
<div class="text">':</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">Total sold</div>
<div class="text">: </div>
<div class="data" data-tag="sold">1412.0</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">In stock</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data effect-inverse color-fg-inverse color-bg-inverse" data-tag="in-stock">54</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">On order</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="on-order">10</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">SKU</div>
<div class="text">: </div>
<div class="data" data-tag="sku" data-key="key">GRO-000-415</div>
</div>
<div class="line">
<div class="label">Item</div>
<div class="text"> '</div>
<div class="data" data-tag="name" data-key="key">rope</div>
<div class="text">':</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">Total sold</div>
<div class="text">: </div>
<div class="data" data-tag="sold">85.0</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">In stock</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data effect-inverse color-fg-inverse color-bg-inverse" data-tag="in-stock">4</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">On order</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="on-order">2</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">SKU</div>
<div class="text">: </div>
<div class="data" data-tag="sku" data-key="key">HRD-000-212</div>
</div>
<div class="line">
<div class="label">Item</div>
<div class="text"> '</div>
<div class="data" data-tag="name" data-key="key">ladder</div>
<div class="text">':</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">Total sold</div>
<div class="text">: </div>
<div class="data" data-tag="sold">0</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">In stock</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data effect-inverse color-fg-inverse color-bg-inverse" data-tag="in-stock">2</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">On order</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="on-order">1</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">SKU</div>
<div class="text">: </div>
<div class="data" data-tag="sku" data-key="key">HRD-000-517</div>
</div>
<div class="line">
<div class="label">Item</div>
<div class="text"> '</div>
<div class="data" data-tag="name" data-key="key">bolt</div>
<div class="text">':</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">Total sold</div>
<div class="text">: </div>
<div class="data" data-tag="sold">4123.0</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">In stock</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data effect-inverse color-fg-inverse color-bg-inverse" data-tag="in-stock">144</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">On order</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="on-order">42</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">SKU</div>
<div class="text">: </div>
<div class="data" data-tag="sku" data-key="key">HRD-000-632</div>
</div>
<div class="line">
<div class="label">Item</div>
<div class="text"> '</div>
<div class="data" data-tag="name" data-key="key">water</div>
<div class="text">':</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">Total sold</div>
<div class="text">: </div>
<div class="data" data-tag="sold">17.0</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">In stock</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data effect-inverse color-fg-inverse color-bg-inverse" data-tag="in-stock">14</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">On order</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="on-order">2</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">SKU</div>
<div class="text">: </div>
<div class="data" data-tag="sku" data-key="key">GRO-000-2331</div>
</div>
<div class="line">
<div class="label">Item</div>
<div class="text"> '</div>
<div class="data" data-tag="name" data-key="key">fish</div>
<div class="text">':</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label effect-bold color-fg-white color-bg-blue">Total sold</div>
<div class="text effect-bold color-fg-white color-bg-blue">: </div>
<div class="data effect-bold color-fg-white color-bg-blue" data-tag="sold">1321.0</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">In stock</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="in-stock">45</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">On order</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="on-order">1</div>
</div>
<div class="line">
<div class="padding"> </div>
<div class="label">SKU</div>
<div class="text">: </div>
<div class="data" data-tag="sku" data-key="key">GRO-000-533</div>
</div>
<div class="line">
<div class="label">Item</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="item">gum</div>
</div>
<div class="line">
<div class="label">Item</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="item">rope</div>
</div>
<div class="line">
<div class="label">Item</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="item">ladder</div>
</div>
<div class="line">
<div class="label">Item</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="item">bolt</div>
</div>
<div class="line">
<div class="label">Item</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="item">water</div>
</div>
<div class="line">
<div class="text">X</div>
<div class="text">X</div>
<div class="text">X</div>
<div class="text">X</div>
<div class="text">X</div>
<div class="text">X</div>
<div class="text">X</div>
<div class="text">X</div>
</div>
<div class="line">
<div class="text">X</div>
<div class="padding"> </div>
<div class="text">X</div>
<div class="label">Cost</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="cost">425</div>
</div>
<div class="line">
<div class="text">X</div>
<div class="padding"> </div>
<div class="text">X</div>
<div class="label">Cost</div>
<div class="decoration">:</div>
<div class="padding"> </div>
<div class="data" data-tag="cost">455</div>
</div>

View File

@ -0,0 +1,2 @@
{"__version": "3.1.4", "top": {"data": {"item": [],"data":"bold","data":"bold-ul","data":"triple","data":"inv-ul","data":"underline","data":"plain", "item": [{"sku":"GRO-000-415","name":"gum","sold":1412,"in-stock":54,"on-order":10}, {"sku":"HRD-000-212","name":"rope","sold":85,"in-stock":4,"on-order":2}, {"sku":"HRD-000-517","name":"ladder","sold":0,"in-stock":2,"on-order":1}, {"sku":"HRD-000-632","name":"bolt","sold":4123,"in-stock":144,"on-order":42}, {"sku":"GRO-000-2331","name":"water","sold":17,"in-stock":14,"on-order":2}]}, "data": {"item": [{"sku":"GRO-000-415","name":"gum","sold":1412.0,"in-stock":54,"on-order":10}, {"sku":"HRD-000-212","name":"rope","sold":85.0,"in-stock":4,"on-order":2}, {"sku":"HRD-000-517","name":"ladder","sold":0,"in-stock":2,"on-order":1}, {"sku":"HRD-000-632","name":"bolt","sold":4123.0,"in-stock":144,"on-order":42}, {"sku":"GRO-000-2331","name":"water","sold":17.0,"in-stock":14,"on-order":2}]}, "data": {"item": [{"sku":"GRO-000-533","name":"fish","sold":1321.0,"in-stock":45,"on-order":1}]}, "data": {"item": ["gum","rope","ladder","bolt","water"]},"cost":425,"cost":455}
}

View File

@ -0,0 +1,113 @@
{
"__version": "3.1.4",
"top": {
"data": {
"item": [
],
"data": "bold",
"data": "bold-ul",
"data": "triple",
"data": "inv-ul",
"data": "underline",
"data": "plain",
"item": [
{
"sku": "GRO-000-415",
"name": "gum",
"sold": 1412,
"in-stock": 54,
"on-order": 10
},
{
"sku": "HRD-000-212",
"name": "rope",
"sold": 85,
"in-stock": 4,
"on-order": 2
},
{
"sku": "HRD-000-517",
"name": "ladder",
"sold": 0,
"in-stock": 2,
"on-order": 1
},
{
"sku": "HRD-000-632",
"name": "bolt",
"sold": 4123,
"in-stock": 144,
"on-order": 42
},
{
"sku": "GRO-000-2331",
"name": "water",
"sold": 17,
"in-stock": 14,
"on-order": 2
}
]
},
"data": {
"item": [
{
"sku": "GRO-000-415",
"name": "gum",
"sold": 1412.0,
"in-stock": 54,
"on-order": 10
},
{
"sku": "HRD-000-212",
"name": "rope",
"sold": 85.0,
"in-stock": 4,
"on-order": 2
},
{
"sku": "HRD-000-517",
"name": "ladder",
"sold": 0,
"in-stock": 2,
"on-order": 1
},
{
"sku": "HRD-000-632",
"name": "bolt",
"sold": 4123.0,
"in-stock": 144,
"on-order": 42
},
{
"sku": "GRO-000-2331",
"name": "water",
"sold": 17.0,
"in-stock": 14,
"on-order": 2
}
]
},
"data": {
"item": [
{
"sku": "GRO-000-533",
"name": "fish",
"sold": 1321.0,
"in-stock": 45,
"on-order": 1
}
]
},
"data": {
"item": [
"gum",
"rope",
"ladder",
"bolt",
"water"
]
},
"cost": 425,
"cost": 455
}
}

View File

@ -0,0 +1,48 @@
bluegreenredyellowdefault
bold bold-ul triple inv-ul underline plain
Item  Total Sold In Stock On Order SKU
gum 1412 54 10 GRO-000-415
rope 85 4 2 HRD-000-212
ladder 0 2 1 HRD-000-517
bolt 4123 144 42 HRD-000-632
water 17 14 2 GRO-000-2331
Item 'gum':
Total sold: 1412.0
In stock: 54
On order: 10
SKU: GRO-000-415
Item 'rope':
Total sold: 85.0
In stock: 4
On order: 2
SKU: HRD-000-212
Item 'ladder':
Total sold: 0
In stock: 2
On order: 1
SKU: HRD-000-517
Item 'bolt':
Total sold: 4123.0
In stock: 144
On order: 42
SKU: HRD-000-632
Item 'water':
Total sold: 17.0
In stock: 14
On order: 2
SKU: GRO-000-2331
Item 'fish':
Total sold: 1321.0
In stock: 45
On order: 1
SKU: GRO-000-533
Item: gum
Item: rope
Item: ladder
Item: bolt
Item: water
XXXXXXXX
X XCost: 425
X XCost: 455

View File

@ -0,0 +1 @@
<top __version="3.1.4"><data test="value"><data test2="value2">bold</data><data>bold-ul</data><data>triple</data><data>inv-ul</data><data>underline</data><data>plain</data><item><sku test3="value3" key="key">GRO-000-415</sku><name key="key">gum</name><sold>1412</sold><in-stock>54</in-stock><on-order>10</on-order></item><item><sku test3="value3" key="key">HRD-000-212</sku><name key="key">rope</name><sold>85</sold><in-stock>4</in-stock><on-order>2</on-order></item><item><sku test3="value3" key="key">HRD-000-517</sku><name key="key">ladder</name><sold>0</sold><in-stock>2</in-stock><on-order>1</on-order></item><item><sku test3="value3" key="key">HRD-000-632</sku><name key="key">bolt</name><sold>4123</sold><in-stock>144</in-stock><on-order>42</on-order></item><item><sku test3="value3" key="key">GRO-000-2331</sku><name key="key">water</name><sold>17</sold><in-stock>14</in-stock><on-order>2</on-order></item></data><data><item><sku key="key">GRO-000-415</sku><name key="key">gum</name><sold>1412.0</sold><in-stock>54</in-stock><on-order>10</on-order></item><item><sku key="key">HRD-000-212</sku><name key="key">rope</name><sold>85.0</sold><in-stock>4</in-stock><on-order>2</on-order></item><item><sku key="key">HRD-000-517</sku><name key="key">ladder</name><sold>0</sold><in-stock>2</in-stock><on-order>1</on-order></item><item><sku key="key">HRD-000-632</sku><name key="key">bolt</name><sold>4123.0</sold><in-stock>144</in-stock><on-order>42</on-order></item><item><sku key="key">GRO-000-2331</sku><name key="key">water</name><sold>17.0</sold><in-stock>14</in-stock><on-order>2</on-order></item></data><data><item><sku key="key">GRO-000-533</sku><name key="key">fish</name><sold>1321.0</sold><in-stock>45</in-stock><on-order>1</on-order></item></data><data><item test4="value4">gum</item><item test4="value4">rope</item><item test4="value4">ladder</item><item test4="value4">bolt</item><item test4="value4">water</item></data><cost>425</cost><cost>455</cost></top>

View File

@ -0,0 +1,100 @@
<top __version="3.1.4">
<data test="value">
<data test2="value2">bold</data>
<data>bold-ul</data>
<data>triple</data>
<data>inv-ul</data>
<data>underline</data>
<data>plain</data>
<item>
<sku test3="value3" key="key">GRO-000-415</sku>
<name key="key">gum</name>
<sold>1412</sold>
<in-stock>54</in-stock>
<on-order>10</on-order>
</item>
<item>
<sku test3="value3" key="key">HRD-000-212</sku>
<name key="key">rope</name>
<sold>85</sold>
<in-stock>4</in-stock>
<on-order>2</on-order>
</item>
<item>
<sku test3="value3" key="key">HRD-000-517</sku>
<name key="key">ladder</name>
<sold>0</sold>
<in-stock>2</in-stock>
<on-order>1</on-order>
</item>
<item>
<sku test3="value3" key="key">HRD-000-632</sku>
<name key="key">bolt</name>
<sold>4123</sold>
<in-stock>144</in-stock>
<on-order>42</on-order>
</item>
<item>
<sku test3="value3" key="key">GRO-000-2331</sku>
<name key="key">water</name>
<sold>17</sold>
<in-stock>14</in-stock>
<on-order>2</on-order>
</item>
</data>
<data>
<item>
<sku key="key">GRO-000-415</sku>
<name key="key">gum</name>
<sold>1412.0</sold>
<in-stock>54</in-stock>
<on-order>10</on-order>
</item>
<item>
<sku key="key">HRD-000-212</sku>
<name key="key">rope</name>
<sold>85.0</sold>
<in-stock>4</in-stock>
<on-order>2</on-order>
</item>
<item>
<sku key="key">HRD-000-517</sku>
<name key="key">ladder</name>
<sold>0</sold>
<in-stock>2</in-stock>
<on-order>1</on-order>
</item>
<item>
<sku key="key">HRD-000-632</sku>
<name key="key">bolt</name>
<sold>4123.0</sold>
<in-stock>144</in-stock>
<on-order>42</on-order>
</item>
<item>
<sku key="key">GRO-000-2331</sku>
<name key="key">water</name>
<sold>17.0</sold>
<in-stock>14</in-stock>
<on-order>2</on-order>
</item>
</data>
<data>
<item>
<sku key="key">GRO-000-533</sku>
<name key="key">fish</name>
<sold>1321.0</sold>
<in-stock>45</in-stock>
<on-order>1</on-order>
</item>
</data>
<data>
<item test4="value4">gum</item>
<item test4="value4">rope</item>
<item test4="value4">ladder</item>
<item test4="value4">bolt</item>
<item test4="value4">water</item>
</data>
<cost>425</cost>
<cost>455</cost>
</top>

View File

@ -0,0 +1,38 @@
Item Total Sold In Stock On Order SKU
gum 1412 54 10 GRO-000-415
rope 85 4 2 HRD-000-212
ladder 0 2 1 HRD-000-517
bolt 4123 144 42 HRD-000-632
water 17 14 2 GRO-000-2331
Item 'gum':
Total sold: 1412.0
In stock: 54
On order: 10
SKU: GRO-000-415
Item 'rope':
Total sold: 85.0
In stock: 4
On order: 2
SKU: HRD-000-212
Item 'ladder':
Total sold: 0
In stock: 2
On order: 1
SKU: HRD-000-517
Item 'bolt':
Total sold: 4123.0
In stock: 144
On order: 42
SKU: HRD-000-632
Item 'water':
Total sold: 17.0
In stock: 14
On order: 2
SKU: GRO-000-2331
Item 'fish':
Total sold: 1321.0
In stock: 45
On order: 1
SKU: GRO-000-533

View File

@ -39,23 +39,38 @@ main (int argc, char **argv)
{ "Ashley", "Ash", "Meter & Smith", 1440, 40 }, { "Ashley", "Ash", "Meter & Smith", 1440, 40 },
{ "0123456789", "0123456789", "012345678901234567890", 1440, 40 }, { "0123456789", "0123456789", "012345678901234567890", 1440, 40 },
{ "ახლა", "გაიარო", "საერთაშორისო", 123, 90 }, { "ახლა", "გაიარო", "საერთაშორისო", 123, 90 },
{ "෴ණ්ණ෴෴ණ්ණ෴", "Mick",
"෴ණ්ණ෴෴ණ්ණ෴෴ණ්ණ෴෴෴", 110, 20 },
{ NULL, NULL } { NULL, NULL }
}, *ep = employees; }, *ep = employees;
int rc;
argc = xo_parse_args(argc, argv); argc = xo_parse_args(argc, argv);
if (argc < 0) if (argc < 0)
return 1; return 1;
xo_set_info(NULL, info, info_count); xo_set_info(NULL, info, info_count);
xo_set_flags(NULL, XOF_COLUMNS);
xo_open_container("employees"); xo_open_container("employees");
xo_emit("Οὐχὶ ταὐτὰ παρίσταταί μοι {:v1/%s}, {:v2/%s}\n", xo_emit("Οὐχὶ ταὐτὰ παρίσταταί μοι {:v1/%s}, {:v2/%s}\n",
"γιγνώσκειν", "ὦ ἄνδρες ᾿Αθηναῖοι"); "γιγνώσκειν", "ὦ ἄνδρες ᾿Αθηναῖοι");
xo_emit("გთხოვთ {:v1/%s} {:v2/%s}\n", rc = xo_emit("გთხოვთ {:v1/%s} {:v2/%s}\n",
"ახლავე გაიაროთ რეგისტრაცია", "ახლავე გაიაროთ რეგისტრაცია",
"Unicode-ის მეათე საერთაშორისო"); "Unicode-ის მეათე საერთაშორისო");
xo_emit("{Twc:Width}{:width/%d}\n", rc);
/* Okay, Sinhala is uber cool ... */
rc = xo_emit("[{:sinhala}]\n", "෴ණ්ණ෴");
xo_emit("{Twc:Width}{:width/%d}\n", rc);
rc = xo_emit("[{:sinhala}]\n", "");
xo_emit("{Twc:Width}{:width/%d}\n", rc);
rc = xo_emit("[{:sinhala/%-4..4s/%s}]\n", "෴ණ්ණ෴෴ණ්ණ෴");
xo_emit("[{:not-sinhala/%-4..4s/%s}]\n", "123456");
rc = xo_emit("[{:tag/%s}]\n", "ර්‍ඝ");
xo_emit("{Twc:Width}{:width/%d}\n", rc);
xo_open_list("employee"); xo_open_list("employee");

View File

@ -0,0 +1,212 @@
/*
* Copyright (c) 2014, Juniper Networks, Inc.
* All rights reserved.
* This SOFTWARE is licensed under the LICENSE provided in the
* ../Copyright file. By downloading, installing, copying, or otherwise
* using the SOFTWARE, you agree to be bound by the terms of that
* LICENSE.
* Phil Shafer, July 2014
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <ctype.h>
#include "xo.h"
int
main (int argc, char **argv)
{
static char base_grocery[] = "GRO";
static char base_hardware[] = "HRD";
struct item {
const char *i_title;
int i_sold;
int i_instock;
int i_onorder;
const char *i_sku_base;
int i_sku_num;
};
struct item list[] = {
{ "gum", 1412, 54, 10, base_grocery, 415 },
{ "rope", 85, 4, 2, base_hardware, 212 },
{ "ladder", 0, 2, 1, base_hardware, 517 },
{ "bolt", 4123, 144, 42, base_hardware, 632 },
{ "water", 17, 14, 2, base_grocery, 2331 },
{ NULL, 0, 0, 0, NULL, 0 }
};
struct item list2[] = {
{ "fish", 1321, 45, 1, base_grocery, 533 },
{ NULL, 0, 0, 0, NULL, 0 }
};
struct item *ip;
xo_info_t info[] = {
{ "in-stock", "number", "Number of items in stock" },
{ "name", "string", "Name of the item" },
{ "on-order", "number", "Number of items on order" },
{ "sku", "string", "Stock Keeping Unit" },
{ "sold", "number", "Number of items sold" },
{ NULL, NULL, NULL },
};
int info_count = (sizeof(info) / sizeof(info[0])) - 1;
argc = xo_parse_args(argc, argv);
if (argc < 0)
return 1;
for (argc = 1; argv[argc]; argc++) {
if (strcmp(argv[argc], "xml") == 0)
xo_set_style(NULL, XO_STYLE_XML);
else if (strcmp(argv[argc], "json") == 0)
xo_set_style(NULL, XO_STYLE_JSON);
else if (strcmp(argv[argc], "text") == 0)
xo_set_style(NULL, XO_STYLE_TEXT);
else if (strcmp(argv[argc], "html") == 0)
xo_set_style(NULL, XO_STYLE_HTML);
else if (strcmp(argv[argc], "pretty") == 0)
xo_set_flags(NULL, XOF_PRETTY);
else if (strcmp(argv[argc], "xpath") == 0)
xo_set_flags(NULL, XOF_XPATH);
else if (strcmp(argv[argc], "info") == 0)
xo_set_flags(NULL, XOF_INFO);
else if (strcmp(argv[argc], "error") == 0) {
close(-1);
xo_err(1, "error detected");
}
}
xo_set_info(NULL, info, info_count);
xo_set_flags(NULL, XOF_KEYS);
/* Normally one would use "XOF_COLOR_ALLOWED", but we want to force it */
xo_set_flags(NULL, XOF_COLOR);
xo_set_version("3.1.4");
xo_open_container_h(NULL, "top");
xo_attr("test", "value");
xo_open_container("data");
xo_open_list("item");
xo_attr("test2", "value2");
static const char *colors[] =
{ "blue", "green", "red", "yellow", "default", NULL };
int i;
for (i = 0; colors[i]; i++) {
if (i > 0)
xo_emit("{C:/bg-%s}", colors[i-1]);
xo_emit("{C:/fg-%s}{T:/%s}", colors[i], colors[i]);
}
xo_emit("{C:reset}\n");
xo_emit("{C:bold}{:data} {C:underline}{:data} {C:inverse}{:data} "
"{C:no-bold}{:data} {C:no-inverse}{:data} "
"{C:no-underline}{:data}\n",
"bold", "bold-ul", "triple", "inv-ul", "underline", "plain");
xo_emit("{T:Item/%-10s}{C:bold,underline}{T:Total Sold/%12s}{C:no-bold}"
"{T:In Stock/%12s}{C:/%s}"
"{T:On Order/%12s}{C:normal}{T:SKU/%5s}\n", "inverse");
#if 0
xo_finish();
return 0;
#endif
for (ip = list; ip->i_title; ip++) {
xo_open_instance("item");
xo_attr("test3", "value3");
xo_emit("{keq:sku/%s-%u/%s-000-%u}"
"{k:name/%-10s/%s}{n:sold/%12u/%u}"
"{C:/%s}{:in-stock/%12u/%u}{C:normal}"
"{C:/fg-%s}{:on-order/%12u/%u}{C:/fg-default}"
"{qkd:sku/%5s-000-%u/%s-000-%u}\n",
ip->i_sku_base, ip->i_sku_num,
ip->i_title, ip->i_sold,
(ip->i_instock < 5) ? "inverse" : "normal", ip->i_instock,
(ip->i_onorder > 5) ? "yellow" : "default", ip->i_onorder,
ip->i_sku_base, ip->i_sku_num);
xo_close_instance("item");
}
xo_close_list("item");
xo_close_container("data");
xo_emit("\n\n");
xo_open_container("data");
xo_open_list("item");
for (ip = list; ip->i_title; ip++) {
xo_open_instance("item");
xo_emit("{keq:sku/%s-%u/%s-000-%u}", ip->i_sku_base, ip->i_sku_num);
xo_emit("{L:Item} '{k:name/%s}':\n", ip->i_title);
xo_emit("{P: }{L:Total sold}: {n:sold/%u%s}\n",
ip->i_sold, ip->i_sold ? ".0" : "");
xo_emit("{P: }{Lcw:In stock}{C:inverse}{:in-stock/%u}{C:}\n",
ip->i_instock);
xo_emit("{P: }{Lcw:On order}{:on-order/%u}\n", ip->i_onorder);
xo_emit("{P: }{L:SKU}: {qkd:sku/%s-000-%u}\n",
ip->i_sku_base, ip->i_sku_num);
xo_close_instance("item");
}
xo_close_list("item");
xo_close_container("data");
xo_open_container("data");
xo_open_list("item");
for (ip = list2; ip->i_title; ip++) {
xo_open_instance("item");
xo_emit("{keq:sku/%s-%u/%s-000-%u}", ip->i_sku_base, ip->i_sku_num);
xo_emit("{L:Item} '{k:name/%s}':\n", ip->i_title);
xo_emit("{P: }{C:bg-blue , fg-white, bold }{L:Total sold}: "
"{n:sold/%u%s}{C:}\n",
ip->i_sold, ip->i_sold ? ".0" : "");
xo_emit("{P: }{Lcw:In stock}{:in-stock/%u}\n", ip->i_instock);
xo_emit("{P: }{Lcw:On order}{:on-order/%u}\n", ip->i_onorder);
xo_emit("{P: }{L:SKU}: {qkd:sku/%s-000-%u}\n",
ip->i_sku_base, ip->i_sku_num);
xo_close_instance("item");
}
xo_close_list("item");
xo_close_container("data");
xo_open_container("data");
xo_open_list("item");
for (ip = list; ip->i_title; ip++) {
xo_attr("test4", "value4");
xo_emit("{Lwc:Item}{l:item}\n", ip->i_title);
}
xo_close_list("item");
xo_close_container("data");
xo_emit("X{P:}X", "epic fail");
xo_emit("X{T:}X", "epic fail");
xo_emit("X{N:}X", "epic fail");
xo_emit("X{L:}X\n", "epic fail");
xo_emit("X{P: }X{Lwc:Cost}{:cost/%u}\n", 425);
xo_emit("X{P:/%30s}X{Lwc:Cost}{:cost/%u}\n", "", 455);
xo_close_container_h(NULL, "top");
xo_finish();
return 0;
}

View File

@ -74,7 +74,7 @@ utility accepts a format string suitable for
.Xr xo_emit 3 .Xr xo_emit 3
and a set of zero or more arguments used to supply data for that string. and a set of zero or more arguments used to supply data for that string.
.Bd -literal -offset indent .Bd -literal -offset indent
xo "The {k:name} weighs {:weight/%d} pounds.\n" fish 6 xo "The {k:name} weighs {:weight/%d} pounds.\\n" fish 6
TEXT: TEXT:
The fish weighs 6 pounds. The fish weighs 6 pounds.

View File

@ -0,0 +1,38 @@
#
# Copyright 2015, Juniper Networks, Inc.
# All rights reserved.
# This SOFTWARE is licensed under the LICENSE provided in the
# ../Copyright file. By downloading, installing, copying, or otherwise
# using the SOFTWARE, you agree to be bound by the terms of that
# LICENSE.
man_MANS = xohtml.1
EXTERNAL_FILES = \
external/jquery.js \
external/jquery.qtip.css \
external/jquery.qtip.js
INTERNAL_FILES = \
xohtml.js \
xohtml.css
EXTRA_DIST = \
xohtml.1 \
xohtml.sh.in \
${INTERNAL_FILES} \
${EXTERNAL_FILES}
install-exec-hook:
install xohtml.sh ${DESTDIR}${bindir}/xohtml
mkdir -p ${DESTDIR}${XO_SHAREDIR}/external
for file in ${INTERNAL_FILES}; do \
install ${srcdir}/$$file ${DESTDIR}${XO_SHAREDIR} ; done
for file in ${EXTERNAL_FILES}; do \
install ${srcdir}/$$file ${DESTDIR}${XO_SHAREDIR}/external ; done
uninstall-hook:
for file in ${INTERNAL_FILES} ${EXTERNAL_FILES}; do \
rm ${DESTDIR}${XO_SHAREDIR}/$$file ; done
rmdir ${DESTDIR}${XO_SHAREDIR}/external
rm -f ${DESTDIR}${bindir}/xohtml

View File

@ -0,0 +1,125 @@
.\" #
.\" # Copyright (c) 2015, Juniper Networks, Inc.
.\" # All rights reserved.
.\" # This SOFTWARE is licensed under the LICENSE provided in the
.\" # ../Copyright file. By downloading, installing, copying, or
.\" # using the SOFTWARE, you agree to be bound by the terms of that
.\" # LICENSE.
.\" # Phil Shafer, July 2014
.\"
.Dd December 4, 2014
.Dt XOHTML 1
.Os
.Sh NAME
.Nm xohtml
.Nd display libxo html output
.Xr xo_emit 3
.Sh SYNOPSIS
.Nm xohtml
.Op Fl c
.Op Fl "b <base>"
.Op Fl "c" <command>"
.Op Fl "f" <output>
.Op Ar command argument...
.Sh DESCRIPTION
.Nm
is a tool for preparing
.Xr libxo 3
HTML output for display in modern HTML web browsers.
.Nm
can operate in two modes.
If command is provided
either with the
.Fl c
option or as argument(s) to the
.Nm
command, that command is executed and the resulting output is processed.
If no command is given, the
standard input is used.
.Pp
.Nm
is typically used to wrap
.Nm libxo
output with sufficient HTML content to allow display in a web browser.
This includes parent HTML tags as well as
.Nm CSS
stylesheets and
.Nm Javascript
files.
.Pp
If the command is given directly on the command line,
.Nm
will add the "--libxo=html" option needed to generate HTML output
from
.Nm libxo "-enabled"
applications. See
.Xr libxo 3
for details.
.Pp
The following options are available:
.Bl -tag -width indent
.It Fl "b <base>"
.It Fl "-base <base>"
Supplies a source path for the CSS and Javascript files referenced in
the output of
.Nm xohtml .
.It Fl "c <command>"
.It Fl "-command <command>"
Use the given command instead of one on the command line.
This command should be quoted if it consists of multiple tokens, and
should contain the "--libxo=html" option or equivalent, since the
command is used directly.
.It Fl "f <file>"
.It Fl "-file <file>"
Output is saved to the given file, rather than to the standard output
descriptor.
.El
.Pp
.Sh EXAMPLES
The following command line will run "du --libxo=html ~/src" and save
the output to /tmp/src.html:
.Bd -literal -offset indent
xohtml du ~/src > /tmp/src.html
.Ed
.Pp
The following command line will run "du --libxo=html,warn ~/src" and save
the output to /tmp/src.html:
.Bd -literal -offset indent
du --libxo=html,warn ~/src | xohtml -f /tmp/src.html
.Ed
.Pp
The following command line will run "du --libxo=html,warn ~/src" and save
the output to /tmp/src.html:
.Bd -literal -offset indent
xohtml -c "du --libxo=html,warn ~/src" -f /tmp/src.html
.Ed
.Pp
.Sh ADDITIONAL DOCUMENTATION
Complete documentation can be found on github:
.Bd -literal -offset indent
http://juniper.github.io/libxo/libxo-manual.html
.Ed
.Pp
.Nm libxo
lives on github as:
.Bd -literal -offset indent
https://github.com/Juniper/libxo
.Ed
.Pp
The latest release of
.Nm libxo
is available at:
.Bd -literal -offset indent
https://github.com/Juniper/libxo/releases
.Ed
.Sh SEE ALSO
.Xr libxo 3 ,
.Xr xo_emit 3
.Sh HISTORY
The
.Nm libxo
library was added in
.Fx 11.0 .
.Sh AUTHOR
Phil Shafer

View File

@ -1014,3 +1014,27 @@ div.xpath {
position: relative; position: relative;
top: 1px; top: 1px;
} }
div.color-fg-black { color: black; }
div.color-fg-red { color: red; }
div.color-fg-green { color: green; }
div.color-fg-yellow { color: yellow; }
div.color-fg-blue { color: blue; }
div.color-fg-magenta { color: magenta; }
div.color-fg-cyan { color: cyan; }
div.color-fg-white { color: white; }
div.color-bg-black { background-color: black; }
div.color-bg-red { background-color: red; }
div.color-bg-green { background-color: green; }
div.color-bg-yellow { background-color: yellow; }
div.color-bg-blue { background-color: blue; }
div.color-bg-magenta { background-color: magenta; }
div.color-bg-cyan { background-color: cyan; }
div.color-bg-white { background-color: white; }
div.color-fg-inverse { color: white; }
div.color-bg-inverse { background-color: black; }
div.effect-bold { font-weight:bold; }
div.effect-underline { text-decoration: underline; }

View File

@ -13,6 +13,16 @@ BASE=@XO_SHAREDIR@
CMD=cat CMD=cat
DONE= DONE=
do_help () {
echo "xohtml: wrap libxo-enabled output in HTML"
echo "Usage: xohtml [options] [command [arguments]]"
echo "Valid options are:"
echo " -b <basepath> | --base <basepath>"
echo " -c <command> | --command <command>"
echo " -f <output-file> | --file <output-file>"
exit 1
}
while [ -z "$DONE" -a ! -z "$1" ]; do while [ -z "$DONE" -a ! -z "$1" ]; do
case "$1" in case "$1" in
-b|--base) -b|--base)
@ -31,12 +41,22 @@ while [ -z "$DONE" -a ! -z "$1" ]; do
shift; shift;
exec > "$FILE"; exec > "$FILE";
;; ;;
-*)
do_help
;;
*) *)
DONE=1; DONE=1;
XX=$1;
shift;
CMD="$XX --libxo=html $@"
;; ;;
esac esac
done done
if [ "$CMD" = "cat" -a -t 0 ]; then
do_help
fi
echo "<html>\n<head>\n" echo "<html>\n<head>\n"
echo '<meta http-equiv="content-type" content="text/html; charset=utf-8"/>' echo '<meta http-equiv="content-type" content="text/html; charset=utf-8"/>'
echo '<link rel="stylesheet" href="'$BASE'/xohtml.css">' echo '<link rel="stylesheet" href="'$BASE'/xohtml.css">'

View File

@ -12,3 +12,6 @@ EXTRA_DIST = xolint.1 xolint.pl
install-exec-hook: install-exec-hook:
install ${srcdir}/xolint.pl ${DESTDIR}${bindir}/xolint install ${srcdir}/xolint.pl ${DESTDIR}${bindir}/xolint
uninstall-hook:
rm -f ${DESTDIR}${bindir}/xolint

View File

@ -99,6 +99,6 @@ https://github.com/Juniper/libxo/releases
The The
.Nm libxo .Nm libxo
library was added in library was added in
.Fx 10.1 . .Fx 11.0 .
.Sh AUTHOR .Sh AUTHOR
Phil Shafer Phil Shafer

View File

@ -347,32 +347,32 @@ sub check_field {
error("only one field role can be used (" . join(", ", @roles) . ")") error("only one field role can be used (" . join(", ", @roles) . ")")
if $#roles > 0; if $#roles > 0;
# Field is a note, label, or title # Field is a color, note, label, or title
if ($field[0] =~ /[DLNT]/) { if ($field[0] =~ /[CDLNT]/) {
#@ Potential missing slash after N, L, or T with format #@ Potential missing slash after C, D, N, L, or T with format
#@ xo_emit("{T:%6.6s}\n", "Max"); #@ xo_emit("{T:%6.6s}\n", "Max");
#@ should be: #@ should be:
#@ xo_emit("{T:/%6.6s}\n", "Max"); #@ xo_emit("{T:/%6.6s}\n", "Max");
#@ The "%6.6s" will be a literal, not a field format. While #@ The "%6.6s" will be a literal, not a field format. While
#@ it's possibly valid, it's likely a missing "/". #@ it's possibly valid, it's likely a missing "/".
info("potential missing slash after N, L, or T with format") info("potential missing slash after C, D, N, L, or T with format")
if $field[1] =~ /%/; if $field[1] =~ /%/;
#@ An encoding format cannot be given (roles: DNLT) #@ An encoding format cannot be given (roles: DNLT)
#@ xo_emit("{T:Max//%s}", "Max"); #@ xo_emit("{T:Max//%s}", "Max");
#@ Fields with the D, N, L, and T roles are not emitted in #@ Fields with the C, D, N, L, and T roles are not emitted in
#@ the 'encoding' style (JSON, XML), so an encoding format #@ the 'encoding' style (JSON, XML), so an encoding format
#@ would make no sense. #@ would make no sense.
error("encoding format cannot be given when content is present") error("encoding format cannot be given when content is present")
if $field[3]; if $field[3];
} }
# Field is a decoration, label, or title # Field is a color, decoration, label, or title
if ($field[0] =~ /DLN/) { if ($field[0] =~ /[CDLN]/) {
#@ Format cannot be given when content is present (roles: DLN) #@ Format cannot be given when content is present (roles: CDLN)
#@ xo_emit("{N:Max/%6.6s}", "Max"); #@ xo_emit("{N:Max/%6.6s}", "Max");
#@ Fields with the D, L, or N roles can't have both #@ Fields with the C, D, L, or N roles can't have both
#@ static literal content ("{L:Label}") and a #@ static literal content ("{L:Label}") and a
#@ format ("{L:/%s}"). #@ format ("{L:/%s}").
#@ This error will also occur when the content has a backslash #@ This error will also occur when the content has a backslash
@ -383,6 +383,49 @@ sub check_field {
if $field[1] && $field[2]; if $field[1] && $field[2];
} }
# Field is a color/effect
if ($field[0] =~ /C/) {
if ($field[1]) {
my $val;
my @sub = split(/,/, $field[1]);
grep { s/^\s*//; s/\s*$//; } @sub;
for $val (@sub) {
if ($val =~ /^(default,black,red,green,yellow,blue,magenta,cyan,white)$/) {
#@ Field has color without fg- or bg- (role: C)
#@ xo_emit("{C:green}{:foo}{C:}", x);
#@ Should be:
#@ xo_emit("{C:fg-green}{:foo}{C:}", x);
#@ Colors must be prefixed by either "fg-" or "bg-".
error("Field has color without fg- or bg- (role: C)");
} elsif ($val =~ /^(fg|bg)-(default|black|red|green|yellow|blue|magenta|cyan|white)$/) {
# color
} elsif ($val =~ /^(bold|underline)$/) {
} elsif ($val =~ /^(no-)?(bold|underline|inverse)$/) {
# effect
} elsif ($val =~ /^(reset|normal)$/) {
# effect also
} else {
#@ Field has invalid color or effect (role: C)
#@ xo_emit("{C:fg-purple,bold}{:foo}{C:gween}", x);
#@ Should be:
#@ xo_emit("{C:fg-red,bold}{:foo}{C:fg-green}", x);
#@ The list of colors and effects are limited. The
#@ set of colors includes default, black, red, green,
#@ yellow, blue, magenta, cyan, and white, which must
#@ be prefixed by either "fg-" or "bg-". Effects are
#@ limited to bold, no-bold, underline, no-underline,
#@ inverse, no-inverse, normal, and reset. Values must
#@ be separated by commas.
error("Field has invalid color or effect (role: C) ($val)");
}
}
}
}
# A value field # A value field
if (length($field[0]) == 0 || $field[0] =~ /V/) { if (length($field[0]) == 0 || $field[0] =~ /V/) {
@ -456,7 +499,7 @@ sub check_field {
#@ Should be: #@ Should be:
#@ xo_emit("{D:((}{:good}{D:))}", "yes"); #@ xo_emit("{D:((}{:good}{D:))}", "yes");
#@ This is minor, but fields should use proper roles. Decoration #@ This is minor, but fields should use proper roles. Decoration
#@ fields are meant to hold puncuation and other characters used #@ fields are meant to hold punctuation and other characters used
#@ to decorate the content, typically to make it more readable #@ to decorate the content, typically to make it more readable
#@ to human readers. #@ to human readers.
warn("decoration field contains invalid character") warn("decoration field contains invalid character")

View File

@ -26,6 +26,7 @@ MAN+= xo_attr.3 \
xo_flush.3 \ xo_flush.3 \
xo_no_setlocale.3 \ xo_no_setlocale.3 \
xo_open_container.3 \ xo_open_container.3 \
xo_open_marker.3 \
xo_open_list.3 \ xo_open_list.3 \
xo_parse_args.3 \ xo_parse_args.3 \
xo_set_allocator.3 \ xo_set_allocator.3 \
@ -33,6 +34,7 @@ MAN+= xo_attr.3 \
xo_set_info.3 \ xo_set_info.3 \
xo_set_options.3 \ xo_set_options.3 \
xo_set_style.3 \ xo_set_style.3 \
xo_set_version.3 \
xo_set_writer.3 xo_set_writer.3
MAN+= xo_format.5 MAN+= xo_format.5