XB(1)                                                       XB(1)

     NAME
          xb - XML beautifier

     SYNOPSIS
          xb [ dM ][ file ]

     DESCRIPTION
          Xb performs a DOM model, non-validating parse of the given
          XML file (or standard input if none specified). This is then
          written to standard output reformatted into an indented,
          one-line-per-element style.

          Xb takes some liberties with the document which may effect
          later interpretation, though it is idempotent:

          -    Re-formatting the will change the meaning of PCdata in
               the XML file if leading and trailing whitespace is sig-
               nificant.

          -    All comments are stripped, though the DOCTYPE struc-
               tured comment is preserved. A new XML version comment
               is always generated on the output.

          -    Attributes are always quoted with single quotes whether
               the source uses single or double quotes.

          -    Empty long form elements are replaced with their short
               form; for example:
                    <fred a='1'>
                    </fred>
                is replaced with
                    <fred a='1' />

          -    Xml has its own view of the valid characterset for XML
               files, which might result in slightly different charac-
               ters being escaped as entity references to those on the
               input. This is only a matter of interpretation, the
               meaning of the file will be unaffected.

     SOURCE
          /sys/src/cmd/xb.c

     SEE ALSO
          xml(2)

     Page 1                       Plan 9            (printed 12/21/24)