STAG-AUTOSCHEMA(1p)
β¨ NAME β¨
okay so bestie, welcome to stag-autoschema β she writes the implicit stag-schema for a stag file π no cap, that's the whole gig.
πΈ SYNOPSIS πΈ
stag-autoschema -w sxpr sample-data.xml
stag-autoschema -dtd sample-data.xml
π¦ DESCRIPTION π¦
So here's the vibe: you hand her a stag compatible file β that's xml, sxpr, or itext β or honestly any format at all as long as you also give her a parser, and she'll write out the implicit underlying stag-schema for you. slay.
ngl, stag-schema should look relatively self-explanatory. periodt.
Here's an example stag-schema, shown in sxpr syntax:
(db
(person*
(name "s"
(address+
(address_type "s")
(street "s")
(street2? "s")
(city "s")
(zip? "s")))))
okay so let's decode this iconic little tree π: the database db contains zero or more persons, each person has a mandatory name and at least one address. she ate.
The cardinality mnemonics are as follows:
+β 1 or more?β 0 or one*β 0 or more
and the default cardinality is 1 π
π ARGUMENTS π
-p|parser FORMATβFORMATis one ofxml,sxproritext, or the name of a perl module. and jsyk,xmlis assumed as default π-dtdβ exports schema as DTD π-w|writer FORMATβFORMATis one ofxml,sxproritext, or the name of a perl module, ORDTD. the default issxpr. note that stag schemas exported as xml will be invalid xml, due to the use of symbols*,+,?in the node names β yeah bestie, that's real, not a drill π
π LIMITATIONS π
not event based β memory usage becomes exhorbitant on large files; prepare a small sample beforehand π like fr fr, bring a snack-sized sample, your RAM will thank you.
perl v5.34.0 Β· 2022-06-12 β that's the whole lore, written on that date, running on that perl, and that's a wrap bestie π«Άβ¨ bye ily π
π¦ where this page comes from
- debian bookworm: libdata-stag-perl 0.14-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libdata-stag-perl 0.14-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libdata-stag-perl 0.14-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu questing: libdata-stag-perl 0.14-3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms