<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Frank Seitz - Developer Logbuch - Perl</title>
    <link>http://fseitz.de/blog/</link>
    <description>Notizen aus der Welt der Programmierung und Administration</description>
    <dc:language>de</dc:language>
    <generator>Serendipity 1.5.1 - http://www.s9y.org/</generator>
    <pubDate>Thu, 05 Mar 2026 14:13:13 GMT</pubDate>

    <image>
        <url>http://fseitz.de/blog/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: Frank Seitz - Developer Logbuch - Perl - Notizen aus der Welt der Programmierung und Administration</title>
        <link>http://fseitz.de/blog/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Mojolicious: Formularvalidierung in Webanwendung</title>
    <link>http://fseitz.de/blog/index.php?/archives/184-Mojolicious-Formularvalidierung-in-Webanwendung.html</link>
            <category>Mojolicious</category>
            <category>Perl</category>
    
    <comments>http://fseitz.de/blog/index.php?/archives/184-Mojolicious-Formularvalidierung-in-Webanwendung.html#comments</comments>
    <wfw:comment>http://fseitz.de/blog/wfwcomment.php?cid=184</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://fseitz.de/blog/rss.php?version=2.0&amp;type=comments&amp;cid=184</wfw:commentRss>
    

    <author>nospam@example.com (Frank Seitz)</author>
    <content:encoded>
    &lt;p class=&quot;sdoc-fig-p&quot;&gt;
  &lt;a href=&quot;https://mojolicious.org/&quot;&gt;&lt;img class=&quot;sdoc-fig-img&quot; src=&quot;http://fseitz.de/blog/uploads/mojolicious-logo-386x90.png&quot; width=&quot;189&quot; height=&quot;44&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p class=&quot;sdoc-fig-p&quot;&gt;
  &lt;a href=&quot;https://www.perl.org&quot;&gt;&lt;img class=&quot;sdoc-fig-img&quot; src=&quot;http://fseitz.de/blog/uploads/perl-130x65.png&quot; width=&quot;104&quot; height=&quot;50&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  In einer Webanwendung, die Daten über Formulare pflegt/verwaltet, ist es
  essentiell, die Eingabedaten vor der Speicherung akribisch zu prüfen.
&lt;/p&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Im Falle einer Regelverletzung wird mit einer aussagekräftigen Fehlermeldung
  zum ausgefüllten Formular zurückgekehrt und auf das betreffende Eingabefeld
  positioniert (also der Eingabefokus gesetzt).
