Pipe‑Tobacco Review, Tobacco & Pipe XML Standards

Technical documentation for developers and contributors.

Three complementary standards: detailed reviews, tobacco inventory management, and pipe collection cataloging.

1. Overview of the Standards

The Pipe‑Tobacco XML Standards consist of three complementary formats:

StandardRoot ElementNamespaceVersionSchema FilePurpose
Review <Review> http://example.org/pipe-review version="1.0" pipe-review.xsd Detailed tobacco reviews with ratings
Tobacco Inventory <Tobacco> http://example.org/tobacco version="1.0" tobacco.xsd Tobacco collection cataloging and management
Pipe Inventory <Pipe> http://example.org/pipe version="1.0" pipe.xsd Pipe collection cataloging with specifications

Key Design Principles:

2. Pipe Tobacco Review Standard

2.1 Core Elements

The table below lists every element that appears directly under <Review>. All are xs:string unless noted otherwise.

ElementTypeRequired?Description
CreatedDatexs:dateYesISO‑8601 date (YYYY‑MM‑DD) when the review was written.
ParentBrandxs:stringNoCorporate owner of the tobacco brand.
Brandxs:stringNoCommercial brand name.
Blendxs:stringNoBlend description (e.g., "Virginia/Latakia").
ContentMultiSelectItemNo, repeatableLeaf‑tobacco types (Virginia, Burley, …).
FlavoringMultiSelectItemNo, repeatableAdded flavorings (Cherry, Vanilla, …).
Sourcexs:stringNoWhere the tobacco was obtained.
TobaccoCutMultiSelectItemNo, repeatableCut style(s) – Fine, Medium, Coarse.
AgeOfTobaccoxs:stringNoHuman‑readable age (e.g., "6 months").
WeatherOnDayxs:stringNoWeather during the session.
PipeUsedxs:stringNoPipe model.
PipeShapexs:stringNoShape descriptor (Bent, Straight, …).

2.2 Rating Elements (1‑5)

All rating elements are of type RatingType, an integer restricted to the range 1‑5.

ElementMeaning
PowerOrIntensityOverall strength/power of the blend.
DepthPerceived depth of flavor.
ComplexityNumber of distinct notes.
BalanceOfFlavorsHarmony among flavors.
StrengthNicotine / mouth‑feel intensity.
SmoothnessHarshness vs. smoothness.
FinesseSubtlety of the smoke.
RichnessBody and fullness.
SweetnessPresence of sweet notes.
PleasantFruitFruitiness.
PleasantSpiceSpiciness.
PleasantTangTangy / acidic notes.
PleasantUmamiSavory / umami quality.
HighPointOfBowlQuality of the high point of the bowl.
LowPointOfBowlQuality of the low point of the bowl.
BurnsCoolHow cool the burn stays.
SufficientlyDryDryness of the smoke.
TinAromaAroma when the tin is opened.
SidestreamAromaAroma of the sidestream smoke.
RoomNoteOverall room note after smoking.

Two additional elements close the review:

  • <Comments> – free‑form reviewer notes (preserve whitespace).
  • <FinalRating> – overall rating, usually the average of the individual scores.

2.3 Data‑Type Details

TypeDefinitionConstraints
xs:dateISO‑8601 calendar date.Must be a valid Gregorian date (YYYY‑MM‑DD).
RatingTypeSimple integer restriction.minInclusive = 1, maxInclusive = 5.
MultiSelectItemUnrestricted string.Intended for repeatable selections (e.g., multiple <Content> entries).
xs:stringUnicode text.No length limit, but keep it reasonable for readability.

2.4 Repeating Elements

Elements that may appear zero or more times are declared with maxOccurs="unbounded" in the XSD:

<xs:element name="Content" type="MultiSelectItem"
    minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Flavoring" type="MultiSelectItem"
    minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="TobaccoCut" type="MultiSelectItem"
    minOccurs="0" maxOccurs="unbounded"/>

Usage example:

<Content>Virginia</Content>
<Content>Burley</Content>
<Content>Latakia</Content>

2.5 Optional vs. Required

  • Required: Only CreatedDate is mandatory (minOccurs="1").
  • Optional: Every other element has minOccurs="0"; you may omit it if the information isn't known.

Best practice: Include as many fields as you have reliable data; the schema will still validate a sparse review.

3. Tobacco Inventory Standard

