diff --git a/RelaxNG/document-pdf-ua1.rnc b/RelaxNG/document-pdf-ua1.rnc
index 5852458..66c38d4 100644
--- a/RelaxNG/document-pdf-ua1.rnc
+++ b/RelaxNG/document-pdf-ua1.rnc
@@ -11,6 +11,12 @@ namespace Table = "http://iso.org/pdf/ssn/Table"
namespace List = "http://iso.org/pdf/ssn/List"
namespace Artifact = "http://iso.org/pdf/ssn/Artifact"
+# XMP
+namespace x = "adobe:ns:meta/"
+namespace rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+namespace dc = "http://purl.org/dc/elements/1.1/"
+namespace pdfuaid = "http://www.aiim.org/pdfua/ns/id/"
+
# XHTML Namespace, not currently used
namespace h = "http://www.w3.org/1999/xhtml"
@@ -40,15 +46,47 @@ pdf1rolemap-Note = attribute rolemaps-to {"Note"}
# UA-1 does not force a single document element.
start = PDF
-PDF = element NoNS:PDF {StructTreeRoot}
+PDF = element NoNS:PDF {StructTreeRoot,XMP?}
+
StructTreeRoot = element NoNS:StructTreeRoot {( Document|DocumentFragment|Part|Art|Div|Sect|TOC|Aside|BlockQuote|NonStruct|Private|P|Note|Code|Hn|H|Title|Link|Annot|Form|FENote|Index|L|Table|Figure|Formula|Artifact)*}
+
AssociatedFile = element NoNS:AssociatedFile {
attribute name {text},
(text|math)
}
+AssociatedFilemath = element NoNS:AssociatedFile {
+attribute name {text},
+(math)
+}
+AssociatedFiletext = element NoNS:AssociatedFile {
+attribute name {text},
+(text)
+}
+
+formula-requirements = (
+ attribute actualtext {text}|
+ attribute alt {text}
+)
+
+## PDF/UA-1
+pdfuaid_part = element pdfuaid:part {"1"}
+
## share with pdf1.7 version from here to end
+# XMP data
+anyelem = element * {(attribute * {text}* | text | anyelem) *}
+
+XMP = element NoNS:XMP {x_xmpmeta & anyelem*}
+
+x_xmpmeta = element x:xmpmeta {attribute * {text}*,(rdf_RDF & anyelem*)}
+
+rdf_RDF= element rdf:RDF {attribute * {text}*, (rdf_Description & anyelem*)}
+
+rdf_Description= element rdf:Description {attribute * {text}*, (pdfuaid_part & anyelem*)}
+
+# end of XMP
+
textorHTML &= (Link|Reference|Strong|Code|Em|Lbl|Span|mathse|Quote|RB|Annot|Figure|Form)*
MathMLPGlobalAttributes &= showtags-attributes
@@ -493,13 +531,29 @@ Figure = element pdf2:Figure {
}
### Formula
-
+# expanded pdf2-attributes to avoid so much backtracking
Formula = element pdf2:Formula {
- pdf2-attributes,
+ AssociatedFiletext*,
+ formula-requirements ,
+ AssociatedFiletext*,
+ (
+ attribute lang {text}?, # Lang
+ attribute expansion {text}?, # E
+ attribute title {text}?, # T
+ attribute id {text}?, # ID
+ attribute phoneme {text}?, # Phoneme
+ attribute phonetic-alphabet {text}?, # PhoneticAlphabet
+ attribute revision {text}?, # R
+ layout-attributes,
+ otherns-attributes,
+ attribute af {text}?,
+ attribute rolemapped-from {text}?,
+ attribute referenced-as {text}?,
attribute Layout:Width {text}?,
attribute Layout:Height {text}?,
(H? & Caption? & (text|Part|Div|Aside|BlockQuote|NonStruct|Private|P|Note|Code|Hn|Sub|Lbl|Em|Strong|Span|Quote|Link|Reference|Annot|Form|Ruby|Warichu|FENote|Index|L|BibEntry|Table|Figure|Formula|Artifact|
mathse)*)
+)
}
### Artifact
@@ -571,3 +625,4 @@ pdf2-attributes,
(text|NonStruct|Private|Note|Code|Sub|Lbl|Em|Strong|Span|Quote|Link|Reference|Annot|Form|Ruby|Warichu|FENote|BibEntry|Figure|Formula|Artifact)*
}
+
diff --git a/RelaxNG/document-pdf-ua1.rng b/RelaxNG/document-pdf-ua1.rng
index a78275b..4e0f56f 100644
--- a/RelaxNG/document-pdf-ua1.rng
+++ b/RelaxNG/document-pdf-ua1.rng
@@ -1,2717 +1,2869 @@
-
-
-
-
-
-
-
-
-
-
-
-
- MathML Namespace (temp actualtext moved to content element in new code)
-
-
-
-
-
-
- \s*(([\-+]?[0-9]*([0-9]\.?|\.[0-9])[0-9]*(r?em|ex|in|cm|mm|p[xtc]|Q|v[hw]|vmin|vmax|%))|0)\s*
-
-
-
-
-
-
-
-
-
-
-
-
- P
-
-
-
-
- Span
-
-
-
-
- Note
-
-
-
-
-
-
-
-
- PDF
-
-
-
-
-
- StructTreeRoot
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- AssociatedFile
-
-
-
-
-
-
-
-
- share with pdf1.7 version from here to end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PDF structure Namespace
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Block
- Inline
- Before
- Start
- End
-
-
-
-
-
-
- LrTb
- RlTb
- TbRl
- TbLr
- LrBt
- RlBt
- BtRl
- BtLr
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Start
- Center
- End
- Justify
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Underline
- Overline
- LineThrough
-
-
-
-
-
-
- Sup
- Sub
- Normal
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- None
- Unordered
- Description
- Disc
- Circle
- Square
- Ordered
- Decimal
- UpperRoman
- LowerRoman
- UpperAlpha
- LowerAlpha
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Document Level
-
- Document
-
-
-
-
-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-
-
-
-
-
-
- BibEntry
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Sub Block
-
- Sub
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Inline
-
- Lbl
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Em
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Strong
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Span
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Link
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Annot
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Ruby
-
- Ruby
-
-
-
-
- Start
- Center
- End
- Justify
- Distribute
-
-
-
-
-
-
- Before
- After
- Warichu
- Inline
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- RB
-
-
-
-
- Start
- Center
- End
- Justify
- Distribute
-
-
-
-
-
-
- Before
- After
- Warichu
- Inline
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- RT
-
-
-
-
- Start
- Center
- End
- Justify
- Distribute
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- RP
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Warichu
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- WT
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- WP
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Lists
-
- L
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- LI
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- LBody
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Index
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Tables
-
- Table
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- THead
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- TBody
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- TFoot
-
-
-
-
-
-
-
-
-
-
-
-
-
- TR
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- TH
-
-
-
-
-
-
-
-
-
-
- Before
- Middle
- After
- Justify
-
-
-
-
-
-
- Start
- Center
- End
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Column
- Row
- Both
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- TD
-
-
-
-
-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+
+
+
+
+
+
+
+
+
+ AssociatedFile
+
+
+
+
+
+
+ AssociatedFile
+
+
+
+
+
+
+
+
+
+
+
+ PDF/UA-1
+
+ 1
+
+
+
+
+ share with pdf1.7 version from here to end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ XMP
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PDF structure Namespace
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Block
+ Inline
+ Before
+ Start
+ End
+
+
+
+
+
+
+ LrTb
+ RlTb
+ TbRl
+ TbLr
+ LrBt
+ RlBt
+ BtRl
+ BtLr
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Start
+ Center
+ End
+ Justify
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Underline
+ Overline
+ LineThrough
+
+
+
+
+
+
+ Sup
+ Sub
+ Normal
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ None
+ Unordered
+ Description
+ Disc
+ Circle
+ Square
+ Ordered
+ Decimal
+ UpperRoman
+ LowerRoman
+ UpperAlpha
+ LowerAlpha
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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
+ Before
+ After
+ Warichu
+ Inline
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ RB
+
+
+
+
+ Start
+ Center
+ End
+ Justify
+ Distribute
+
+
+
+
+
+
+ Before
+ After
+ Warichu
+ Inline
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ RT
+
+
+
+
+ Start
+ Center
+ End
+ Justify
+ Distribute
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ RP
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Warichu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ WT
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ WP
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Lists
+
+ L
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ LI
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ LBody
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Index
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Tables
+
+ Table
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ THead
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TBody
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TFoot
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TR
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ TH
+
+
+
+
+
+
+
+
+
+
+ Before
+ Middle
+ After
+ Justify
+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f-ua2.rnc
index af0808b..e8c638a 100644
--- a/RelaxNG/document-pdf-ua2.rnc
+++ b/RelaxNG/document-pdf-ua2.rnc
@@ -11,6 +11,12 @@ namespace Table = "http://iso.org/pdf/ssn/Table"
namespace List = "http://iso.org/pdf/ssn/List"
namespace Artifact = "http://iso.org/pdf/ssn/Artifact"
+# XMP
+namespace x = "adobe:ns:meta/"
+namespace rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+namespace dc = "http://purl.org/dc/elements/1.1/"
+namespace pdfuaid = "http://www.aiim.org/pdfua/ns/id/"
+
# XHTML Namespace, not currently used
namespace h = "http://www.w3.org/1999/xhtml"
@@ -38,15 +44,49 @@ pdf1rolemap-Note = notAllowed?
# UA-2 Single Document element root.
start = PDF
-PDF = element NoNS:PDF {StructTreeRoot}
+PDF = element NoNS:PDF {StructTreeRoot,XMP?}
+
StructTreeRoot = element NoNS:StructTreeRoot {Document|DocumentFragment}
+
AssociatedFile = element NoNS:AssociatedFile {
attribute name {text},
(text|math)
}
+AssociatedFilemath = element NoNS:AssociatedFile {
+attribute name {text},
+(math)
+}
+AssociatedFiletext = element NoNS:AssociatedFile {
+attribute name {text},
+(text)
+}
+
+formula-requirements = (
+ attribute actualtext {text}|
+ attribute alt {text} |
+ (Lbl*,mathse) |
+ AssociatedFilemath
+)
+
+## PDF/UA-2
+pdfuaid_part = element pdfuaid:part {"2"}
+
## share with pdf1.7 version from here to end
+# XMP data
+anyelem = element * {(attribute * {text}* | text | anyelem) *}
+
+XMP = element NoNS:XMP {x_xmpmeta & anyelem*}
+
+x_xmpmeta = element x:xmpmeta {attribute * {text}*,(rdf_RDF & anyelem*)}
+
+rdf_RDF= element rdf:RDF {attribute * {text}*, (rdf_Description & anyelem*)}
+
+rdf_Description= element rdf:Description {attribute * {text}*, (pdfuaid_part & anyelem*)}
+
+# end of XMP
+
textorHTML &= (Link|Reference|Strong|Code|Em|Lbl|Span|mathse|Quote|RB|Annot|Figure|Form)*
MathMLPGlobalAttributes &= showtags-attributes
@@ -491,13 +531,29 @@ Figure = element pdf2:Figure {
}
### Formula
-
+# expanded pdf2-attributes to avoid so much backtracking
Formula = element pdf2:Formula {
- pdf2-attributes,
+ AssociatedFiletext*,
+ formula-requirements ,
+ AssociatedFiletext*,
+ (
+ attribute lang {text}?, # Lang
+ attribute expansion {text}?, # E
+ attribute title {text}?, # T
+ attribute id {text}?, # ID
+ attribute phoneme {text}?, # Phoneme
+ attribute phonetic-alphabet {text}?, # PhoneticAlphabet
+ attribute revision {text}?, # R
+ layout-attributes,
+ otherns-attributes,
+ attribute af {text}?,
+ attribute rolemapped-from {text}?,
+ attribute referenced-as {text}?,
attribute Layout:Width {text}?,
attribute Layout:Height {text}?,
(H? & Caption? & (text|Part|Div|Aside|BlockQuote|NonStruct|Private|P|Note|Code|Hn|Sub|Lbl|Em|Strong|Span|Quote|Link|Reference|Annot|Form|Ruby|Warichu|FENote|Index|L|BibEntry|Table|Figure|Formula|Artifact|
mathse)*)
+)
}
### Artifact
diff --git a/RelaxNG/document-pdf-ua2.rng b/RelaxNG/document-pdf-ua2.rng
index 14c8f16..9018e98 100644
--- a/RelaxNG/document-pdf-ua2.rng
+++ b/RelaxNG/document-pdf-ua2.rng
@@ -1,2633 +1,2792 @@
-
-
-
-
-
-
-
-
-
-
-
-
- MathML Namespace (temp actualtext moved to content element in new code)
-
-
-
-
-
-
- \s*(([\-+]?[0-9]*([0-9]\.?|\.[0-9])[0-9]*(r?em|ex|in|cm|mm|p[xtc]|Q|v[hw]|vmin|vmax|%))|0)\s*
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PDF
-
-
-
-
-
- StructTreeRoot
-
-
-
-
-
-
-
-
- AssociatedFile
-
-
-
-
-
-
-
-
- share with pdf1.7 version from here to end
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PDF structure Namespace
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Block
- Inline
- Before
- Start
- End
-
-
-
-
-
-
- LrTb
- RlTb
- TbRl
- TbLr
- LrBt
- RlBt
- BtRl
- BtLr
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Start
- Center
- End
- Justify
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Underline
- Overline
- LineThrough
-
-
-
-
-
-
- Sup
- Sub
- Normal
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- None
- Unordered
- Description
- Disc
- Circle
- Square
- Ordered
- Decimal
- UpperRoman
- LowerRoman
- UpperAlpha
- LowerAlpha
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Document Level
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Grouping
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
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-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Ruby
-
-
-
-
-
- Start
- Center
- End
- Justify
- Distribute
-
-
-
-
-
-
- Before
- After
- Warichu
- Inline
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Start
- Center
- End
- Justify
- Distribute
-
-
-
-
-
-
- Before
- After
- Warichu
- Inline
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Start
- Center
- End
- Justify
- Distribute
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Lists
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-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
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MathML Namespace (temp actualtext moved to content element in new code)
+
+
+
+
+
+
+ \s*(([\-+]?[0-9]*([0-9]\.?|\.[0-9])[0-9]*(r?em|ex|in|cm|mm|p[xtc]|Q|v[hw]|vmin|vmax|%))|0)\s*
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PDF
+
+
+
+
+
+
+
+
+ StructTreeRoot
+
+
+
+
+
+
+
+
+ AssociatedFile
+
+
+
+
+
+
+
+
+
+ AssociatedFile
+
+
+
+
+
+
+ AssociatedFile
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PDF/UA-2
+
+ 2
+
+
+
+
+ share with pdf1.7 version from here to end
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ XMP
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PDF structure Namespace
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Block
+ Inline
+ Before
+ Start
+ End
+
+
+
+
+
+
+ LrTb
+ RlTb
+ TbRl
+ TbLr
+ LrBt
+ RlBt
+ BtRl
+ BtLr
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/RelaxNG/latex-bible17.rng b/RelaxNG/latex-bible17.rng
index 3e75900..1926f63 100644
--- a/RelaxNG/latex-bible17.rng
+++ b/RelaxNG/latex-bible17.rng
@@ -1,212 +1,212 @@
-
-
-
- PDF/UA-1
-
-
-
-
- Frontmatter
-
-
- Sect
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Testament
-
-
- Sect
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Testament
-
-
- Sect
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Frontmatter-Title
-
-
- H1
-
-
-
-
-
-
-
-
-
-
-
-
- Testament-Title
-
-
- H1
-
-
-
-
-
-
-
-
-
-
-
-
- Book
-
-
- Sect
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Book-Title
-
-
- H2
-
-
-
-
-
-
-
-
-
-
-
-
- Chapter
-
-
- Sect
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Chapter-Title
-
-
-
- H3
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- verse
-
-
- P
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ PDF/UA-1
+
+
+
+
+ Frontmatter
+
+
+ Sect
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Testament
+
+
+ Sect
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Testament
+
+
+ Sect
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Frontmatter-Title
+
+
+ H1
+
+
+
+
+
+
+
+
+
+
+
+
+ Testament-Title
+
+
+ H1
+
+
+
+
+
+
+
+
+
+
+
+
+ Book
+
+
+ Sect
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Book-Title
+
+
+ H2
+
+
+
+
+
+
+
+
+
+
+
+
+ Chapter
+
+
+ Sect
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Chapter-Title
+
+
+
+ H3
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ verse
+
+
+ P
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/RelaxNG/latex-custom.rnc b/RelaxNG/latex-custom.rnc
new file mode 100644
index 0000000..6d28067
--- /dev/null
+++ b/RelaxNG/latex-custom.rnc
@@ -0,0 +1,144 @@
+namespace latexSEplay = "https://www.latex-project.org/ns/local/plays"
+namespace latexSEamse = "https://www.latex-project.org/ns/local/asmeconf"
+namespace luatexko = "https://www.latex-project.org/ns/local/luatexko"
+namespace latexSEamsej = "https://www.latex-project.org/ns/local/asmejour"
+namespace mitthesis = "https://www.latex-project.org/ns/local/mitthesis"
+
+include "latex-document.rnc"
+
+# LaTeX play
+Span |= element latexSEplay:SceneDescription {pdf2-attributes,attribute rolemaps-to {"Span"}, text}
+Strong |= element latexSEplay:Speaker {pdf2-attributes,attribute rolemaps-to {"Strong"},text}
+
+
+# asmeconf
+Div |= element latexSEamse:Conference_information {
+ showtags-attributes,
+ attribute rolemaps-to {"Div"},
+ attribute id {text}?,
+ text-unit*
+ }
+
+Div |= element latexSEamse:Author_Affiliation {
+ showtags-attributes,
+ attribute rolemaps-to {"Div"},
+ attribute id {text}?,
+ text-unit*
+ }
+
+Div|= element latexSEamse:Affiliation {
+ showtags-attributes,
+ attribute rolemaps-to {"Div"},
+ attribute id {text}?,
+ text-unit*
+ }
+
+Div |= element latexSEamsej:Author_Block {
+ showtags-attributes,
+ attribute rolemaps-to {"Div"},
+ attribute id {text}?,
+ attribute title {text}?,
+ text-unit*
+ }
+
+Div |= element latexSEamse:Paper_number {
+ showtags-attributes,
+ attribute rolemaps-to {"Div"},
+ attribute id {text}?,
+ attribute title {text}?,
+ text-unit*
+ }
+
+
+# luatexko
+
+Span |= element luatexko:StrikeOut {
+ pdf2-attributes,
+ attribute rolemaps-to {"Span"},
+ (text|Span)*
+ }
+
+Div|= element luatexko:Vertical {
+ pdf2-attributes,
+ attribute rolemaps-to {"Div"},
+ (text-unit|P)*
+ }
+
+Div|= element luatexko:Horizontal {
+ pdf2-attributes,
+ attribute rolemaps-to {"Div"},
+ (text-unit|P)*
+}
+
+## mithesis
+Div |= element mitthesis:Author{
+ showtags-attributes,
+ attribute rolemaps-to {"Div"},
+ attribute id {text}?,
+ attribute title {text}?,
+ text-unit*
+ }
+Div |= element mitthesis:Degree{
+ showtags-attributes,
+ attribute rolemaps-to {"Div"},
+ attribute id {text}?,
+ attribute title {text}?,
+ text-unit*
+ }
+Div |= element mitthesis:Copyright{
+ showtags-attributes,
+ attribute rolemaps-to {"Div"},
+ attribute id {text}?,
+ attribute title {text}?,
+ text-unit*
+ }
+
+Div |= element mitthesis:Title_sig_block{
+ showtags-attributes,
+ attribute rolemaps-to {"Div"},
+ attribute id {text}?,
+ attribute title {text}?,
+ text-unit*
+ }
+Div |= element mitthesis:Nomenclature_list{
+ showtags-attributes,
+ attribute rolemaps-to {"Div"},
+ attribute id {text}?,
+ attribute title {text}?,
+ text-unit*
+ }
+Div |= element mitthesis:Abstract_title{
+ showtags-attributes,
+ attribute rolemaps-to {"Div"},
+ attribute id {text}?,
+ attribute title {text}?,
+ text-unit*
+ }
+Div |= element mitthesis:Abstract_text{
+ showtags-attributes,
+ attribute rolemaps-to {"Div"},
+ attribute id {text}?,
+ attribute title {text}?,
+ text-unit*
+ }
+Div |= element mitthesis:Abstract_supervisor{
+ showtags-attributes,
+ attribute rolemaps-to {"Div"},
+ attribute id {text}?,
+ attribute title {text}?,
+ text-unit*
+ }
+Sect |= element mitthesis:Abstract_page{
+ showtags-attributes,
+ attribute rolemaps-to {"Sect"},
+ attribute id {text}?,
+ attribute title {text}?,
+ (Div|text-unit)*
+ }
+Span |= element mitthesis:Nomenclature_entry_heading{
+ showtags-attributes,
+ attribute rolemaps-to {"Span"},
+ attribute id {text}?,
+ attribute title {text}?,
+ (Em|Span)*
+ }
diff --git a/RelaxNG/latex-custom.rng b/RelaxNG/latex-custom.rng
new file mode 100644
index 0000000..f0a188d
--- /dev/null
+++ b/RelaxNG/latex-custom.rng
@@ -0,0 +1,320 @@
+
+
+
+
+
+
+
+
+ Span
+
+
+
+
+
+
+
+
+ Strong
+
+
+
+
+
+
+
+
+
+ Div
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Div
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Div
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Div
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Div
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Span
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Div
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Div
+
+
+
+
+
+
+
+
+
+
+ mithesis
+
+
+
+ Div
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Div
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Div
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Div
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Div
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Div
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Div
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Div
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Sect
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Span
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/RelaxNG/latex-custom17.rnc b/RelaxNG/latex-custom17.rnc
new file mode 100644
index 0000000..c21eb48
--- /dev/null
+++ b/RelaxNG/latex-custom17.rnc
@@ -0,0 +1,29 @@
+
+include "latex-document.rnc"
+
+# LaTeX play
+Span |= element SceneDescription {pdf2-attributes,attribute rolemaps-to {"Span"}, text}
+Strong |= element Speaker {pdf2-attributes,attribute rolemaps-to {"Strong"},text}
+
+
+# asmeconf
+Div |= element Conference_information {
+ showtags-attributes,
+ attribute rolemaps-to {"Div"},
+ attribute id {text}?,
+ text-unit*
+ }
+
+Div |= element Author_Affiliation {
+ showtags-attributes,
+ attribute rolemaps-to {"Div"},
+ attribute id {text}?,
+ text-unit*
+ }
+
+Div|= element Affiliation {
+ showtags-attributes,
+ attribute rolemaps-to {"Div"},
+ attribute id {text}?,
+ text-unit*
+ }
diff --git a/RelaxNG/latex-custom17.rng b/RelaxNG/latex-custom17.rng
new file mode 100644
index 0000000..e4c1ef2
--- /dev/null
+++ b/RelaxNG/latex-custom17.rng
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+ Span
+
+
+
+
+
+
+
+
+ Strong
+
+
+
+
+
+
+
+
+
+ Div
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Div
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Div
+
+
+
+
+
+
+
+
+
+
diff --git a/RelaxNG/latex-document.rnc b/RelaxNG/latex-document.rnc
index 6864ea2..afd858d 100644
--- a/RelaxNG/latex-document.rnc
+++ b/RelaxNG/latex-document.rnc
@@ -24,8 +24,12 @@ H4 |= element latexSEbook:subsubsection {attribute rolemaps-to {"H4"}, sechead.c
H5 |= element latexSEbook:paragraph {attribute rolemaps-to {"H5"}, sechead.content}
H6 |= element latexSEbook:subparagraph {attribute rolemaps-to {"H6"}, sechead.content}
+Title |= element latexSE:part {attribute rolemaps-to {"Title"}, sechead.content}
+
# This could be restricted to section headings, but for now allow where Lbl is allowed
-Lbl |= element latexSE:section-number {pdf2-attributes, attribute rolemaps-to {"Span"}, text}
+Lbl |= element latexSE:section-number {pdf2-attributes, attribute rolemaps-to {"Span"},
+ (text|Formula)*
+ }
# LaTeX NS
@@ -35,18 +39,21 @@ document.1 &= figures?
figures = element latexSE:figures {
attribute rolemaps-to {"Sect"},
attribute id {text}?,
+ showtags-attributes,
float*
}
tables = element latexSE:tables {
attribute rolemaps-to {"Sect"},
attribute id {text}?,
+ showtags-attributes,
float*
}
float = element latexSE:float {
attribute rolemaps-to {"Aside"|"Note"},
attribute id {text}?,
+ showtags-attributes,
(Caption|Part|Div|Figure|\text)*
}
@@ -55,6 +62,7 @@ float = element latexSE:float {
theorem-like = element latexSE:theorem-like {
attribute rolemaps-to {"Sect"},
attribute id {text}?,
+ showtags-attributes,
Caption?,
Lbl?,
(Part)*
@@ -65,7 +73,7 @@ Sect |= theorem-like
text-unit = element latexSE:text-unit {
attribute rolemaps-to {"Part"},
pdf2-attributes,
- (title|Title)?,(H4|H5|Div|Sect|P|Aside|Figure|Table|Formula|quote|quotation|\text|itemize|description|enumerate|verbatim|\list|Part)*}
+ (title|Title)?,Caption?,(H4|H5|Div|Sect|P|Aside|Figure|Table|Formula|quote|quotation|\text|itemize|description|enumerate|verbatim|\list|Part|FENote)*}
Part |= text-unit
verbatim = element latexSE:verbatim {
@@ -117,7 +125,7 @@ quote = element latexSE:quote {
quotation = element latexSE:quotation {
attribute rolemaps-to {"BlockQuote"},
pdf2-attributes,
- (Part)*
+ (Part|Art|Div|Sect|TOC|BlockQuote|NonStruct|Private|P|Note|Code|Hn|Title|Lbl|Link|Reference|Annot|Form|FENote|Index|L|Table|Figure|Formula|Artifact)*
}
description= element latexSE:description {
@@ -138,7 +146,7 @@ title = element latexSE:title {
\text = element latexSE:text {
attribute rolemaps-to {"P"},
pdf2-attributes,
- (text|Figure|Span|Link|Lbl|Reference|Em|Strong|FENote|Formula)*
+ (text|Figure|Span|Link|Lbl|Reference|Em|Strong|FENote|Formula|Ruby)*
}
P |= \text
@@ -152,7 +160,7 @@ Lbl |= element latexSE:footnotemark {
FENote |= element latexSE:footnote {
attribute rolemaps-to {"FENote"|"Note"},
pdf2-attributes,
- footnotelabel,(Part)*
+ footnotelabel,(Part|\text)*
}
footnotelabel = element latexSE:footnotelabel {
diff --git a/RelaxNG/latex-document.rng b/RelaxNG/latex-document.rng
index a5d3893..4929f36 100644
--- a/RelaxNG/latex-document.rng
+++ b/RelaxNG/latex-document.rng
@@ -1,421 +1,472 @@
-
-
-
- PDF/UA-2
-
-
- Default Article Namespace
-
-
- H1
-
-
-
-
-
-
-
- H2
-
-
-
-
-
-
-
- H3
-
-
-
-
-
-
-
- H4
-
-
-
-
-
-
-
- H5
-
-
-
-
-
- LaTeX Book structure Namespace
-
-
- H1
-
-
-
-
-
-
-
- H2
-
-
-
-
-
-
-
- H3
-
-
-
-
-
-
-
- H4
-
-
-
-
-
-
-
- H5
-
-
-
-
-
-
-
- H6
-
-
-
-
-
-
-
-
-
- Span
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Sect
-
-
-
-
-
-
-
-
-
-
-
-
- Sect
-
-
-
-
-
-
-
-
-
-
-
-
-
- Aside
- Note
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Sect
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Part
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- P
- Code
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Sub
- Span
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- L
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- L
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- L
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- BlockQuote
-
-
-
-
-
-
-
-
-
-
- BlockQuote
-
-
-
-
-
-
-
-
-
-
- L
-
-
-
-
-
-
-
-
-
-
-
- Title
-
-
-
-
-
-
-
-
-
-
-
-
-
- P
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Lbl
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- FENote
- Note
-
-
-
-
-
-
-
-
-
-
-
-
- Lbl
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ PDF/UA-2
+
+
+ Default Article Namespace
+
+
+ H1
+
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lbl
+
+
+
+
+
+
+
+
+
+
+
diff --git a/RelaxNG/latex-document17.rnc b/RelaxNG/latex-document17.rnc
index 776c866..5b9d0be 100644
--- a/RelaxNG/latex-document17.rnc
+++ b/RelaxNG/latex-document17.rnc
@@ -25,8 +25,12 @@ H4 |= element latexSEbook:subsubsection {attribute rolemaps-to {"H4"}, sechead.c
H5 |= element latexSEbook:paragraph {attribute rolemaps-to {"H5"}, sechead.content}
H6 |= element latexSEbook:subparagraph {attribute rolemaps-to {"H6"}, sechead.content}
+Title |= element latexSE:part {attribute rolemaps-to {"Title"}, sechead.content}
+
# This could be restricted to section headings, but for now allow where Lbl is allowed
-Lbl |= element latexSE:section-number {pdf2-attributes, attribute rolemaps-to {"Span"}, text}
+Lbl |= element latexSE:section-number {pdf2-attributes, attribute rolemaps-to {"Span"},
+ (text|Formula)*
+ }
# LaTeX NS
@@ -36,18 +40,21 @@ document.1 &= figures?
figures = element latexSE:figures {
attribute rolemaps-to {"Sect"},
attribute id {text}?,
+ showtags-attributes,
float*
}
tables = element latexSE:tables {
attribute rolemaps-to {"Sect"},
attribute id {text}?,
+ showtags-attributes,
float*
}
float = element latexSE:float {
attribute rolemaps-to {"Aside"|"Note"},
attribute id {text}?,
+ showtags-attributes,
(Caption|Part|Div|Figure|\text)*
}
@@ -56,6 +63,7 @@ float = element latexSE:float {
theorem-like = element latexSE:theorem-like {
attribute rolemaps-to {"Sect"},
attribute id {text}?,
+ showtags-attributes,
Caption?,
Lbl?,
(Part)*
@@ -66,7 +74,7 @@ Sect |= theorem-like
text-unit = element latexSE:text-unit {
attribute rolemaps-to {"Part"},
pdf2-attributes,
- (title|Title)?,(H4|H5|Div|Sect|P|Aside|Figure|Table|Formula|quote|quotation|\text|itemize|description|enumerate|verbatim|\list|Part)*}
+ (title|Title)?,Caption?,(H4|H5|Div|Sect|P|Aside|Figure|Table|Formula|quote|quotation|\text|itemize|description|enumerate|verbatim|\list|Part|FENote)*}
Part |= text-unit
verbatim = element latexSE:verbatim {
@@ -118,7 +126,7 @@ quote = element latexSE:quote {
quotation = element latexSE:quotation {
attribute rolemaps-to {"BlockQuote"},
pdf2-attributes,
- (Part)*
+ (Part|Art|Div|Sect|TOC|BlockQuote|NonStruct|Private|P|Note|Code|Hn|Title|Lbl|Link|Reference|Annot|Form|FENote|Index|L|Table|Figure|Formula|Artifact)*
}
description= element latexSE:description {
@@ -139,7 +147,7 @@ title = element latexSE:title {
\text = element latexSE:text {
attribute rolemaps-to {"P"},
pdf2-attributes,
- (text|Figure|Span|Link|Lbl|Reference|Em|Strong|FENote|Formula)*
+ (text|Figure|Span|Link|Lbl|Reference|Em|Strong|FENote|Formula|Ruby)*
}
P |= \text
@@ -153,7 +161,7 @@ Lbl |= element latexSE:footnotemark {
FENote |= element latexSE:footnote {
attribute rolemaps-to {"FENote"|"Note"},
pdf2-attributes,
- footnotelabel,(Part)*
+ footnotelabel,(Part|\text)*
}
footnotelabel = element latexSE:footnotelabel {
diff --git a/RelaxNG/latex-document17.rng b/RelaxNG/latex-document17.rng
index 53a0396..cb4e276 100644
--- a/RelaxNG/latex-document17.rng
+++ b/RelaxNG/latex-document17.rng
@@ -1,451 +1,503 @@
-
-
-
- PDF/UA-1
-
-
- Default Article Namespace
-
- section
-
- H1
-
-
-
-
-
-
- subsection
-
- H2
-
-
-
-
-
-
- subsubsection
-
- H3
-
-
-
-
-
-
- paragraph
-
- H4
-
-
-
-
-
-
- subparagraph
-
- H5
-
-
-
-
-
- LaTeX Book structure Namespace
-
- chapter
-
- H1
-
-
-
-
-
-
- section
-
- H2
-
-
-
-
-
-
- subsection
-
- H3
-
-
-
-
-
-
- subsubsection
-
- H4
-
-
-
-
-
-
- paragraph
-
- H5
-
-
-
-
-
-
- subparagraph
-
- H6
-
-
-
-
-
-
-
- section-number
-
-
- Span
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- figures
-
- Sect
-
-
-
-
-
-
-
-
-
-
-
- tables
-
- Sect
-
-
-
-
-
-
-
-
-
-
-
- float
-
-
- Aside
- Note
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- theorem-like
-
- Sect
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text-unit
-
- Part
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- verbatim
-
-
- P
- Code
-
-
-
-
-
-
-
-
-
-
-
-
-
- codeline
-
-
- Sub
- Span
-
-
-
-
-
-
-
-
-
-
-
-
-
- list
-
- L
-
-
-
-
-
-
-
-
-
-
-
-
-
- itemize
-
- L
-
-
-
-
-
-
-
-
-
-
-
-
-
- enumerate
-
- L
-
-
-
-
-
-
-
-
-
-
-
-
-
- quote
-
- BlockQuote
-
-
-
-
-
-
-
-
-
- quotation
-
- BlockQuote
-
-
-
-
-
-
-
-
-
- description
-
- L
-
-
-
-
-
-
-
-
-
-
- title
-
- Title
-
-
-
-
-
-
-
-
-
-
-
-
- text
-
- P
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- footnotemark
-
- Lbl
-
-
-
-
-
-
-
-
-
-
-
-
- footnote
-
-
- FENote
- Note
-
-
-
-
-
-
-
-
-
-
-
- footnotelabel
-
- Lbl
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ PDF/UA-1
+
+
+ Default Article Namespace
+
+ section
+
+ H1
+
+
+
+
+
+
+ subsection
+
+ H2
+
+
+
+
+
+
+ subsubsection
+
+ H3
+
+
+
+
+
+
+ paragraph
+
+ H4
+
+
+
+
+
+
+ subparagraph
+
+ H5
+
+
+
+
+
+ LaTeX Book structure Namespace
+
+ chapter
+
+ H1
+
+
+
+
+
+
+ section
+
+ H2
+
+
+
+
+
+
+ subsection
+
+ H3
+
+
+
+
+
+
+ subsubsection
+
+ H4
+
+
+
+
+
+
+ paragraph
+
+ H5
+
+
+
+
+
+
+ subparagraph
+
+ H6
+
+
+
+
+
+
+ part
+
+ Title
+
+
+
+
+
+
+
+ section-number
+
+
+ Span
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ figures
+
+ Sect
+
+
+
+
+
+
+
+
+
+
+
+
+ tables
+
+ Sect
+
+
+
+
+
+
+
+
+
+
+
+
+ float
+
+
+ Aside
+ Note
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ theorem-like
+
+ Sect
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text-unit
+
+ Part
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ verbatim
+
+
+ P
+ Code
+
+
+
+
+
+
+
+
+
+
+
+
+
+ codeline
+
+
+ Sub
+ Span
+
+
+
+
+
+
+
+
+
+
+
+
+
+ list
+
+ L
+
+
+
+
+
+
+
+
+
+
+
+
+
+ itemize
+
+ L
+
+
+
+
+
+
+
+
+
+
+
+
+
+ enumerate
+
+ L
+
+
+
+
+
+
+
+
+
+
+
+
+
+ quote
+
+ BlockQuote
+
+
+
+
+
+
+
+
+
+ quotation
+
+ BlockQuote
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ description
+
+ L
+
+
+
+
+
+
+
+
+
+
+ title
+
+ Title
+
+
+
+
+
+
+
+
+
+
+
+
+ text
+
+ P
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ footnotemark
+
+ Lbl
+
+
+
+
+
+
+
+
+
+
+
+
+ footnote
+
+
+ FENote
+ Note
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ footnotelabel
+
+ Lbl
+
+
+
+
+
+
+
+
+
+
+
diff --git a/RelaxNG/latex-mathml.rng b/RelaxNG/latex-mathml.rng
index cca7f01..f17eb2e 100644
--- a/RelaxNG/latex-mathml.rng
+++ b/RelaxNG/latex-mathml.rng
@@ -1,188 +1,188 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- scroll
-
-
-
-
-
- left
- center
- right
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- axis
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
-
-
-
-
- top
- bottom
- center
- baseline
- axis
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ scroll
+
+
+
+
+
+ left
+ center
+ right
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ axis
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ false
+
+
+
+
+
+
+ true
+ false
+
+
+
+
+
+
+
+
+
+
+
+ top
+ bottom
+ center
+ baseline
+ axis
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ false
+
+
+
+
+
+
+ true
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/RelaxNG/latex-play.rng b/RelaxNG/latex-play.rng
index eccb46b..92adaa7 100644
--- a/RelaxNG/latex-play.rng
+++ b/RelaxNG/latex-play.rng
@@ -1,22 +1,22 @@
-
-
-
-
-
-
-
- Span
-
-
-
-
-
-
-
-
- Strong
-
-
-
-
-
+
+
+
+
+
+
+
+ Span
+
+
+
+
+
+
+
+
+ Strong
+
+
+
+
+
diff --git a/RelaxNG/latex-play17.rng b/RelaxNG/latex-play17.rng
index 54b375b..8548aa1 100644
--- a/RelaxNG/latex-play17.rng
+++ b/RelaxNG/latex-play17.rng
@@ -1,22 +1,22 @@
-
-
-
-
-
-
-
- Span
-
-
-
-
-
-
-
-
- Span
-
-
-
-
-
+
+
+
+
+
+
+
+ Span
+
+
+
+
+
+
+
+
+ Span
+
+
+
+
+
diff --git a/RelaxNG/latex-test.rnc b/RelaxNG/latex-test.rnc
new file mode 100644
index 0000000..47a6931
--- /dev/null
+++ b/RelaxNG/latex-test.rnc
@@ -0,0 +1,6 @@
+ua2 = external "latex-bible.rnc"
+ua1 = external "latex-bible17.rnc"
+ua2custom = external "latex-custom.rnc"
+ua1custom = external "latex-custom17.rnc"
+talk = external "ltx-talk.rnc"
+start = ua2 | ua1 | ua2custom | ua1custom | talk
diff --git a/RelaxNG/latex-test.rng b/RelaxNG/latex-test.rng
new file mode 100644
index 0000000..0db2983
--- /dev/null
+++ b/RelaxNG/latex-test.rng
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/RelaxNG/ltx-talk.rnc b/RelaxNG/ltx-talk.rnc
index fbdf1c1..ada8cc7 100644
--- a/RelaxNG/ltx-talk.rnc
+++ b/RelaxNG/ltx-talk.rnc
@@ -1,6 +1,6 @@
namespace latexSE = "https://www.latex-project.org/ns/dflt"
-namespace latexSEtalk = "https://www.latex-project.org/ns/local/talk"
+namespace latexSEtalk = "https://www.latex-project.org/ns/local/ltx-talk"
## PDF/UA-2
@@ -12,14 +12,14 @@ include "latex-document.rnc"
Sect |= element latexSEtalk:frame {
pdf2-attributes,
attribute rolemaps-to {"Sect"},
- frametitle?,slide*}
+ frametitle?,text-unit*,slide*}
frametitle = element latexSEtalk:frametitle {
pdf2-attributes,
- attribute rolemaps-to {"H1"},
- (text|Span)*
+ attribute rolemaps-to {"H1"|"H4"},
+ (text|Formula|Span)*
}
slide = element latexSEtalk:slide {
diff --git a/RelaxNG/ltx-talk.rng b/RelaxNG/ltx-talk.rng
index c367223..5b1c6d2 100644
--- a/RelaxNG/ltx-talk.rng
+++ b/RelaxNG/ltx-talk.rng
@@ -1,49 +1,56 @@
-
-
-
- PDF/UA-2
-
-
-
-
-
-
- Sect
-
-
-
-
-
-
-
-
-
-
-
-
-
- H1
-
-
-
-
-
-
-
-
-
-
-
-
-
- Div
-
-
-
-
-
-
-
-
-
-
+
+
+
+ PDF/UA-2
+
+
+
+
+
+
+ Sect
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ H1
+ H4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Div
+
+
+
+
+
+
+
+
+
+
diff --git a/RelaxNG/mathml4-core.rng b/RelaxNG/mathml4-core.rng
index 2e5a9a5..243b7e9 100644
--- a/RelaxNG/mathml4-core.rng
+++ b/RelaxNG/mathml4-core.rng
@@ -1,973 +1,973 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/RelaxNG/mkrng b/RelaxNG/mkrng
index 328f924..d5f2837 100755
--- a/RelaxNG/mkrng
+++ b/RelaxNG/mkrng
@@ -1,6 +1,5 @@
-for i in wtpdf latex-mathml latex-document latex-document17 latex-document-switch
+for i in *.rnc
do
-java -jar trang.jar ${i}.rnc ${i}.rng
-sed -i 's/\r$//' ${i}.rng
+java -Dline.separator=$'\n' -jar trang.jar ${i} ${i/.rnc/.rng}
done
diff --git a/plantuml/plantuml.xsl b/plantuml/plantuml.xsl
new file mode 100644
index 0000000..b3c6645
--- /dev/null
+++ b/plantuml/plantuml.xsl
@@ -0,0 +1,146 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ID
+ C
+ R
+ T
+ E
+ Phoneme
+ PhoneticAlphabet
+ AF
+ Lang
+ ActualText
+ Alt
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ "
+
+
+ ...
+ "
+
+
+
+
+
+[plantuml]
+....
+'
+'
+'
+@startsalt
+skinparam lengthAdjust spacingAndGlyphs
+{
+ {T!
+
+
+
+
+
+
+
+
+
+ **...** | . | .
+
+
+
+
+ }
+}
+@endsalt
+....
+
+
+
+
+
+ +
+ **
+
+ ** |
+
+ .
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | .
+
+
+
+
+
+
+ +
+ **...** | . | .
+
+
+
+
+
+
+
+
+ +
+ **...** | . | .
+
+
+
+
+
+
diff --git a/show-pdf-tags/README.md b/show-pdf-tags/README.md
index 1cff9c8..fbe4ad7 100644
--- a/show-pdf-tags/README.md
+++ b/show-pdf-tags/README.md
@@ -1,6 +1,6 @@
# Print structure element hierarchy for Tagged PDF
-show-pdf-tags version 1.3
+show-pdf-tags version 1.4
Print a plain text or XML tree representing the structure of tagged PDF files.
@@ -23,6 +23,7 @@ Options
--xml show as XML
--table show Lua table structure
--map Follow role mapping (xml printer)
+ --xmp Include XMP XML (xml printer)
--w3c- Add - to w3c namespaces to force browser tree display
```
diff --git a/show-pdf-tags/show-pdf-tags.1 b/show-pdf-tags/show-pdf-tags.1
index 143d0f8..959c4f5 100644
--- a/show-pdf-tags/show-pdf-tags.1
+++ b/show-pdf-tags/show-pdf-tags.1
@@ -1,47 +1,49 @@
-.TH SHOW-PDF-TAGS 1 "2025-01-28" "LaTeX"
+.TH SHOW-PDF-TAGS 1 2025-01-28 LaTeX
.SH NAME
-show-pdf-tags
+show-pdf-tags \- show the internal Structure Tree of a tagged PDF file
.SH SYNOPSIS
-.B show-pdf-tags
-.RI []
-.RI
+.B show-pdf-tags
+.RI [ ]
+.I
.SH DESCRIPTION
-The \fBshow-pdf-tags\fR script shows the internal Structure Tree
+The \fBshow-pdf-tags\fR script shows the internal Structure Tree
of a tagged PDF File.
The structure may be shown using an indented tree display
using Unicode line characters, or as XML, or (primarily for debugging)
as a linearisation of the Lua table structure obtained from the PDF file.
-The XML display will use element names mmatching the names of the
-structure elements unless the \fB--map\fR option is used, in which case the
+The XML display will use element names matching the names of the
+structure elements unless the \fB\-\-map\fR option is used, in which case the
standard PDF Structure element names will be used, as specified in the
-role maping in the file.
+role mapping in the file.
It accepts a single PDF File and outputs to the standard
output stream.
Valid are:
-.NF
+.nf
.TP
- \fB--help|-h\fR Prints this message and exits
+ \fB\-\-help|-h\fR Prints this message and exits
.TP
- \fB--ignore-case\fR Ignore case when sorting directory listing
+ \fB\-\-ignore-case\fR Ignore case when sorting directory listing
.TP
- \fB--tree\fR (default) Show as tree
+ \fB\-\-tree\fR (default) Show as tree
.TP
- \fB--xml\fR Show as XML
+ \fB\-\-xml\fR Show as XML
.TP
- \fB--table\fR Show Lua table structure
+ \fB\-\-table\fR Show Lua table structure
.TP
- \fB--map\fR Follow role mapping (xml printer)
+ \fB\-\-map\fR Follow role mapping (xml printer)
.TP
- \fB--w3c-\fR Add - to w3c namespaces to force browser display
+ \fB\-\-xmp\fR Include XMP XML (xml printer)
+.TP
+ \fB\-\-w3c-\fR Add - to w3c namespaces to force browser display
.PP
.FI
@@ -53,4 +55,4 @@ Repository : https://github.com/latex3/pdf_structure
Bug tracker: https://github.com/latex3/pdf_structure/issues
.SH AUTHORS
-Copyright (C) 2024-2025 The LaTeX Project
+Copyright (C) 2024\(en2026 The LaTeX Project
diff --git a/show-pdf-tags/show-pdf-tags.lua b/show-pdf-tags/show-pdf-tags.lua
index c3bc7c0..a535811 100755
--- a/show-pdf-tags/show-pdf-tags.lua
+++ b/show-pdf-tags/show-pdf-tags.lua
@@ -1,6 +1,6 @@
#!/usr/bin/env texlua
-local show_pdf_tags_version = "1.3"
+local show_pdf_tags_version = "1.4"
kpse.set_program_name'lualatex'
@@ -12,6 +12,7 @@ end
local out_format = "tree"
local follow_rolemap = false
local hide_w3c = false
+local show_xmp = false
local pdfe = pdfe or require'pdfe'
local process_stream = require'show-pdf-tags_process_stream'
@@ -317,6 +318,7 @@ local function open(filename)
local catalog = pdfe.getcatalog(document)
local markinfo = catalog and catalog.MarkInfo
local tagged = markinfo and markinfo.Marked
+ local xmp = catalog and catalog.Metadata
if not tagged then
io.stderr:write("Document catalog has no markinfo.Marked entry. It might not be tagged.\n")
@@ -332,6 +334,8 @@ local function open(filename)
ctx.id_map = id_map
ctx.ref_entries = {}
+ ctx.xmp = xmp
+
local structroot = catalog.StructTreeRoot
if not structroot then
return {}, ctx
@@ -417,7 +421,7 @@ local function format_subtype_xml(subtype)
return string.format('<%s xmlns="%s"', subtype.subtype,
(hide_w3c and subtype.namespace:gsub('http://www.w3.org', 'http://-www.w3.org')) or subtype.namespace)
else
- return "<" .. subtype.subtype
+ return "<" .. subtype.subtype:gsub(":","_x3A_")
end
end
@@ -679,7 +683,7 @@ local function print_tree_xml(tree, ctx)
if follow_rolemap and mapped then
print(indent .. "" .. mapped.subtype ..">")
else
- print(indent .. "" .. subtype.subtype ..">")
+ print(indent .. "" .. subtype.subtype:gsub(":","_x3A_") ..">")
end
elseif #lines > 0 then
for i=1, #lines-1 do
@@ -689,7 +693,7 @@ local function print_tree_xml(tree, ctx)
if follow_rolemap and mapped then
print(indent .. "" .. mapped.subtype ..">")
else
- print(indent .. "" .. subtype.subtype ..">")
+ print(indent .. "" .. subtype.subtype:gsub(":","_x3A_") ..">")
end
end
end
@@ -697,7 +701,11 @@ local function print_tree_xml(tree, ctx)
end
print ("\n ")
recurse(tree, ' ', '', '', ' ')
- print (" \n")
+ print (" \n")
+ if show_xmp then
+ print(" \n" ..pdfe.readwholestream(ctx.xmp,true):gsub("\n[ \n]*\n","\n") .. "\n \n")
+ end
+ print ("")
return
end
@@ -712,6 +720,7 @@ Options
--xml show as XML
--table show Lua table structure
--map Follow role mapping (xml printer)
+ --xmp include XMP XML (xml printer)
--w3c- Add - to w3c namespaces to force browser tree display
]]
@@ -728,6 +737,8 @@ while argi <= #arg and arg[argi]:match("^%-") do
follow_rolemap=true
elseif arg[argi] == "--w3c-" then
hide_w3c=true
+ elseif arg[argi] == "--xmp" then
+ show_xmp=true
elseif arg[argi] == "--help" or arg[argi] == "-h" then
io.stderr:write(string.format(helpstr, arg[0]))
return