Gallery¶
Real-world XML and JSON documents rendered with unxml, syntax-highlighted with the same grammar unxml ships for bat.
The basics below are shown inline — original source on the left, unxml output on the right. The gallery further down links full-page renders of larger real-world documents, with original-vs-rendered size comparisons.
JSON¶
Uniform objects become a compact table
service-catalog.json · 23 → 25 lines
JSON source
unxml
generatedAt = 2026-07-30T09:00:00Z
environments = [development, staging, production]
services[]{name,team,language,tier,healthy}
accounts, identity, Rust, 1, true
catalog, commerce, Go, 1, true
checkout, commerce, Kotlin, 1, false
email, engagement, Python, 2, true
recommendations, "data, search", Python, 2, true
web, experience, TypeScript, 1, true
deployment
region = eu-north-1
replicas = 3
strategy = rolling
alerts[]
service = checkout
severity = critical
details
code = PAYMENT_TIMEOUT
count = 17
alerts[]
service = catalog
severity = warning
details = null
metadata = {}
retired = []JSON Schema — required fields, types, refs, and regex
person.schema.json · 47 → 17 lines
JSON source
unxml
"$schema" = https://json-schema.org/draft/2020-12/schema
"$id" = https://example.test/person.schema.json
schema : object
id! : integer int64
email! : string email
username! : string
pattern = "^[a-zA-Z][a-zA-Z0-9_-]{2,31}$"
minLength = 3
maxLength = 32
tags : string[]
uniqueItems = true
manager : ref PersonSummary
defs
PersonSummary : object
id! : integer
username! : string
title = PersonOpenAPI — embedded schemas simplify in place
openapi-schema.json · 61 → 25 lines
JSON source
unxml
openapi = 3.1.0
info
title = People API
version = 1.0.0
paths
"/people/{id}"
get
summary = Fetch one person
parameters[]
name = id
in = path
required = true
schema : integer int64
responses
"200"
description = The person
content
"application/json"
schema : ref Person
components
schemas
Person : object
id! : integer int64
email! : string email
roles : string[]Invoice basics¶
CII / Factur-X — minimal invoice
factur-x-basic.xml · 130 → 83 lines
XML source
<!-- generated by: mustangproject.org vnull-->
urn:cen.eu:en16931:2017#compliant#urn:factur-x.eu:1p0:basic
471102
380
20241115
Rechnung gemäß Bestellung vom 01.11.2024.
Lieferant GmbH
Lieferantenstraße 20
80333 München
Deutschland
Geschäftsführer: Hans Muster
Handelsregisternummer: H A 123
Unsere GLN: 4000001123452
Ihre GLN: 4000001987658
Ihre Kundennummer: GE2020211
Zahlbar innerhalb 30 Tagen netto bis 25.12.2024, 3% Skonto innerhalb 10 Tagen bis 25.11.2024.
1
4012345001235
GTIN: 4012345001235
Unsere Art.-Nr.: TB100A4
Trennblätter A4
9.9000
1.0000
20.0000
VAT
S
19.00
198.00
Lieferant GmbH
80333
Lieferantenstraße 20
München
DE
DE123456789
201/113/40209
Kunden AG Mitte
69876
Hans Muster
Kundenstraße 15
Frankfurt
DE
20241114
EUR
37.62
VAT
198.00
S
19.00
Zahlbar innerhalb 30 Tagen netto bis 25.12.2024, 3% Skonto innerhalb 10 Tagen bis 25.11.2024.
20241215
198.00
0.00
0.00
198.00
37.62
235.62
0.00
235.62
unxml --auto
CrossIndustryInvoice(
xmlns="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100",
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance")
// generated by: mustangproject.org vnull
ExchangedDocumentContext/GuidelineSpecifiedDocumentContextParameter/ID = urn:cen.eu:en16931:2017#compliant#urn:factur-x.eu:1p0:basic
ExchangedDocument
ID = 471102
TypeCode = 380
IssueDateTime/DateTimeString(format="102") = 20241115
IncludedNote/Content = Rechnung gemäß Bestellung vom 01.11.2024.
IncludedNote/Content =
| Lieferant GmbH
| Lieferantenstraße 20
| 80333 München
| Deutschland
| Geschäftsführer: Hans Muster
| Handelsregisternummer: H A 123
IncludedNote/Content =
| Unsere GLN: 4000001123452
| Ihre GLN: 4000001987658
| Ihre Kundennummer: GE2020211
|
|
| Zahlbar innerhalb 30 Tagen netto bis 25.12.2024, 3% Skonto innerhalb 10 Tagen bis 25.11.2024.
SupplyChainTradeTransaction
IncludedSupplyChainTradeLineItem
AssociatedDocumentLineDocument/LineID = 1
SpecifiedTradeProduct
GlobalID(schemeID="0160") = 4012345001235
Name =
| GTIN: 4012345001235
| Unsere Art.-Nr.: TB100A4
| Trennblätter A4
SpecifiedLineTradeAgreement/NetPriceProductTradePrice
ChargeAmount = 9.9000
BasisQuantity(unitCode="H87") = 1.0000
SpecifiedLineTradeDelivery/BilledQuantity(unitCode="H87") = 20.0000
SpecifiedLineTradeSettlement
ApplicableTradeTax
TypeCode = VAT
CategoryCode = S
RateApplicablePercent = 19.00
SpecifiedTradeSettlementLineMonetarySummation/LineTotalAmount = 198.00
ApplicableHeaderTradeAgreement
SellerTradeParty
Name = Lieferant GmbH
PostalTradeAddress
PostcodeCode = 80333
LineOne = Lieferantenstraße 20
CityName = München
CountryID = DE
SpecifiedTaxRegistration/ID(schemeID="VA") = DE123456789
SpecifiedTaxRegistration/ID(schemeID="FC") = 201/113/40209
BuyerTradeParty
Name = Kunden AG Mitte
PostalTradeAddress
PostcodeCode = 69876
LineOne = Hans Muster
LineTwo = Kundenstraße 15
CityName = Frankfurt
CountryID = DE
ApplicableHeaderTradeDelivery/ActualDeliverySupplyChainEvent/OccurrenceDateTime/DateTimeString(
format="102") = 20241114
ApplicableHeaderTradeSettlement
InvoiceCurrencyCode = EUR
ApplicableTradeTax
CalculatedAmount = 37.62
TypeCode = VAT
BasisAmount = 198.00
CategoryCode = S
RateApplicablePercent = 19.00
SpecifiedTradePaymentTerms
Description = Zahlbar innerhalb 30 Tagen netto bis 25.12.2024, 3% Skonto innerhalb 10 Tagen bis 25.11.2024.
DueDateDateTime/DateTimeString(format="102") = 20241215
SpecifiedTradeSettlementHeaderMonetarySummation
LineTotalAmount = 198.00
ChargeTotalAmount = 0.00
AllowanceTotalAmount = 0.00
TaxBasisTotalAmount = 198.00
TaxTotalAmount(currencyID="EUR") = 37.62
GrandTotalAmount = 235.62
TotalPrepaidAmount = 0.00
DuePayableAmount = 235.62Folding boilerplate¶
UBL — ext:UBLExtensions collapsed under --auto
invoice-with-extensions.xml · 35 → 15 lines
XML source
urn:oasis:names:tc:ebcore:partyid-type:unregistered
urn:oasis:names:specification:ubl:signature:Invoice
2.1
INV-2026-0042
2026-01-15
EUR
Acme Components Ltd
1240.00
unxml --auto
Invoice(
xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2",
xmlns:ext="urn:oasis:names:specification:ubl:schema:xsd:CommonExtensionComponents-2",
xmlns:sac="urn:oasis:names:specification:ubl:schema:xsd:SignatureAggregateComponents-2",
xmlns:sbc="urn:oasis:names:specification:ubl:schema:xsd:SignatureBasicComponents-2",
xmlns:sig="urn:oasis:names:specification:ubl:schema:xsd:CommonSignatureComponents-2")
ext:UBLExtensions/ext:UBLExtension/ext:ExtensionContent/sig:UBLDocumentSignatures/sac:SignatureInformation
ID = urn:oasis:names:tc:ebcore:partyid-type:unregistered
sbc:ReferencedSignatureID = urn:oasis:names:specification:ubl:signature:Invoice
UBLVersionID = 2.1
ID = INV-2026-0042
IssueDate = 2026-01-15
DocumentCurrencyCode = EUR
AccountingSupplierParty/Party/PartyName/Name = Acme Components Ltd
LegalMonetaryTotal/PayableAmount(currencyID="EUR") = 1240.00CII / Factur-X — what --auto does (hide prefixes + fold wrapper chains)
factur-x-basic.xml · 101 → 83 lines
unxml --no-auto
rsm:CrossIndustryInvoice(
xmlns:qdt="urn:un:unece:uncefact:data:standard:QualifiedDataType:100",
xmlns:ram="urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100",
xmlns:rsm="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100",
xmlns:udt="urn:un:unece:uncefact:data:standard:UnqualifiedDataType:100",
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance")
// generated by: mustangproject.org vnull
rsm:ExchangedDocumentContext
ram:GuidelineSpecifiedDocumentContextParameter
ram:ID = urn:cen.eu:en16931:2017#compliant#urn:factur-x.eu:1p0:basic
rsm:ExchangedDocument
ram:ID = 471102
ram:TypeCode = 380
ram:IssueDateTime
udt:DateTimeString(format="102") = 20241115
ram:IncludedNote
ram:Content = Rechnung gemäß Bestellung vom 01.11.2024.
ram:IncludedNote
ram:Content =
| Lieferant GmbH
| Lieferantenstraße 20
| 80333 München
| Deutschland
| Geschäftsführer: Hans Muster
| Handelsregisternummer: H A 123
ram:IncludedNote
ram:Content =
| Unsere GLN: 4000001123452
| Ihre GLN: 4000001987658
| Ihre Kundennummer: GE2020211
|
|
| Zahlbar innerhalb 30 Tagen netto bis 25.12.2024, 3% Skonto innerhalb 10 Tagen bis 25.11.2024.
rsm:SupplyChainTradeTransaction
ram:IncludedSupplyChainTradeLineItem
ram:AssociatedDocumentLineDocument
ram:LineID = 1
ram:SpecifiedTradeProduct
ram:GlobalID(schemeID="0160") = 4012345001235
ram:Name =
| GTIN: 4012345001235
| Unsere Art.-Nr.: TB100A4
| Trennblätter A4
ram:SpecifiedLineTradeAgreement
ram:NetPriceProductTradePrice
ram:ChargeAmount = 9.9000
ram:BasisQuantity(unitCode="H87") = 1.0000
ram:SpecifiedLineTradeDelivery
ram:BilledQuantity(unitCode="H87") = 20.0000
ram:SpecifiedLineTradeSettlement
ram:ApplicableTradeTax
ram:TypeCode = VAT
ram:CategoryCode = S
ram:RateApplicablePercent = 19.00
ram:SpecifiedTradeSettlementLineMonetarySummation
ram:LineTotalAmount = 198.00
ram:ApplicableHeaderTradeAgreement
ram:SellerTradeParty
ram:Name = Lieferant GmbH
ram:PostalTradeAddress
ram:PostcodeCode = 80333
ram:LineOne = Lieferantenstraße 20
ram:CityName = München
ram:CountryID = DE
ram:SpecifiedTaxRegistration
ram:ID(schemeID="VA") = DE123456789
ram:SpecifiedTaxRegistration
ram:ID(schemeID="FC") = 201/113/40209
ram:BuyerTradeParty
ram:Name = Kunden AG Mitte
ram:PostalTradeAddress
ram:PostcodeCode = 69876
ram:LineOne = Hans Muster
ram:LineTwo = Kundenstraße 15
ram:CityName = Frankfurt
ram:CountryID = DE
ram:ApplicableHeaderTradeDelivery
ram:ActualDeliverySupplyChainEvent
ram:OccurrenceDateTime
udt:DateTimeString(format="102") = 20241114
ram:ApplicableHeaderTradeSettlement
ram:InvoiceCurrencyCode = EUR
ram:ApplicableTradeTax
ram:CalculatedAmount = 37.62
ram:TypeCode = VAT
ram:BasisAmount = 198.00
ram:CategoryCode = S
ram:RateApplicablePercent = 19.00
ram:SpecifiedTradePaymentTerms
ram:Description = Zahlbar innerhalb 30 Tagen netto bis 25.12.2024, 3% Skonto innerhalb 10 Tagen bis 25.11.2024.
ram:DueDateDateTime
udt:DateTimeString(format="102") = 20241215
ram:SpecifiedTradeSettlementHeaderMonetarySummation
ram:LineTotalAmount = 198.00
ram:ChargeTotalAmount = 0.00
ram:AllowanceTotalAmount = 0.00
ram:TaxBasisTotalAmount = 198.00
ram:TaxTotalAmount(currencyID="EUR") = 37.62
ram:GrandTotalAmount = 235.62
ram:TotalPrepaidAmount = 0.00
ram:DuePayableAmount = 235.62unxml --auto
CrossIndustryInvoice(
xmlns="urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100",
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance")
// generated by: mustangproject.org vnull
ExchangedDocumentContext/GuidelineSpecifiedDocumentContextParameter/ID = urn:cen.eu:en16931:2017#compliant#urn:factur-x.eu:1p0:basic
ExchangedDocument
ID = 471102
TypeCode = 380
IssueDateTime/DateTimeString(format="102") = 20241115
IncludedNote/Content = Rechnung gemäß Bestellung vom 01.11.2024.
IncludedNote/Content =
| Lieferant GmbH
| Lieferantenstraße 20
| 80333 München
| Deutschland
| Geschäftsführer: Hans Muster
| Handelsregisternummer: H A 123
IncludedNote/Content =
| Unsere GLN: 4000001123452
| Ihre GLN: 4000001987658
| Ihre Kundennummer: GE2020211
|
|
| Zahlbar innerhalb 30 Tagen netto bis 25.12.2024, 3% Skonto innerhalb 10 Tagen bis 25.11.2024.
SupplyChainTradeTransaction
IncludedSupplyChainTradeLineItem
AssociatedDocumentLineDocument/LineID = 1
SpecifiedTradeProduct
GlobalID(schemeID="0160") = 4012345001235
Name =
| GTIN: 4012345001235
| Unsere Art.-Nr.: TB100A4
| Trennblätter A4
SpecifiedLineTradeAgreement/NetPriceProductTradePrice
ChargeAmount = 9.9000
BasisQuantity(unitCode="H87") = 1.0000
SpecifiedLineTradeDelivery/BilledQuantity(unitCode="H87") = 20.0000
SpecifiedLineTradeSettlement
ApplicableTradeTax
TypeCode = VAT
CategoryCode = S
RateApplicablePercent = 19.00
SpecifiedTradeSettlementLineMonetarySummation/LineTotalAmount = 198.00
ApplicableHeaderTradeAgreement
SellerTradeParty
Name = Lieferant GmbH
PostalTradeAddress
PostcodeCode = 80333
LineOne = Lieferantenstraße 20
CityName = München
CountryID = DE
SpecifiedTaxRegistration/ID(schemeID="VA") = DE123456789
SpecifiedTaxRegistration/ID(schemeID="FC") = 201/113/40209
BuyerTradeParty
Name = Kunden AG Mitte
PostalTradeAddress
PostcodeCode = 69876
LineOne = Hans Muster
LineTwo = Kundenstraße 15
CityName = Frankfurt
CountryID = DE
ApplicableHeaderTradeDelivery/ActualDeliverySupplyChainEvent/OccurrenceDateTime/DateTimeString(
format="102") = 20241114
ApplicableHeaderTradeSettlement
InvoiceCurrencyCode = EUR
ApplicableTradeTax
CalculatedAmount = 37.62
TypeCode = VAT
BasisAmount = 198.00
CategoryCode = S
RateApplicablePercent = 19.00
SpecifiedTradePaymentTerms
Description = Zahlbar innerhalb 30 Tagen netto bis 25.12.2024, 3% Skonto innerhalb 10 Tagen bis 25.11.2024.
DueDateDateTime/DateTimeString(format="102") = 20241215
SpecifiedTradeSettlementHeaderMonetarySummation
LineTotalAmount = 198.00
ChargeTotalAmount = 0.00
AllowanceTotalAmount = 0.00
TaxBasisTotalAmount = 198.00
TaxTotalAmount(currencyID="EUR") = 37.62
GrandTotalAmount = 235.62
TotalPrepaidAmount = 0.00
DuePayableAmount = 235.62XSLT basics¶
Build an HTML table with for-each
cdcatalog.xsl · 22 → 15 lines
XSLT source
My CD Collection
Title
Artist
unxml --xslt
xsl:stylesheet(version="1.0", xmlns:xsl="http://www.w3.org/1999/XSL/Transform")
match /:
html
body
h2 = My CD Collection
table(border="1")
tr(bgcolor="#9acd32")
th(style="text-align:left") = Title
th(style="text-align:left") = Artist
foreach catalog/cd:
tr
td
<- title
td
<- artistBranch with choose / when / otherwise
cdcatalog-choose.xsl · 32 → 20 lines
XSLT source
My CD Collection
Title
Artist
unxml --xslt
xsl:stylesheet(version="1.0", xmlns:xsl="http://www.w3.org/1999/XSL/Transform")
match /:
html
body
h2 = My CD Collection
table(border="1")
tr(bgcolor="#9acd32")
th = Title
th = Artist
foreach catalog/cd:
tr
td
<- title
choose:
when price > 10:
td(bgcolor="#ff00ff")
<- artist
else:
td
<- artistNamed templates + apply-templates
cdcatalog-templates.xsl · 33 → 20 lines
XSLT source
My CD Collection
Title:
Artist:
unxml --xslt
xsl:stylesheet(version="1.0", xmlns:xsl="http://www.w3.org/1999/XSL/Transform")
match /:
html
body
h2 = My CD Collection
apply
match cd:
p
apply title
apply artist
match title:
"Title:"
span(style="color:#ff0000")
<- .
br
match artist:
"Artist:"
span(style="color:#00ff00")
<- .
brLiteral-result-element stylesheet
breakfast-menu.xsl · 17 → 15 lines
XSLT source
-
( calories per serving)
unxml --xslt
html(xmlns:xsl="http://www.w3.org/1999/XSL/Transform", xsl:version="1.0")
body(style="font-family:Arial;font-size:12pt;background-color:#EEEEEE")
foreach breakfast_menu/food:
div(style="background-color:teal;color:white;padding:4px")
span(style="font-weight:bold")
<- name
"-"
<- price
div(style="margin-left:20px;margin-bottom:1em;font-size:10pt")
p
<- description
span(style="font-style:italic")
"("
<- calories
"calories per serving)"JSON¶
| Document | Original | Rendered | Source |
|---|---|---|---|
| JSON — Service catalog | 23 lines · 1.0 KB | 25 lines · 631 B | source |
| OpenAPI — Swagger Petstore | 1,270 lines · 32.0 KB | 644 lines · 18.0 KB | source |
| JSON Schema — Draft 2020-12 meta-schema | 58 lines · 2.4 KB | 41 lines · 1.9 KB | source |
| GeoJSON — RFC 7946 FeatureCollection | 52 lines · 936 B | 42 lines · 687 B | source |
XML documents¶
| Document | Original | Rendered | Source |
|---|---|---|---|
| UBL — Invoice (instance) | 493 lines · 19.2 KB | 292 lines · 11.5 KB | source |
| UBL — Order (instance) | 341 lines · 13.6 KB | 212 lines · 7.1 KB | source |
| UBL — Credit Note (instance) | 431 lines · 17.0 KB | 256 lines · 10.3 KB | source |
| CII — Invoice (instance) | 656 lines · 34.7 KB | 336 lines · 14.1 KB | source |
| Factur-X / ZUGFeRD — Extended (instance) | 430 lines · 20.6 KB | 299 lines · 13.9 KB | source |
Schemas¶
| Document | Original | Rendered | Source |
|---|---|---|---|
| Finvoice 3.0 | 1,690 lines · 95.1 KB | 1,129 lines · 45.5 KB | source |
| UBL — Core Component Types | 731 lines · 44.2 KB | 139 lines · 6.8 KB | source |
| UBL — Unqualified Data Types | 553 lines · 26.7 KB | 129 lines · 6.3 KB | source |
| UBL — Qualified Data Types | 69 lines · 3.5 KB | 59 lines · 3.2 KB | source |
| UBL — Common Basic Components | 5,388 lines · 214.7 KB | 1,807 lines · 92.9 KB | source |
| UBL — Common Aggregate Components | 39,798 lines · 2.3 MB | 5,456 lines · 291.3 KB | source |
| UBL — Common Extension Components | 222 lines · 9.3 KB | 105 lines · 5.4 KB | source |
| UBL — Invoice | 1,001 lines · 58.8 KB | 175 lines · 9.0 KB | source |
XSLT¶
| Document | Original | Rendered | Source |
|---|---|---|---|
| DocBook XSL — HTML driver | 558 lines · 20.0 KB | 364 lines · 12.7 KB | source |
| DocBook XSL — inline elements | 1,598 lines · 49.8 KB | 973 lines · 26.6 KB | source |
| DocBook xslTNG 3.0 — function library | 863 lines · 30.6 KB | 507 lines · 20.3 KB | source |
| DocBook xslTNG 3.0 — variables & maps | 428 lines · 20.5 KB | 305 lines · 16.5 KB | source |
| DocBook xslTNG 3.0 — localization (try/catch, iterate) | 273 lines · 10.2 KB | 151 lines · 6.1 KB | source |
| DocBook xslTNG 3.0 — profiling transform | 298 lines · 12.2 KB | 185 lines · 8.5 KB | source |
| ISO Schematron — SVRL skeleton | 614 lines · 21.1 KB | 384 lines · 15.1 KB | source |
Schematron¶
| Document | Original | Rendered | Source |
|---|---|---|---|
| EN16931 — UBL validation (driver) | 34 lines · 1.8 KB | 26 lines · 1.2 KB | source |
| EN16931 — abstract model rules | 341 lines · 51.3 KB | 471 lines · 46.0 KB | source |
| EN16931 — UBL bindings | 277 lines · 71.1 KB | 576 lines · 72.5 KB | source |
MSBuild¶
| Document | Original | Rendered | Source |
|---|---|---|---|
| MSBuild — C# language targets | 397 lines · 21.9 KB | 352 lines · 19.5 KB | source |
| MSBuild — NuGet restore targets | 1,600 lines · 73.2 KB | 1,184 lines · 63.4 KB | source |
| MSBuild — common build targets | 7,129 lines · 379.4 KB | 5,679 lines · 337.8 KB | source |