This standard is designed for cataloging pipe tobacco collections, tracking storage, dates, and inventory status. It's perfect for building cellar management systems.

3.1 Core Elements

The table below lists every element that appears directly under <Tobacco>.

ElementTypeRequired?Description
ParentBrandxs:stringNoCorporate owner of the tobacco brand (e.g., "STG").
Brandxs:stringNoCommercial brand name (e.g., "MacBaren").
Blendxs:stringNoSpecific blend name (e.g., "Plumcake Navy Blend").
Countryxs:stringNoCountry of manufacture (e.g., "Denmark").
BlendTypeMultiSelectItemNo, repeatableBlend style(s) – Aromatic, English, Navy Blend, etc.
ContentsMultiSelectItemNo, repeatableTobacco leaf types (Virginia, Burley, Latakia, etc.).
FlavoringMultiSelectItemNo, repeatableAdded flavorings (Rum, Cherry, etc.).
Weightxs:stringNoTotal weight (e.g., "3.5 oz", "50g").
StorageTypexs:stringNoPackaging type (Tin, Pouch, Jar, Bulk).
StorageQtyxs:integerNoNumber of storage units (e.g., 1 for one tin).
SerialNumberxs:stringNoUPC/barcode or batch number.
BlendedByxs:stringNoActual blender/manufacturer.
CutMultiSelectItemNo, repeatableCut style(s) – Ribbon, Flake, Shag, etc.
PurchaseDatexs:stringNoDate purchased (MM/DD/YYYY format).
ManufactureDatexs:stringNoDate manufactured (MM/DD/YYYY format).
Statusxs:stringNoCurrent status (Cellared, Opened, Consumed).
Notesxs:stringNoAny additional notes or observations.
RatingRatingTypeNoPersonal rating (1‑5).

3.2 Data‑Type Details

The Tobacco standard uses the same core data types as the Review standard, with one addition:

TypeDefinitionConstraintsUsage
xs:stringUnicode text.No length limit.Most inventory fields (dates as strings).
xs:integerWhole number.Positive integers only.StorageQty (number of units).
RatingTypeSimple integer restriction.minInclusive = 1, maxInclusive = 5.Personal rating.
MultiSelectItemUnrestricted string.None.Repeatable selections (BlendType, Contents, etc.).

Note on Dates: Unlike the Review standard, inventory dates use human-readable string format (MM/DD/YYYY) rather than ISO‑8601, making them more intuitive for cellar tracking.

3.3 Repeating Elements

The Tobacco standard supports four repeatable element types for multi‑select fields:

<xs:element name="BlendType" type="MultiSelectItem"
    minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Contents" type="MultiSelectItem"
    minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Flavoring" type="MultiSelectItem"
    minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Cut" type="MultiSelectItem"
    minOccurs="0" maxOccurs="unbounded"/>

Usage example for a complex blend:

<BlendType>Navy Blend</BlendType>
<BlendType>Aromatic</BlendType>
<Contents>Black Cavendish</Contents>
<Contents>Burley</Contents>
<Contents>Latakia</Contents>
<Contents>Virginia</Contents>
<Flavoring>Rum</Flavoring>

3.4 Optional vs. Required

  • All Optional: Every element has minOccurs="0". You can create valid tobacco records with just the brand and blend name.
  • Best Practice: Start with basic identification (Brand, Blend) and add details as they become available.

Inventory Philosophy: The standard is designed to be forgiving – you can quickly add new tobaccos to your cellar and fill in details later as you open and smoke them.

4. Pipe Inventory Standard

This standard is designed for cataloging pipe collections with detailed specifications including materials, dimensions, provenance, and condition tracking. It's perfect for building comprehensive pipe collection management systems.

4.1 Core Elements

The table below lists every element that appears directly under <Pipe>. Complex types are noted.

