xml-depyx
Dependency analysis of XML files
TLDR
Convert a PYX (ESIS - ISO 8879) document to XML format
Convert a PYX document from stdin to XML format
Display help
SYNOPSIS
xml-depyx [FILE...]
xml-depyx < INPUT_FILE > OUTPUT_FILE
PARAMETERS
FILE...
Optional. One or more input files in Pyx format. If no files are specified, xml-depyx reads from standard input.
DESCRIPTION
The xml-depyx command is a utility from the PyXML suite designed for converting XML data represented in the compact, line-oriented Pyx format back into standard XML. Pyx, an abbreviation for "Python XML," provides a simplified, human-readable way to represent XML documents, often used for quick parsing, transformation, or generation in scripting environments. Each line in a Pyx document corresponds to a specific XML event, such as an element start, an element end, text content, or an attribute.
xml-depyx functions as a filter: it reads Pyx-formatted input from standard input (or specified files) and outputs the corresponding well-formed XML document to standard output. This makes it particularly useful in shell pipelines for chained operations. Its primary purpose is to reverse the transformation performed by xml-pyx, allowing users to process or visualize XML data that was previously converted into the Pyx style. While part of the older PyXML distribution, it remains a simple and effective tool for this specific conversion task.
CAVEATS
xml-depyx is part of the PyXML project, which is considered legacy. Modern Python development typically uses xml.etree.ElementTree (standard library) or lxml for more robust and feature-rich XML processing. Consequently, xml-depyx might not be actively maintained and could have limitations in handling very complex or malformed Pyx inputs, or in terms of performance for extremely large XML documents compared to contemporary parsers.
PYX FORMAT OVERVIEW
The Pyx format is a line-oriented representation of XML, designed for simplicity and ease of parsing. Each line denotes a specific XML event:
(element_name: Start of an element
)element_name: End of an element
Aattribute_name value: Attribute of the preceding element
-text_content: Text content within an element
#comment_text: XML comment
?pi_target pi_data: Processing instruction
This format simplifies command-line processing and debugging of XML structures.
EXAMPLE USAGE
To convert a Pyx file to XML:xml-depyx < input.pyx > output.xml
To process Pyx input from a pipe:generate_pyx_data | xml-depyx > output.xml
You can also specify input files directly:xml-depyx file1.pyx file2.pyx > combined_output.xml
HISTORY
The xml-depyx command emerged as part of the broader PyXML project, an influential collection of Python modules and utilities for XML processing in the late 1990s and early 2000s. PyXML aimed to provide comprehensive XML support for Python before much of the functionality was integrated into Python's standard library. xml-depyx specifically addressed the need to convert from the compact Pyx representation back to standard XML, complementing xml-pyx. While PyXML's direct use has waned with the rise of improved standard library modules and powerful third-party libraries like lxml, tools like xml-depyx represent an early stage in Python's robust XML ecosystem development.