Skip to content

Commit

Permalink
correct list of standard elements, issue #92
Browse files Browse the repository at this point in the history
  • Loading branch information
u-fischer committed Jan 6, 2024
1 parent b2694d0 commit d562e48
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 31 deletions.
54 changes: 32 additions & 22 deletions doc/tagpdf.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2130,21 +2130,32 @@ \section{Standard types and new tags}\label{sec:new-tag}
\parencite{pdfspec-iso32000-1,pdfspec-iso32000-2_2020}):

\begin{enumerate}
\item The \emph{standard structure namespace for PDF 1.7}, also called
the \emph{default standard structure namespace}. The public name of
the namespace is |tag/NS/pdf|. This can be used to reference the
namespace e.g. in attributes. These are the structure names from PDF
1.7: \ExplSyntaxOn \clist_clear:N\l_tmpa_clist \prop_map_inline:cn {
g__tag_role_NS_pdf_prop } { \clist_put_right:Nn \l_tmpa_clist {#1}
} \clist_use:Nn \l_tmpa_clist {,\c_space_tl } \ExplSyntaxOff
\item The \emph{standard structure namespace for PDF 1.7}, also called
the \emph{default standard structure namespace}. The public name of
the namespace is |tag/NS/pdf|. This can be used to reference the
namespace e.g. in attributes. These are the structure names from PDF
1.7 (\texttt{StructTreeRoot} is a bit special, it is not really a structure
name but nevertheless listed here):
\ExplSyntaxOn %%
\clist_clear:N\l_tmpa_clist
\prop_map_inline:cn
{g__tag_role_NS_pdf_prop}
{
\str_if_eq:eeT
{#1}
{\use_i:nn #2}
{ \clist_put_right:Nn \l_tmpa_clist {#1} }
}
\clist_use:Nn \l_tmpa_clist {,\c_space_tl }. %%
\ExplSyntaxOff

\item The \emph{standard structure namespace for PDF 2.0}. The public
name of the namespace is |tag/NS/pdf2|. This can be used to
reference the namespace e.g. in attributes. These are more or less
same types as in PDF. The following types have been removed from
this set:\\
this set\footnote{They still can be used in a PDF 2.0 document!}:\\
%
\ExplSyntaxOn
\ExplSyntaxOn %
\clist_clear:N\l_tmpa_clist
\prop_map_inline:cn { g__tag_role_NS_pdf_prop }
{
Expand All @@ -2153,20 +2164,19 @@ \section{Standard types and new tags}\label{sec:new-tag}
{#1}
{ \clist_put_right:Nn \l_tmpa_clist {#1} }
}
\clist_use:Nn \l_tmpa_clist {,\c_space_tl }\\
\ExplSyntaxOff
\clist_use:Nn \l_tmpa_clist {,\c_space_tl },\\
\ExplSyntaxOff %
and the following are new:\\
\ExplSyntaxOn
\clist_clear:N\l_tmpa_clist
\prop_map_inline:cn { g__tag_role_NS_pdf2_prop }
{
\prop_if_in:cnF
{ g__tag_role_NS_pdf_prop }
{#1}
{ \clist_put_right:Nn \l_tmpa_clist {#1} }
}
\clist_use:Nn \l_tmpa_clist {,\c_space_tl }
\ExplSyntaxOff
\ExplSyntaxOn %
\clist_clear:N\l_tmpa_clist %
\prop_map_inline:cn { g__tag_role_NS_pdf_prop }
{
\str_if_eq:eeF {#1}
{\use_i:nn #2}
{ \clist_put_right:Nn \l_tmpa_clist {#1} }
}
\clist_use:Nn \l_tmpa_clist {,\c_space_tl }.
\ExplSyntaxOff %

\item MathML 3.0 as an \emph{other namespaces}. The public name of
the namespace is |tag/NS/mathml|. This can be used to reference the
Expand Down
1 change: 1 addition & 0 deletions tagpdf-data.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ Strong,Span,pdf,I,
%<*ns-pdf2>
%% \ProvidesExplFile {tagpdf-ns-pdf2.def} {2023-12-18} {0.98r}
%% {pdf2} {http://iso.org/pdf2/ssn}{}
StructTreeRoot,StructTreeRoot,pdf2,D,
Document,Document,pdf2,D,
Part,Part,pdf2,G,
Sect,Sect,pdf2,G,
Expand Down
3 changes: 2 additions & 1 deletion testfiles-pdftex/parent-child-20.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ TEST 15: Root: StructTreeRoot-MC no
============================================================
Package tagpdf Info: Parent-Child 'StructTreeRoot' --> 'MC'.
(tagpdf) Relation is -1 (='^^e2^^88^^85')
(tagpdf) Rolemapped from 'StructTreeRoot/pdf' --> 'MC' on line ...
(tagpdf) Rolemapped from 'StructTreeRoot/pdf2' --> 'MC' on line
(tagpdf) 109
> \l_tmpa_tl=-1.
<recently read> }
l. ... }
Expand Down
4 changes: 3 additions & 1 deletion testfiles-pdftex/show-variables-17.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ TEST 1: show tags -> NS
============================================================
The property list \g__tag_role_tags_NS_prop contains the pairs (without outer
braces):
> {StructTreeRoot} => {pdf}
> {StructTreeRoot} => {pdf2}
> {Document} => {pdf2}
> {Part} => {pdf2}
> {Sect} => {pdf2}
Expand Down Expand Up @@ -335,6 +335,7 @@ TEST 7: show tags of namespace pdf2
============================================================
The property list \g__tag_role_NS_pdf2_prop contains the pairs (without outer
braces):
> {StructTreeRoot} => {{StructTreeRoot}{}}
> {Document} => {{Document}{}}
> {Part} => {{Part}{}}
> {Sect} => {{Sect}{}}
Expand Down Expand Up @@ -572,6 +573,7 @@ TEST 13: show class of tags in namespace pdf2
============================================================
The property list \g__tag_role_NS_pdf2_class_prop contains the pairs (without
outer braces):
> {StructTreeRoot} => {--UNUSED--}
> {Document} => {--UNUSED--}
> {Part} => {--UNUSED--}
> {Sect} => {--UNUSED--}
Expand Down
4 changes: 3 additions & 1 deletion testfiles-pdftex/show-variables-20.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ TEST 1: show tags -> NS
============================================================
The property list \g__tag_role_tags_NS_prop contains the pairs (without outer
braces):
> {StructTreeRoot} => {pdf}
> {StructTreeRoot} => {pdf2}
> {Document} => {pdf2}
> {Part} => {pdf2}
> {Sect} => {pdf2}
Expand Down Expand Up @@ -673,6 +673,7 @@ TEST 6: show tags of namespace pdf2
============================================================
The property list \g__tag_role_NS_pdf2_prop contains the pairs (without outer
braces):
> {StructTreeRoot} => {{StructTreeRoot}{pdf2}}
> {Document} => {{Document}{pdf2}}
> {Part} => {{Part}{pdf2}}
> {Sect} => {{Sect}{pdf2}}
Expand Down Expand Up @@ -1070,6 +1071,7 @@ TEST 13: show class of tags in namespace pdf2
============================================================
The property list \g__tag_role_NS_pdf2_class_prop contains the pairs (without
outer braces):
> {StructTreeRoot} => {D}
> {Document} => {D}
> {Part} => {G}
> {Sect} => {G}
Expand Down
6 changes: 3 additions & 3 deletions testfiles/mc-parent-child.luatex.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ Package tagpdf Info: Parent-Child 'Document' --> 'Part'.
(tagpdf) line 17
Package tagpdf Info: Parent-Child 'Document' --> 'StructTreeRoot'.
(tagpdf) Relation is 0 (='unknown')
(tagpdf) Rolemapped from 'Document/pdf2' --> 'StructTreeRoot/pdf'
(tagpdf) Rolemapped from 'Document/pdf2' --> 'StructTreeRoot/pdf2'
(tagpdf) on line ...
Package tagpdf Info: Parent-Child 'StructTreeRoot' --> 'MC'.
(tagpdf) Relation is -1 (='∅')
(tagpdf) Rolemapped from 'StructTreeRoot/pdf' --> 'MC' on line ...
Package tagpdf Warning: Parent-Child 'StructTreeRoot/pdf' --> 'MC
(tagpdf) Rolemapped from 'StructTreeRoot/pdf2' --> 'MC' on line ...
Package tagpdf Warning: Parent-Child 'StructTreeRoot/pdf2' --> 'MC
(tagpdf) (realcontent)'.
(tagpdf) Relation is not allowed (struct 3, /StructTreeRoot) on
(tagpdf) line 17
Expand Down
6 changes: 3 additions & 3 deletions testfiles/mc-parent-child.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ Package tagpdf Info: Parent-Child 'Document' --> 'Part'.
(tagpdf) line 17
Package tagpdf Info: Parent-Child 'Document' --> 'StructTreeRoot'.
(tagpdf) Relation is 0 (='unknown')
(tagpdf) Rolemapped from 'Document/pdf2' --> 'StructTreeRoot/pdf'
(tagpdf) Rolemapped from 'Document/pdf2' --> 'StructTreeRoot/pdf2'
(tagpdf) on line ...
Package tagpdf Info: Parent-Child 'StructTreeRoot' --> 'MC'.
(tagpdf) Relation is -1 (='^^e2^^88^^85')
(tagpdf) Rolemapped from 'StructTreeRoot/pdf' --> 'MC' on line ...
Package tagpdf Warning: Parent-Child 'StructTreeRoot/pdf' --> 'MC
(tagpdf) Rolemapped from 'StructTreeRoot/pdf2' --> 'MC' on line ...
Package tagpdf Warning: Parent-Child 'StructTreeRoot/pdf2' --> 'MC
(tagpdf) (realcontent)'.
(tagpdf) Relation is not allowed (struct 3, /StructTreeRoot) on
(tagpdf) line 17
Expand Down

0 comments on commit d562e48

Please sign in to comment.