ElementTypeRequired?Description
Brandxs:stringNoCommercial brand name (e.g., "J. Mouton Pipes").
PipeCarverxs:stringNoIndividual pipe maker/craftsman.
Modelxs:stringNoSpecific model name (e.g., "Calabash with Removable Top").
ModelNumberxs:stringNoManufacturer's model or grade number.
MarkingStampingxs:stringNoEngraved markings on the pipe.
Shapexs:stringNoPipe shape classification (Calabash, Billiard, Dublin, etc.).
StemMaterialMultiSelectItemNo, repeatableStem material(s) – Ebonite, Vulcanite, Acrylic, etc.
AccentMultiSelectItemNo, repeatableAccent materials (Silver, Gold, Wood, none).
PipeMaterialMultiSelectItemNo, repeatableBowl/stem materials – Briar, Meerschaum, Bamboo, etc.
PipeFinishxs:stringNoSurface finish – Smooth, Rustic, Sandblasted, Carved.
StemTypexs:stringNoStem bit type – Fishtail, Tapered, Saddle, etc.
CountryOfOriginxs:stringNoCountry where pipe was made (US, Denmark, UK, etc.).
DatePipeMadexs:stringNoDate pipe was crafted (MM-DD-YYYY format).
DatePipePurchasedxs:stringNoDate pipe was acquired (MM-DD-YYYY format).
Sourcexs:stringNoWhere pipe was purchased (Pipe Show, Retail, etc.).
PricePriceTypeNoPurchase price as decimal (currency not specified).
DimensionsDimensionsTypeNoNested complex type containing all measurements.
NotesNotesTypeNoNested complex type containing pipe notes and status.

4.2 Data‑Type Details

The Pipe standard introduces specialized types for measurements and pricing:

TypeDefinitionConstraintsUsage
xs:stringUnicode text.No length limit.Most descriptive fields (dates as strings).
MultiSelectItemUnrestricted string.None.Repeatable material selections (StemMaterial, PipeMaterial, etc.).
PriceTypeDecimal restriction.minInclusive = 0.Purchase price (currency not specified).
DimensionsTypeComplex type.All fields optional.Nested measurements with units preserved.
NotesTypeComplex type.All fields optional.Nested notes and status information.

Note on Dates: Pipe dates use human-readable string format (MM-DD-YYYY) for consistency with the Tobacco standard.

Note on Dimensions: All measurements are stored as strings to preserve units (inches, mm, grams, etc.).

4.3 Complex Types

The Pipe standard uses two nested complex types for logical data grouping:

4.3.1 DimensionsType

Groups all pipe measurements:

ElementTypeDescription
PipeLengthxs:stringTotal length from bit to bowl end (e.g., "5.25 in").
BowlHeightxs:stringHeight from base to rim (e.g., "6 in").
OutsideDiameterxs:stringWidest bowl diameter (e.g., "1.5 in").
ChamberDiameterxs:stringInternal bowl diameter (e.g., ".75 in").
ChamberDepthxs:stringInternal bowl depth (e.g., "1.25 in").
Weightxs:stringTotal pipe weight (e.g., "2.1 oz").
4.3.2 NotesType

Groups pipe condition and usage information:

ElementTypeDescription
DedicatedToxs:stringTobacco type this pipe is dedicated to (e.g., "English").
Statusxs:stringCurrent condition (Resting, Active, Retired, etc.).
Notesxs:stringAdditional observations or maintenance notes.

Usage Example:

<Dimensions>
    <PipeLength>5.25 in</PipeLength>
    <BowlHeight>6 in</BowlHeight>
    <ChamberDiameter>.75 in</ChamberDiameter>
    <ChamberDepth>1.25 in</ChamberDepth>
</Dimensions>
<Notes>
    <DedicatedTo>English</DedicatedTo>
    <Status>Resting</Status>
    <Notes>Briar, Bamboo Root shank, Teflon, Kevlar Rubber</Notes>
</Notes>

4.4 Repeating Elements

The Pipe standard supports three repeatable element types for multi-material pipes:

<xs:element name="StemMaterial" type="MultiSelectItem" 
    minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Accent" type="MultiSelectItem" 
    minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="PipeMaterial" type="MultiSelectItem" 
    minOccurs="0" maxOccurs="unbounded"/>

Usage example for a composite pipe:

<PipeMaterial>Briar</PipeMaterial>
<PipeMaterial>Bamboo</PipeMaterial>
<StemMaterial>Ebonite</StemMaterial>
<Accent>Silver</Accent>
<Accent>Wood</Accent>

Design Note: This allows for complex pipe constructions with multiple materials while maintaining clear structure.

4.5 Optional vs. Required

  • All Optional: Every element and complex type has minOccurs="0". You can create valid pipe records with just the brand and model.
  • Best Practice: Start with basic identification (Brand, Model, Shape) and add detailed specifications as they become available.
  • Complex Type Flexibility: Within Dimensions and Notes, all fields are optional, allowing partial measurement data.