&lt;/p&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Wie lässt sich dies effektiv erreichen?
&lt;/p&gt;
&lt;ul class=&quot;sdoc-list-ul&quot;&gt;
  &lt;li class=&quot;sdoc-list-li-point&quot; style=&quot;list-style-type:disc&quot;&gt;
    &lt;p class=&quot;sdoc-para-p&quot;&gt;
      Die Prüfmethoden sind in der Klasse Quiq::Assert enthalten
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li class=&quot;sdoc-list-li-point&quot; style=&quot;list-style-type:disc&quot;&gt;
    &lt;p class=&quot;sdoc-para-p&quot;&gt;
      Wir führen die Tests in einem eval-Block durch
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li class=&quot;sdoc-list-li-point&quot; style=&quot;list-style-type:disc&quot;&gt;
    &lt;p class=&quot;sdoc-para-p&quot;&gt;
      Im Falle einer Regelverletzung wird eine Exception ausgelöst, der Prüfblock
      sofort verlassen und mit Fehlermeldung zum Formular zurückgekehrt
    &lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;sdoc-code-div&quot;&gt;
  &lt;pre class=&quot;sdoc-code-pre&quot;&gt;if ($aktion eq &#039;Speichern&#039;) {&amp;#10;    my $field;&amp;#10;    eval {&amp;#10;        my $val;&amp;#10;&amp;#10;        my $a = Quiq::Assert-&amp;gt;new;&amp;#10;&amp;#10;        $field = &#039;NAME1&#039;;&amp;#10;        $val = $self-&amp;gt;param($field)&amp;#10;        if (!$a-&amp;gt;METHOD1($val)) {&amp;#10;            die &quot;FEHLER: $field verletzt METHOD1\n&quot;;&amp;#10;        }&amp;#10;        if (!$a-&amp;gt;METHOD2($val)) {&amp;#10;            die &quot;FEHLER: $field verletzt METHOD2\n&quot;;&amp;#10;        }&amp;#10;        ...&amp;#10;        $field = &#039;NAME2&#039;;&amp;#10;        $val = $self-&amp;gt;param($field);&amp;#10;        if (!$a-&amp;gt;METHOD3($val)) {&amp;#10;            die &quot;FEHLER: $field verletzt METHOD3\n&quot;;&amp;#10;        }&amp;#10;    };&amp;#10;    if ($@) {&amp;#10;        $@ =~ s/\n$//;&amp;#10;        my $url = &#039;/FORMULAR?&#039;.&quot;navMsg=$@&amp;amp;navFocus=$field&amp;amp;&quot;.&amp;#10;            $self-&amp;gt;req-&amp;gt;params-&amp;gt;to_string;&amp;#10;        $self-&amp;gt;redirect_to($url);&amp;#10;        return;&amp;#10;    }&amp;#10;    ...&amp;#10;}&lt;/pre&gt;
&lt;/div&gt;
 
    </content:encoded>

    <pubDate>Sun, 15 Feb 2026 22:20:57 +0100</pubDate>
    <guid isPermaLink="false">http://fseitz.de/blog/index.php?/archives/184-guid.html</guid>
    
</item>
<item>
    <title>Perl: XML-Template mit XML::Compile generieren</title>
    <link>http://fseitz.de/blog/index.php?/archives/183-Perl-XML-Template-mit-XMLCompile-generieren.html</link>
            <category>Perl</category>
    
    <comments>http://fseitz.de/blog/index.php?/archives/183-Perl-XML-Template-mit-XMLCompile-generieren.html#comments</comments>
    <wfw:comment>http://fseitz.de/blog/wfwcomment.php?cid=183</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://fseitz.de/blog/rss.php?version=2.0&amp;type=comments&amp;cid=183</wfw:commentRss>
    

    <author>nospam@example.com (Frank Seitz)</author>
    <content:encoded>
    &lt;p class=&quot;sdoc-fig-p&quot;&gt;
  &lt;a href=&quot;https://www.perl.org&quot;&gt;&lt;img class=&quot;sdoc-fig-img&quot; src=&quot;http://fseitz.de/blog/uploads/perl-130x65.png&quot; width=&quot;104&quot; height=&quot;50&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Mit der Methode &lt;tt class=&quot;sdoc-seg-c&quot;&gt;$sch-&amp;gt;template()&lt;/tt&gt; der Klasse &lt;a class=&quot;sdoc-seg-u&quot; href=&quot;XML::Compile::Schema&quot;&gt;XML::Compile::Schema&lt;/a&gt;
  kann ein XML-Template zu einer gegebenen Schemadefinition generiert werden
  (Anwendungsfall s. &lt;a class=&quot;sdoc-seg-u&quot; href=&quot;http://fseitz.de/blog/index.php?/archives/182-XML-Erzeugung-von-komplexem-XML.html&quot;&gt;XML: Erzeugung von komplexem XML&lt;/a&gt;).
&lt;/p&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Beispiel:
&lt;/p&gt;
&lt;div class=&quot;sdoc-code-div&quot;&gt;
  &lt;pre class=&quot;sdoc-code-pre&quot;&gt;$ perl -MQuiq::Zugferd -E &#039;say Quiq::Zugferd-&amp;gt;createTemplate(&quot;ZF24_DE/Schema/3_Factur-X_1.08_EN16931&quot;)&#039;&lt;/pre&gt;
&lt;/div&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Die aktuelle Implementierung von &lt;tt class=&quot;sdoc-seg-c&quot;&gt;XML::Compile&lt;/tt&gt; hat jedoch leider das Defizit,
  dass mehrfach auftretende XML-Konstrukte &lt;tt class=&quot;sdoc-seg-c&quot;&gt;&amp;lt;ELEMENT&amp;gt;...&amp;lt;/ELEMENT&amp;gt;&lt;/tt&gt; ab dem
  zweiten Auftreten abgekürzt werden zu &lt;tt class=&quot;sdoc-seg-c&quot;&gt;&amp;lt;ELEMENT/&amp;gt;&lt;/tt&gt;. Dies macht die Nutzung des
  Templates leider weitgehend unbrauchbar.
&lt;/p&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Mit einem kleinen Patch lässt sich dies jedoch beheben. Das unerwünschte
  Verhalten unterbleibt, wenn in &lt;tt class=&quot;sdoc-seg-c&quot;&gt;Compile/Translate/Template.pm&lt;/tt&gt; die Zeile
&lt;/p&gt;
&lt;div class=&quot;sdoc-code-div&quot;&gt;
  &lt;pre class=&quot;sdoc-code-pre&quot;&gt;$reuse_type{$type}++;   $reuse_tag{$tag}++;&lt;/pre&gt;
&lt;/div&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  auskommentiert wird.
&lt;/p&gt;

&lt;h1 class=&quot;sdoc-sec-h1&quot;&gt;Links&lt;/h1&gt;
&lt;ul class=&quot;sdoc-list-ul&quot;&gt;
  &lt;li class=&quot;sdoc-list-li-point&quot; style=&quot;list-style-type:disc&quot;&gt;&lt;a class=&quot;sdoc-seg-u&quot; href=&quot;https://metacpan.org/dist/XML-Compile&quot;&gt;XML::Compile&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
 
    </content:encoded>

    <pubDate>Sun, 11 Jan 2026 15:54:35 +0100</pubDate>
    <guid isPermaLink="false">http://fseitz.de/blog/index.php?/archives/183-guid.html</guid>
    
</item>
<item>
    <title>XML: Erzeugung von komplexem XML</title>
    <link>http://fseitz.de/blog/index.php?/archives/182-XML-Erzeugung-von-komplexem-XML.html</link>
            <category>Perl</category>
            <category>XML</category>
    
    <comments>http://fseitz.de/blog/index.php?/archives/182-XML-Erzeugung-von-komplexem-XML.html#comments</comments>
    <wfw:comment>http://fseitz.de/blog/wfwcomment.php?cid=182</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://fseitz.de/blog/rss.php?version=2.0&amp;type=comments&amp;cid=182</wfw:commentRss>
    

    <author>nospam@example.com (Frank Seitz)</author>
    <content:encoded>
    &lt;p class=&quot;sdoc-fig-p&quot;&gt;
  &lt;a href=&quot;https://www.w3.org/XML/&quot;&gt;&lt;img class=&quot;sdoc-fig-img&quot; src=&quot;http://fseitz.de/blog/uploads/xml-480x512.png&quot; height=&quot;60&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Ausgangslage: Wir möchten hochstrukturierte XML-Dateien erzeugen,
  beispielsweise E-Rechnungen nach den Standards ZUGFeRD und XRechnung.
&lt;/p&gt;

&lt;h1 class=&quot;sdoc-sec-h1&quot;&gt;Ablauf&lt;/h1&gt;
&lt;ol class=&quot;sdoc-list-ol&quot;&gt;
  &lt;li class=&quot;sdoc-list-li-num&quot;&gt;
    &lt;p class=&quot;sdoc-para-p&quot;&gt;
      Einlesen des betreffenden XML-Templates mit Platzhaltern
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li class=&quot;sdoc-list-li-num&quot;&gt;
    &lt;p class=&quot;sdoc-para-p&quot;&gt;
      Wandlung des XML-Templates in eine hierarchische Datenstruktur der
      Programmiersprache (XML-Baum)
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li class=&quot;sdoc-list-li-num&quot;&gt;
    &lt;p class=&quot;sdoc-para-p&quot;&gt;
      Ersetzen der Platzhalter im XML-Baum durch konrete Werte
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li class=&quot;sdoc-list-li-num&quot;&gt;
    &lt;p class=&quot;sdoc-para-p&quot;&gt;
      Entfernen aller unersetzten Platzhalter
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li class=&quot;sdoc-list-li-num&quot;&gt;
    &lt;p class=&quot;sdoc-para-p&quot;&gt;
      Entfernen aller leeren Knoten des Baums (rekursiv)
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li class=&quot;sdoc-list-li-num&quot;&gt;
    &lt;p class=&quot;sdoc-para-p&quot;&gt;
      Wandeln des resultierenden Baums in XML-Code
    &lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h1 class=&quot;sdoc-sec-h1&quot;&gt;XML::Compile&lt;/h1&gt;
&lt;p class=&quot;sdoc-para-p&quot;&gt;
  Als wichtigstes Hilfsmittel zur Durchführung der Aufgabe verwenden wir das
  Perl-Package &lt;a class=&quot;sdoc-seg-u&quot; href=&quot;https://metacpan.org/dist/XML-Compile&quot;&gt;XML::Compile&lt;/a&gt;. Es leistet (unter Rückgriff auf die
  betreffende XML Schemadefinition) Folgendes:
&lt;/p&gt;
&lt;ul class=&quot;sdoc-list-ul&quot;&gt;
  &lt;li class=&quot;sdoc-list-li-point&quot; style=&quot;list-style-type:disc&quot;&gt;
    &lt;p class=&quot;sdoc-para-p&quot;&gt;
      Es generiert ein XML-Template zur Schemadefinition
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li class=&quot;sdoc-list-li-point&quot; style=&quot;list-style-type:disc&quot;&gt;
    &lt;p class=&quot;sdoc-para-p&quot;&gt;
      Es übersetzt XML-Code (z.B. das Template) in eine Datenstruktur (XML-Baum),
      die mit Mitteln der Programmiersprache (Perl) bearbeitet werden kann
    &lt;/p&gt;
  &lt;/li&gt;
  &lt;li class=&quot;sdoc-list-li-point&quot; style=&quot;list-style-type:disc&quot;&gt;
    &lt;p class=&quot;sdoc-para-p&quot;&gt;
      Es rückübersetzt den finalen XML-Baum in XML-Code
    &lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;
 
    </content:encoded>

    <pubDate>Sun, 11 Jan 2026 18:52:00 +0100</pubDate>
    <guid isPermaLink="false">http://fseitz.de/blog/index.php?/archives/182-guid.html</guid>
    
</item>

</channel>
</rss>