Skip to content

Commit

Permalink
add test for schema in property
Browse files Browse the repository at this point in the history
  • Loading branch information
u-fischer committed Sep 13, 2024
1 parent 75ebd5a commit d97a5ba
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions l3pdfmeta.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -1471,7 +1471,8 @@
% \end{macrocode}
% \subsection{Messages}
% \begin{macrocode}
\msg_new:nnn{pdfmeta}{namespace-defined}{The~#1~`#2`~is~already~declared}
\msg_new:nnn{pdfmeta}{xmp-defined}{The~XMP~#1~`#2`~is~already~declared}
\msg_new:nnn{pdfmeta}{xmp-undefined}{The~XMP~#1~`#2`~is~undefined}
\msg_new:nnn{pdfmeta}{colorprofile-undefined}{The~colorprofile~`#1`~is~unknown}
% \end{macrocode}
% \subsection{Some helper commands}
Expand Down Expand Up @@ -2067,7 +2068,7 @@
{
\tl_if_exist:cTF { g_@@_xmp_schema_#2_tl }
{
\msg_warning:nnnn{pdfmeta}{namespace-defined}{schema}{#2}
\msg_warning:nnnn{pdfmeta}{xmp-defined}{schema}{#2}
}
{
\seq_put_right:Nn \l_@@_xmp_schema_seq { #2 }
Expand Down Expand Up @@ -2101,19 +2102,25 @@
\cs_new_protected:Npn \@@_xmp_property_new:nnnnn #1 #2 #3 #4 #5 %
%#1 schema #2 name, #3 type, #4 category #5 description
{
\prop_get:NeNF \g_@@_xmp_schema_property_prop {#1:#2}\l_@@_tmpa_tl
\tl_if_exist:cTF { g_@@_xmp_schema_#1_properties_tl }
{
\prop_gput:Nee \g_@@_xmp_schema_property_prop {#1:#2}{#3}
\tl_gput_right:cn { g_@@_xmp_schema_#1_properties_tl }
{
\@@_xmp_add_packet_open:nn {rdf}{li~rdf:parseType="Resource"}
\@@_xmp_add_packet_line:nnn {pdfaProperty}{name}{#2}
\@@_xmp_add_packet_line:nnn {pdfaProperty}{valueType}{#3}
\@@_xmp_add_packet_line:nnn {pdfaProperty}{category}{#4}
\@@_xmp_add_packet_line:nnn {pdfaProperty}{description}{#5}
\@@_xmp_add_packet_close:nn{rdf}{li}
\prop_get:NeNF \g_@@_xmp_schema_property_prop {#1:#2}\l_@@_tmpa_tl
{
\prop_gput:Nee \g_@@_xmp_schema_property_prop {#1:#2}{#3}
\tl_gput_right:cn { g_@@_xmp_schema_#1_properties_tl }
{
\@@_xmp_add_packet_open:nn {rdf}{li~rdf:parseType="Resource"}
\@@_xmp_add_packet_line:nnn {pdfaProperty}{name}{#2}
\@@_xmp_add_packet_line:nnn {pdfaProperty}{valueType}{#3}
\@@_xmp_add_packet_line:nnn {pdfaProperty}{category}{#4}
\@@_xmp_add_packet_line:nnn {pdfaProperty}{description}{#5}
\@@_xmp_add_packet_close:nn{rdf}{li}
}
}
}
}
{
\msg_warning:nnnn{pdfmeta}{xmp-undefined}{schema}{#1}
}
}
% \end{macrocode}
% \end{macro}
Expand Down Expand Up @@ -3017,7 +3024,7 @@
\cs_new_protected:Npn \pdfmeta_xmp_xmlns_new:nn #1 #2
{
\prop_if_in:NnTF \g_@@_xmp_xmlns_prop {#1}
{\msg_warning:nnnn{pdfmeta}{namespace-defined}{xmlns~namespace}{#1}}
{\msg_warning:nnnn{pdfmeta}{xmp-defined}{xmlns~namespace}{#1}}
{\@@_xmp_xmlns_new:nn {#1}{#2}}
}
% \end{macrocode}
Expand Down

0 comments on commit d97a5ba

Please sign in to comment.