Files
docling-core/test/data/doc/polymers.gt.html
b20b5677c0 fix(html-serializer): emit XHTML-compatible metadata attributes (#613)
* fix(html-serializer): emit XHTML-compatible metadata attributes

HTMLMetaSerializer previously rendered each metadata field as a valueless
HTML5 attribute (e.g. `<div data-meta-classification>`). Lenient HTML
parsers accept this, but the output is not valid XHTML/XML, so downstream
consumers that parse exported HTML as XML — including TEDS table
evaluation — fail with `xml.etree.ElementTree.ParseError: not well-formed
(invalid token)`.

Switch the attribute shape to a standard name=value pair
(`data-meta-name="<field>"`), HTML-escape both the field name and the
text body (`TabularChartMetaField` is left unescaped because its value is
an intentionally embedded HTML table), and update the embedded CSS
selectors and serialization ground-truth fixtures accordingly. Adds a
regression test that round-trips the output of `export_to_html` through
`xml.etree.ElementTree.fromstring`.

Fixes #598.

Signed-off-by: Brian Wang <20699847+BrianWang1990@users.noreply.github.com>

* fix(html-serializer): rebase changes to 'main' and add tests

Signed-off-by: Cesar Berrospi Ramis <ceb@zurich.ibm.com>

* test(html-serializer): remove redundant CSS rule

Remove duplicate CSS rules in 'html_styles.py' and ground-truth files.

Signed-off-by: Cesar Berrospi Ramis <ceb@zurich.ibm.com>

---------

Signed-off-by: Brian Wang <20699847+BrianWang1990@users.noreply.github.com>
Signed-off-by: Cesar Berrospi Ramis <ceb@zurich.ibm.com>
Co-authored-by: Brian Wang <20699847+BrianWang1990@users.noreply.github.com>
Co-authored-by: Cesar Berrospi Ramis <ceb@zurich.ibm.com>
2026-05-29 10:01:30 +02:00

396 lines
13 KiB
HTML
Vendored
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>report on task: `Write me a document on polymers in food-packaging.`</title>
<meta name="generator" content="Docling HTML Serializer"/>
<style>
html {
background-color: #f5f5f5;
font-family: Arial, sans-serif;
line-height: 1.6;
}
body {
max-width: 800px;
margin: 0 auto;
padding: 2rem;
background-color: white;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
h1, h2, h3, h4, h5, h6 {
color: #333;
margin-top: 1.5em;
margin-bottom: 0.5em;
}
h1 {
font-size: 2em;
border-bottom: 1px solid #eee;
padding-bottom: 0.3em;
}
table {
border-collapse: collapse;
margin: 1em 0;
width: 100%;
}
th, td {
border: 1px solid #ddd;
padding: 8px;
text-align: left;
}
th {
background-color: #f2f2f2;
font-weight: bold;
}
figure {
margin: 1.5em 0;
text-align: center;
}
figcaption {
color: #666;
font-style: italic;
margin-top: 0.5em;
}
img {
max-width: 100%;
height: auto;
}
pre {
background-color: #f6f8fa;
border-radius: 3px;
padding: 1em;
overflow: auto;
}
code {
font-family: monospace;
background-color: #f6f8fa;
padding: 0.2em 0.4em;
border-radius: 3px;
}
pre code {
background-color: transparent;
padding: 0;
}
.formula {
text-align: center;
padding: 0.5em;
margin: 1em 0;
background-color: #f9f9f9;
}
.formula-not-decoded {
text-align: center;
padding: 0.5em;
margin: 1em 0;
background: repeating-linear-gradient(
45deg,
#f0f0f0,
#f0f0f0 10px,
#f9f9f9 10px,
#f9f9f9 20px
);
}
.page-break {
page-break-after: always;
border-top: 1px dashed #ccc;
margin: 2em 0;
}
.key-value-region {
background-color: #f9f9f9;
padding: 1em;
border-radius: 4px;
margin: 1em 0;
}
.key-value-region dt {
font-weight: bold;
}
.key-value-region dd {
margin-left: 1em;
margin-bottom: 0.5em;
}
.form-container {
border: 1px solid #ddd;
padding: 1em;
border-radius: 4px;
margin: 1em 0;
}
.form-item {
margin-bottom: 0.5em;
}
.image-classification {
font-size: 0.9em;
color: #666;
margin-top: 0.5em;
}
details.docling-meta {
margin: 0.5em 0;
font-size: 0.9em;
text-align: left;
}
figure details.docling-meta {
text-align: left;
}
details.docling-meta > summary {
cursor: pointer;
color: #555;
font-style: italic;
padding: 2px 6px;
}
.docling-meta-field {
background-color: #f0f0f0;
border-left: 3px solid #ccc;
padding: 6px 10px;
margin: 4px 0 4px 1em;
border-radius: 3px;
text-align: left;
}
.docling-meta-field-label {
font-weight: bold;
color: #444;
}
pre.docling-meta-code {
background-color: #1e1e1e;
color: #d4d4d4;
border-radius: 4px;
padding: 10px 12px;
margin: 6px 0;
overflow-x: auto;
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
font-size: 0.85em;
line-height: 1.45;
white-space: pre;
tab-size: 4;
}
pre.docling-meta-code code {
background: transparent;
border: none;
padding: 0;
color: inherit;
font-family: inherit;
font-size: inherit;
display: block;
white-space: pre;
}
</style>
</head>
<body>
<div class='page'>
<h1>Polymers in Food Packaging</h1>
<h2>Introduction</h2>
<h2>Polymer Classes Used in Food Packaging</h2>
<h3>Thermoplastics</h3>
<h3>Elastomers</h3>
<h2>Physical and Chemical Properties Relevant to Food Packaging</h2>
<ul>
<li>
<span class='inline-group'><strong>Barrier to gases and moisture</strong></span>
<ul>
<li>Oxygen transmission rate (OTR) – how much O₂ passes per square meter per hour.</li>
<li>Carbon‑dioxide transmission rate (CO₂TR) – how much CO₂ permeates.</li>
<li>Water‑vapor transmission rate (WVTR) – amount of moisture that diffuses.</li>
<li>Influence of polymer crystallinity, copolymer composition, and barrier additives on all three rates.</li>
</ul>
</li>
<li>
<span class='inline-group'><strong>Tensile strength</strong></span>
<ul>
<li>Tensile modulus (MPa) – stiffness of the material.</li>
<li>Elongation at break (%) – flexibility before failure.</li>
<li>Standard test conditions (temperature, strain rate) that determine the reported values.</li>
</ul>
</li>
<li>
<span class='inline-group'><strong>Heat resistance</strong></span>
<ul>
<li>Glass transition temperature (Tg) – the temperature at which the polymer softens.</li>
<li>Heat deflection temperature (HDT) – the temperature at which it bends under load.</li>
<li>Thermal degradation onset temperature – the point where chemical breakdown starts.</li>
<li>Suitability for microwave, oven, or sterilization processes.</li>
</ul>
</li>
<li>
<span class='inline-group'><strong>Chemical stability</strong></span>
<ul>
<li>Resistance to acids, bases, and organic solvents used in food processing.</li>
<li>Oxidative stability – how well the polymer resists free‑radical degradation.</li>
<li>Interaction with food constituents such as fatty acids, alcohols, and acids.</li>
<li>Impact on polymer aging and shelf‑life of packaged products.</li>
</ul>
</li>
<li>
<span class='inline-group'><strong>Migration potential</strong></span>
<ul>
<li>Results of migration tests (e.g., extraction of additives or additives’ leaching).</li>
<li>Compliance with regulatory limits (e.g., EU Directive 10/2011, FDA food‑contact legislation).</li>
<li>Effect of temperature, time, and food type on the amount of material that migrates.</li>
<li>Barrier performance against the migration of contaminants or degradation products.</li>
</ul>
</li>
</ul>
<h2>Applications of Polymers in Food Packaging</h2>
<h3>Packaging Types</h3>
<h4>Films</h4>
<h4>Bottles</h4>
<h4>Trays</h4>
<h2>Safety and Regulatory Considerations</h2>
<strong><p>Common migration testing methods</p></strong>
<ul>
<li>
<span class='inline-group'><strong>Extraction in food simulants</strong></span>
<ul>
<li>
<span class='inline-group'><em>What it is</em> : Samples of the packaging material are immersed in a liquid that mimics the chemical properties of a specific food type (e.g., aqueous, acidic, fatty).</span>
</li>
<li>
<span class='inline-group'><em>Typical simulants</em> :</span>
<ul>
<li>3% acetic acid (for acidic foods)</li>
<li>50% ethanol (for alcohol‑based foods)</li>
<li>95% ethanol (for high‑fat foods)</li>
<li>Distilled water (for aqueous foods)</li>
</ul>
</li>
<li>
<span class='inline-group'><em>Procedure</em> :</span>
<ul>
<li>Prepare a defined volume of simulant in a sealed vessel.</li>
<li>Immerse the material for a set time at a controlled temperature (often 50 °C–70 °C).</li>
<li>Remove, filter, and concentrate the extract for analysis.</li>
</ul>
</li>
<li>
<span class='inline-group'><em>Analysis</em> : GC‑MS, LC‑MS, or HPLC depending on the analyte class.</span>
</li>
<li>
<span class='inline-group'><em>Advantages</em> : Direct assessment of potential migration into a realistic medium; scalable for routine testing.</span>
</li>
<li>
<span class='inline-group'><em>Limitations</em> : Does not account for headspace gas migration; may underestimate migration of highly volatile substances.</span>
</li>
</ul>
</li>
<li>
<span class='inline-group'><strong>Headspace analysis</strong></span>
<ul>
<li>
<span class='inline-group'><em>What it is</em> : Measurement of volatile substances that migrate from the material into the surrounding gas phase.</span>
</li>
<li>
<span class='inline-group'><em>Procedure</em> :</span>
<ul>
<li>Seal the material in a headspace vial or chamber.</li>
<li>Equilibrate at a defined temperature (commonly 25 °C–60 °C).</li>
<li>Sample the gas phase with a gas sampling needle or syringe.</li>
<li>Analyze via GC‑FID, GC‑MS, or PTR‑MS.</li>
</ul>
</li>
<li>
<span class='inline-group'><em>Applications</em> : Assessment of aromas, flavor compounds, or volatile contaminants.</span>
</li>
<li>
<span class='inline-group'><em>Advantages</em> : Sensitive to low‑concentration volatiles; minimal sample preparation.</span>
</li>
<li>
<span class='inline-group'><em>Limitations</em> : Does not capture non‑volatile migration; results depend on equilibrium time and temperature.</span>
</li>
</ul>
</li>
<li>
<span class='inline-group'><strong>Direct contact tests</strong></span>
<ul>
<li>
<span class='inline-group'><em>What it is</em> : The packaging material is placed in direct contact with the food or food simulant, often using a defined food‑packaging configuration.</span>
</li>
<li>
<span class='inline-group'><em>Procedure</em> :</span>
<ul>
<li>Assemble the material and food (or simulant) in a mold or container that simulates real usage (e.g., sealed pouch, jar).</li>
<li>Incubate for the intended storage time at the relevant temperature.</li>
<li>Extract or sample the food directly (e.g., through the material or by taking a portion of the food).</li>
<li>Analyze for migrated substances.</li>
</ul>
</li>
<li>
<span class='inline-group'><em>Advantages</em> : Mimics real consumer exposure; captures both liquid and vapor migration pathways.</span>
</li>
<li>
<span class='inline-group'><em>Limitations</em> : More labor‑intensive; requires careful control of contact area, thickness, and sealing integrity.</span>
</li>
</ul>
</li>
</ul>
<p>These three approaches—extraction in food simulants, headspace analysis, and direct contact tests—complement each other to provide a comprehensive assessment of potential migration from packaging into food.</p>
<h2>Environmental Impact and Sustainability</h2>
<ul>
<li>
<strong>Resource consumption</strong>
<ul>
<li>Energy usage for manufacturing, transportation, and daily activities</li>
<li>Water consumption in agriculture, industry, and household use</li>
<li>Extraction of raw materials (mining, drilling, logging)</li>
<li>Associated carbon emissions and climate impact</li>
</ul>
</li>
<li>
<strong>Landfill waste</strong>
<ul>
<li>Rapid growth in waste volume due to population and consumption increases</li>
<li>Methane production from decomposing organic matter</li>
<li>Leachate generation that can contaminate soil and groundwater</li>
<li>Limited landfill space leading to overburdened disposal sites</li>
</ul>
</li>
<li>
<strong>Plastic pollution</strong>
<ul>
<li>Accumulation of large‑scale debris in oceans and rivers</li>
<li>Formation of microplastics that enter the food chain</li>
<li>Low recycling rates and inefficient waste separation</li>
<li>Prevalence of single‑use plastics contributing to ongoing litter</li>
</ul>
</li>
</ul>
<h3>Recyclability</h3>
<h3>Biodegradable Polymers</h3>
<h2>Emerging Trends and Future Outlook</h2>
<h2>Conclusion</h2>
<ul>
<li>
<strong>Polymer Versatility</strong>
<ul>
<li>Multiple functional groups enable tailoring of mechanical, thermal, and chemical properties for specific applications</li>
<li>Used across diverse fields: electronics (semiconductors, flexible displays), biomedicine (drug delivery, tissue scaffolds), packaging, automotive, and aerospace</li>
<li>Compatible with additive manufacturing techniques (3D printing, fused deposition modeling) for rapid prototyping and custom parts</li>
<li>Recyclability and upcycling potential, allowing polymers to be re‑processed into higher‑value materials</li>
</ul>
</li>
<li>
<strong>Regulatory Compliance</strong>
<ul>
<li>Adherence to FDA, CE, and ISO standards for medical and consumer products</li>
<li>Compliance with chemical restriction directives such as RoHS, REACH, and TSCA to limit hazardous substances</li>
<li>Robust traceability systems (batch records, chain‑of‑custody documentation) required for quality assurance</li>
<li>Market‑specific adaptations: meeting US FDA 510(k) or PMA requirements, EU MDR for medical devices, and emerging guidelines in Asia</li>
</ul>
</li>
<li>
<strong>Environmental Sustainability</strong>
<ul>
<li>Life‑cycle assessments (LCAs) demonstrate reductions in greenhouse gas emissions and energy consumption compared to traditional materials</li>
<li>Development of renewable monomers (PLA from corn starch, PHA from microbial fermentation) to reduce fossil‑fuel dependence</li>
<li>Biodegradable and compostable polymers that safely break down under industrial or home composting conditions</li>
<li>Closed‑loop recycling strategies and chemical depolymerization processes to recover monomers and reduce waste</li>
</ul>
</li>
<li>
<strong>Ongoing Research</strong>
<ul>
<li>Creation of smart polymers (shape‑memory, self‑healing, stimuli‑responsive) for adaptive applications in robotics and wearables</li>
<li>Exploration of polymer nanocomposites to enhance strength, thermal conductivity, and electrical properties</li>
<li>Application of machine‑learning algorithms for high‑throughput polymer design and property prediction</li>
<li>Long‑term durability studies in extreme environments (high‑temperature, corrosive, UV exposure) to validate performance for aerospace and infrastructure use</li>
</ul>
</li>
</ul>
</div>
</body>
</html>