% !Mode:: "TeX:DE:UTF-8:Main"
\DocumentMetadata{tagging=on,pdfversion=2.0,lang=de-DE}
\tagpdfsetup{tabsorder=structure}

\documentclass{article}

\usepackage{iftex}

\ifluatex
  \usepackage{fontspec}
  \usepackage{unicode-math}
  \usepackage{luacode}
  \newfontface\zerowidthfont{freeserif}
\else
  \usepackage[T1]{fontenc}
\fi

\usepackage{graphicx}
\begin{filecontents}{example-input-file.tex}
Additional info!
\end{filecontents}

\begin{document}
\pagestyle{empty}
\tagpdfparaOff %we don't want to nest paragraphs ...

\ExplSyntaxOn

\pdffile_embed_file:nnn{example-input-file.tex}{}{tag/AFtest}

%change AFRelationship
\pdfdict_put:nnn {l_pdffile/Filespec} {AFRelationship}{/Supplement}

\ExplSyntaxOff
\def\testtext{Bär with teh shirt}
\tagstructbegin{tag=P,AFinline-o=\testtext}
  \tagmcbegin{tag=P}
   Ein Satz ohne Umlaute.
  \tagmcend
\tagstructend

\tagstructbegin{tag=P,AFinline=Duck}
  \tagmcbegin{tag=P}
   Ein Satz ohne Umlaute.
  \tagmcend
\tagstructend

\tagstructbegin{tag=P,AF=tag/AFtest}
  \tagmcbegin{tag=P}
   Ein Satz ohne Umlaute.
  \tagmcend
\tagstructend

\end{document} 