<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- $Id$ -->
<testcase>
  <info>
    <p>
      This test checks the AFP extension. The extension attachments need to show
      up in the area tree XML so the AreaTreeParser can fully restore the area tree.
    </p>
  </info>
  <fo>
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
        xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp">
      <fo:layout-master-set>
        <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
          <afp:include-page-overlay name="O1SAMP1 "/>
          <afp:include-page-segment name="S1ISLOGO" src="../../resources/images/bgimg300dpi.jpg"/>
          <afp:tag-logical-element name="The TLE Name" value="The TLE Value"/>
          <afp:no-operation name="My NOP">insert up to 32k of character data here!</afp:no-operation>
          <fo:region-body/>
        </fo:simple-page-master>
      </fo:layout-master-set>
      <fo:page-sequence master-reference="normal" afp:test-ignore="this">
        <afp:invoke-medium-map name="MYMAP"/>
        <fo:flow flow-name="xsl-region-body">
          <fo:block>Text on page <fo:page-number/>.</fo:block>
          <fo:block break-before="page">Text on page <fo:page-number/>.</fo:block>
        </fo:flow>
      </fo:page-sequence>
    </fo:root>
  </fo>
  <checks xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp">
    <eval expected="4" xpath="count(/areaTree/pageSequence/pageViewport[@nr=1]/page/extension-attachments/child::*)"/>
    <eval expected="O1SAMP1 " xpath="/areaTree/pageSequence/pageViewport[@nr=1]/page/extension-attachments/child::*[1]/@name"/>
    <eval expected="S1ISLOGO" xpath="/areaTree/pageSequence/pageViewport[@nr=1]/page/extension-attachments/child::*[2]/@name"/>
    <eval expected="The TLE Name" xpath="/areaTree/pageSequence/pageViewport[@nr=1]/page/extension-attachments/child::*[3]/@name"/>
    <eval expected="The TLE Value" xpath="/areaTree/pageSequence/pageViewport[@nr=1]/page/extension-attachments/child::*[3]/@value"/>
    <eval expected="My NOP" xpath="/areaTree/pageSequence/pageViewport[@nr=1]/page/extension-attachments/child::*[4]/@name"/>
    
    <eval expected="4" xpath="count(/areaTree/pageSequence/pageViewport[@nr=2]/page/extension-attachments/child::*)"/>
    
    <eval expected="1" xpath="count(/areaTree/pageSequence/extension-attachments)"/>
    <eval expected="MYMAP" xpath="/areaTree/pageSequence/extension-attachments/child::*[1]/@name"/>
    
    <!-- This just tests if extension attributes make it through to the PageSequence object. -->
    <eval expected="this" xpath="/areaTree/pageSequence/@afp:test-ignore"/>
  </checks>
  <if-checks xmlns:if="http://xmlgraphics.apache.org/fop/intermediate"
        xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp">
    <eval expected="this" xpath="//if:page-sequence/@afp:test-ignore"/>
    <eval expected="MYMAP" xpath="//if:page-sequence/afp:invoke-medium-map/@name"/>
  </if-checks><commit_msg>Fixed small mistake I noticed too late: extension attachments don't use the same namespace as the FO extensions.<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- $Id$ -->
<testcase>
  <info>
    <p>
      This test checks the AFP extension. The extension attachments need to show
      up in the area tree XML so the AreaTreeParser can fully restore the area tree.
    </p>
  </info>
  <fo>
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
        xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp">
      <fo:layout-master-set>
        <fo:simple-page-master master-name="normal" page-width="5in" page-height="5in">
          <afp:include-page-overlay name="O1SAMP1 "/>
          <afp:include-page-segment name="S1ISLOGO" src="../../resources/images/bgimg300dpi.jpg"/>
          <afp:tag-logical-element name="The TLE Name" value="The TLE Value"/>
          <afp:no-operation name="My NOP">insert up to 32k of character data here!</afp:no-operation>
          <fo:region-body/>
        </fo:simple-page-master>
      </fo:layout-master-set>
      <fo:page-sequence master-reference="normal" afp:test-ignore="this">
        <afp:invoke-medium-map name="MYMAP"/>
        <fo:flow flow-name="xsl-region-body">
          <fo:block>Text on page <fo:page-number/>.</fo:block>
          <fo:block break-before="page">Text on page <fo:page-number/>.</fo:block>
        </fo:flow>
      </fo:page-sequence>
    </fo:root>
  </fo>
  <checks xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp">
    <eval expected="4" xpath="count(/areaTree/pageSequence/pageViewport[@nr=1]/page/extension-attachments/child::*)"/>
    <eval expected="O1SAMP1 " xpath="/areaTree/pageSequence/pageViewport[@nr=1]/page/extension-attachments/child::*[1]/@name"/>
    <eval expected="S1ISLOGO" xpath="/areaTree/pageSequence/pageViewport[@nr=1]/page/extension-attachments/child::*[2]/@name"/>
    <eval expected="The TLE Name" xpath="/areaTree/pageSequence/pageViewport[@nr=1]/page/extension-attachments/child::*[3]/@name"/>
    <eval expected="The TLE Value" xpath="/areaTree/pageSequence/pageViewport[@nr=1]/page/extension-attachments/child::*[3]/@value"/>
    <eval expected="My NOP" xpath="/areaTree/pageSequence/pageViewport[@nr=1]/page/extension-attachments/child::*[4]/@name"/>
    
    <eval expected="4" xpath="count(/areaTree/pageSequence/pageViewport[@nr=2]/page/extension-attachments/child::*)"/>
    
    <eval expected="1" xpath="count(/areaTree/pageSequence/extension-attachments)"/>
    <eval expected="MYMAP" xpath="/areaTree/pageSequence/extension-attachments/child::*[1]/@name"/>
    
    <!-- This just tests if extension attributes make it through to the PageSequence object. -->
    <eval expected="this" xpath="/areaTree/pageSequence/@afp:test-ignore"/>
  </checks>
  <if-checks xmlns:if="http://xmlgraphics.apache.org/fop/intermediate"
        xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp">
    <eval expected="this" xpath="//if:page-sequence/@afp:test-ignore"/>
    <eval expected="MYMAP" xpath="//if:page-sequence/afp:invoke-medium-map/@name" xmlns:afp="apache:fop:extensions:afp"/>
  </if-checks>
{'fraction_non_alphanumeric': 0.15667486727955457, 'fraction_numerical': 0.010617635633821053, 'mean_word_length': 3.851758793969849, 'pattern_counts': {'":': 0, '<': 103, '<?xml version=': 2, '>': 103, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 21}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2366039', 'n_tokens_mistral': 2443, 'n_tokens_neox': 2405, 'n_words': 543}