Collection Philosophy: The standard supports both quick cataloging of new acquisitions and detailed documentation of prized pieces.

5. Validation Workflow

All three standards follow the same validation approach:

# For Review Standard:
xmllint --noout --schema pipe-review.xsd review.xml

# For Tobacco Standard:
xmllint --noout --schema tobacco.xsd tobacco.xml

# For Pipe Standard:
xmllint --noout --schema pipe.xsd pipe.xml

# All return "valid" or print detailed errors with line numbers.

IDE Support: Most modern editors (VS Code, IntelliJ, Eclipse) support XSD association and real-time validation. Simply add this to your XML file:

<?xml-model href="pipe-review.xsd" type="application/xml" 
    schemalocation="http://example.org/pipe-review pipe-review.xsd"?>

Replace pipe-review.xsd with tobacco.xsd or pipe.xsd for the appropriate standard.

6. Extending the Standards

All three standards are designed to be extensible. Follow these steps for each:

  1. Define New Types: Add enumerations or restrictions (e.g., ShapeType for standardized pipe shapes).
  2. Insert Elements: Add new elements in the logical position within the xs:sequence.
  3. Set Cardinality: Use minOccurs="0" for optional, maxOccurs="unbounded" for repeatable.
  4. Update Documentation: Document the new field and bump the version (e.g., 1.1).

Example Extensions:

Place new elements in logical sequence order to maintain data flow.

7. Practical Tips & Gotchas

IssueStandardWhat to Watch ForRemedy
Wrong namespaceAllForgetting the default namespace on root element.Ensure proper xmlns declaration on <Review>, <Tobacco>, or <Pipe>.
Date formatReviewUsing MM/DD/YYYY instead of ISO‑8601.Review standard requires YYYY‑MM‑DD; Tobacco/Pipe use MM/DD/YYYY strings.
Rating out of rangeReview/TobaccoEntering 0 or 6 for ratings.XSD rejects values outside 1‑5 range.
Missing closing tagsAllXML is strict about tag matching.Validate early with editor or xmllint.
Large comment blocksReviewVery long <Comments> bloat files.Consider external markdown references.
Storage quantity confusionTobaccoMixing units (1 tin vs 1 oz).Always specify StorageType with StorageQty.
Dimension unitsPipeMissing measurement units.Include units in string values (e.g., "5.25 in", "2.1 oz").
Complex type nestingPipeForgetting to close nested <Dimensions> or <Notes>.Validate structure early; use proper XML indentation.
Comma-separated valuesAllTemptation to use CSV instead of repeats.Use individual elements for better structure and validation.
Price precisionPipeUsing strings instead of PriceType.Use decimal values (e.g., <Price>125.50</Price>).

8. Minimal Examples

8.1 Minimal Review

This tiny review passes validation (only CreatedDate required):

<?xml version="1.0" encoding="UTF-8"?>
<Review xmlns="http://example.org/pipe-review" version="1.0">
    <CreatedDate>2025-09-15</CreatedDate>
    <Brand>Royal Danish</Brand>
    <Blend>Virginia/Latakia</Blend>
    <Content>Virginia</Content>
    <Content>Burley</Content>
    <Flavoring>Cherry</Flavoring>
    <PowerOrIntensity>4</PowerOrIntensity>
    <FinalRating>4</FinalRating>
</Review>

8.2 Minimal Tobacco Entry

This basic inventory entry captures the essentials:

<?xml version="1.0" encoding="UTF-8"?>
<Tobacco xmlns="http://example.org/tobacco" version="1.0">
    <Brand>MacBaren</Brand>
    <Blend>Plumcake Navy Blend</Blend>
    <Country>Denmark</Country>
    <StorageType>Tin</StorageType>
    <StorageQty>1</StorageQty>
    <Status>Cellared</Status>
    <Rating>3</Rating>
</Tobacco>

8.3 Minimal Pipe Entry

This basic pipe record captures the essentials:

<?xml version="1.0" encoding="UTF-8"?>
<Pipe xmlns="http://example.org/pipe" version="1.0">
    <Brand>J. Mouton Pipes</Brand>
    <Model>Calabash with Removable Top</Model>
    <Shape>Calabash</Shape>
    <CountryOfOrigin>US</CountryOfOrigin>
    <Price>1</Price>
    <Status>Resting</Status>
</Pipe>

9. Resources

Community: Submit Feedback Suggest Extensions