<?xml version="1.0" encoding="utf-8"?><article xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0-subset Balisage-1.5">
    <title>Making Hierarchy Out Of Nothing At All</title>
    <subtitle>Federal Register Data Modernization</subtitle>
    <info>
    <confgroup>
      <conftitle>Balisage: The Markup Conference 2026</conftitle>
      <confdates>August 3-7, 2026</confdates>
   </confgroup>
        <abstract>
            <para> The Federal Register articles are received at the Government Publishing Office
                (GPO) as Word files. The Word files have some in-line SGML (Standard Generalized
                Markup Language) tags which get converted to plain text. An intermediate process
                converts the Word file to XML with a root element with child elements &lt;p&gt;,
                &lt;table&gt; and &lt;list&gt;.</para>
            <para>This paper will describe my approach for creating hierachical XML out of a flat
                XML file.  I will talk about some of the challenges I encountered.</para>
        </abstract>
        <author>
            <personname>
                <firstname>Betty</firstname>
                <surname>Harvey</surname>
            </personname>
            <personblurb>
                <para>As President of Electronic Commerce Connection, Inc. since 1995, Ms. Harvey
                    has led many federal government and commercial enterprises in planning and
                    executing their migration to the use of structured information for their
                    critical functions. She has helped develop strategic XML solutions for her
                    clients. Ms. Harvey has been instrumental in developing industry XML standards.
                    She is the co-author of "Professional ebXML Foundations" published by Wrox. Ms.
                    Harvey was a member of "The XML Guild" and was a coauthor of the book "Advanced
                    XML Applications From the Experts at The XML Guild" published by Thomson. </para>
            </personblurb>
        </author>
<legalnotice><para>Copyright © 2026 by the author. Used with permission.</para></legalnotice>
    </info>
    <section>
        <title>Introduction</title>
        <para>The production of the Federal Register is undergoing a modernization process to help
            streamline the current processes. Each federal agency provides input into the Federal
            Register in Microsoft Word file. A SGML Document Type Definition (DTD) was originally
            developed in 1993. The original SGML DTD, with updates is still in use today in
            production of the Federal Register.</para>
        <para>As part of an overall legislative modernization effort the United States Legislature
            has developed and is continuing to develop a standard XML markup language designed to
            handle all legislative material, Bill, Resolutions, Amendments, U.S. Code, Congressional
            Record, Federal Register, etc. Ultimately in the future all legislative documents will
            be available in <emphasis role="bold">United States
                Legislative Markup</emphasis> (USLM) format. [<xref linkend="bharvey-uslm1"/>]</para>
        <para><emphasis role="bold">USLM</emphasis> has a publically available schema and sample
            documents in USLM. [<xref linkend="bharvey-uslm2"/>] The Federal Register is currently
            being modelled in USLM but these documents aren't publically available at the time of
            this paper. </para>
        <para>This paper will describe some of the efforts for modernization of data and processes
            related to the Federal Register. </para>
    </section>
    <section>
        <title>Federal Register and Microsoft® Word</title>
        <para>Federal agencies send the Office of the Federal Register (OFR) their articles to be
            included in the Federal Register in Word format. The Federal Register is published
            daily. Agencies use in-line SGML tags in the Word file to identify pieces of
            information. Appoximately 20% of the data contains SGML tags. In the example below the
            agency, sub-agency, department document number (&lt;DEPDOC&gt;), and subject have been
            identified as tags. These correspond to specific information in the document. </para>
        <para>The Federal Register has 2 major hierarchy, PREAMB (heading and metadata information)
            and SUPPLEMENTARY INFORMATION.  The PREAMB always has an opening tag.  The SUPPLEMENTARY
            INFORMATION almost never has a tag.  When a tag is not available the conversion has to
            rely on heading and regular expressions to identify the structure.</para>
        <para>The average size of the a Federal Register article is probably 10 pages or less.
            However, there are some articles that are 500 or more pages.</para>
        <para>The paragraphs with bolded headings without elements are also components in the DTD
            that require tagging.</para>
        <figure xml:id="fig1">
            <title>Example Word File</title>
            <mediaobject>
                <imageobject>
                    <imagedata fileref="../../../vol31/graphics/Harvey01/Harvey01-001.jpg"/>
                </imageobject>
            </mediaobject>
        </figure>
        <para>The PREAMB section has the most semantic SGML tags. The PREAMB section is highly
            structured but there are variations of the types of information that is in this section.
            There can also be plain paragraphs, tables and lists that don't require structural
            elements. A common problem with the conversion is placing an end marker for the PREAMB
            because of the variations of the data. If the end marker is missing or 2 end markers are
            output because of an unanticipated variations the structure of the whole documents gets
            skewed. Luckily as we have been working with a larger corpus of data we don't see these
            kind of problems very often.</para>
        <figure>
            <title>Sample PREAMB Word File</title>
            <mediaobject>
                <imageobject>
                    <imagedata fileref="../../../vol31/graphics/Harvey01/Harvey01-002.jpg"/>
                </imageobject>
            </mediaobject>
        </figure>
        <para>Some users will put the SGML tag <emphasis role="bold">&lt;SUPPLINF&gt;</emphasis> in the
            Word file but we can't rely on the element being available in the file. We have also
            found that the word 'SUPPLEMENTARY' can be misspelled. We have accommodated some of the
            misspelling when we find them. Most of the time the heading is uppercase but sometimes
            it is camel cases (Supplemental Information:). The conversion needs to accommodate every
            variation provided by the agencies.</para>
        <figure>
            <title>Sample SUPPLEMENTARY INFORMATION Word File</title>
            <mediaobject>
                <imageobject>
                    <imagedata fileref="../../../vol31/graphics/Harvey01/Harvey01-003.jpg"/>
                </imageobject>
            </mediaobject>
        </figure>
        <para>The current production process for converting the Word files is a home-grown program
            called Doc2Xstyles. This program exports an SGML file from the Word document. The OFR
            staff then uses the output of the Doc2XStyles conversion to create edits.</para>
    </section>
    <section>
        <title>Microsoft Word to USLM Conversion</title>
        <para>In this section I will talk about some of the issues we had and are continuing to have
            with the Microsoft Word to USLM conversion. The challenges we experience will be similar
            to any organization doing a Word Conversion to XML. One of the cool features of the Word
            .docx file is it basically a bunch of XML files contained in a zip file.  These files
            that have most or all the information you need to understand the document.
            Unfortunately, the XML documents and structure are not always intuitive.</para>
        <para>If you haven't actually looked at the structure of the docx file, you can unzip the
            docx file and navigate the structure and files. This also true for Excel spreadsheets
            and Powerpoint files.</para>
        <para>GPO has developed a program/service to convert any Word document to USLM format -
            hasn't been specifically structured toward the Federal Register. USLM schema has been
            designed support any legislative document. The USLM schema is very loose. The resulting
            USLM document from the Word conversion is called 'Intermediate XML'. It is designed to
            be an intermediate format that can be converted to any other document. Unfortunately it
            is basically a 'flat' file. You have a root element and a single child 'content'
            element, followed by  'p', 'list' and 'table' elements. There is no hierarchy.</para>
        <section>
            <title>Internal Agency Styles</title>
            <para>Microsoft Word allows the user to create their own styles. We see a lot of custom
                styles in the Word files. Initially we had no insight into the meaning or physical
                attributes of the custom styles.  Each organization can use the same style name to
                represent different styles. This was initially a challenge. It isn't prudent to
                modify the XSLT whenever we see a new style in a document. We worked with the folks
                who were doing the Word to USLM conversion to have them add a 'style' attribute and
                use CSS styles for styled names. </para>
            <para>The <emphasis>class</emphasis> attribute holds the name of the style and the
                    <emphasis>style</emphasis> attribute contains the style information that can be
                harvested during our XML to Federal Register conversion to determine the appropriate
                styles. Putting all the style information into the <emphasis>style</emphasis>
                attribute allows us to parse the different components in the style to help identify
                the piece of information we are trying to convert.</para>
            <figure>
                <title>Example of 'class' and 'style' attributes</title>
<programlisting xml:space="preserve">
        &lt;uslm:p <emphasis role="bold">class="BodyA"</emphasis>
       <emphasis role="bold"> style="line-height:24pt;font-family:Courier;color:#000000;font-size:12pt;text-decoration-color:#000000;"</emphasis>&gt;
            &lt;uslm:span style="font-family:Times New Roman;font-weight:bold;color:black;"
                &gt;&amp;lt;PART&amp;gt;&amp;lt;HED&amp;gt;PART &lt;/uslm:span&gt;
            &lt;uslm:span style="font-family:Times New Roman;font-weight:bold;color:black;"&gt; 431—STATE
                ORGANIZATION AND GENERAL ADMINISTRATION&lt;/uslm:span&gt;
            &lt;uslm:span style="font-family:Times New Roman;color:black;"&gt; &lt;/uslm:span&gt;
        &lt;/uslm:p&gt;
</programlisting>
            </figure>
        </section>
        <section>
            <title>Word Style Nuances</title>
            <para>Everytime an individual mouse clicks in a Word file, Word makes a <emphasis role="bold">&lt;w:r&gt;</emphasis> element. The <emphasis role="bold">w:r</emphasis> element contains a fair amount of information, including text.
                When a user creates bolded text Word puts the bold information into the file. If the
                person decides "I don't want this bolded" and unbolds the data, Word keeps the
                original <emphasis role="bold">w:r</emphasis> but turns the bold off.</para>
            <para>The listing below shows text that was bolded but then turned off.  The XML
                statement in the<emphasis role="bold"> /w:p/w:pPr/w:rPr/w:b</emphasis> tells Word to
                bold the text in the <emphasis role="bold">w:t</emphasis> element "Cumulative Across
                MYs 1978".  However the case below the attribute <emphasis>w:val='0'</emphasis>
                which states ignore the bold.  If the value was "1" then the text would be bolded. </para>
            <para>The original Word to USLM conversion was styling (bold, italic and underscore) even
                when the value was turned off.  The user will occasionally use color but the Federal
                Register doesn't allow color so it is ignored in the conversion.  The Intermediate
                XML filw will still maintain color information.</para>
<programlisting xml:space="preserve">
&lt;w:p w14:paraId="5AF87D86" w14:textId="77777777" w:rsidR="008D3BB4" w:rsidRPr="00AF5ABC"
    w:rsidRDefault="008D3BB4" w:rsidP="0024392A"&gt;
    &lt;w:pPr&gt;
        &lt;w:pStyle w:val="TableText"/&gt;
        &lt;w:rPr&gt;
            &lt;w:b w:val="0"/&gt;
        &lt;/w:rPr&gt;
    &lt;/w:pPr&gt;
    &lt;w:r&gt;
        &lt;w:t&gt;Cumulative Across MYs 1978&lt;/w:t&gt;
    &lt;/w:r&gt;
    &lt;w:r w:rsidRPr="00AF5ABC"&gt;
        &lt;w:t&gt;-2029&lt;/w:t&gt;
    &lt;/w:r&gt;
&lt;/w:p&gt;
</programlisting>
            <para>Initially we were also missing tabs from the original Word to USLM conversion.
                Tabs can sometimes (not always) give you clues on the type of data.  Federal
                Register has several paragraph elements (P, FP#) which indicate how the paragraph is
                formatted in the Federal Register.  The <emphasis role="bold">w:tab</emphasis>
                element is now converted to a tab character.</para>
            <figure>
                <title>Example of Tabs in the Raw Word XML</title>
<programlisting xml:space="preserve">
&lt;w:p w14:paraId="696E9733" w14:textId="77777777" w:rsidR="00521FA4" w:rsidRPr="002754EC"
    w:rsidRDefault="00521FA4" w:rsidP="008C0A13"&gt;
    &lt;w:pPr&gt;
        &lt;w:pStyle w:val="Heading3"/&gt;
        &lt;w:keepNext w:val="0"/&gt;
       <emphasis role="bold"> &lt;w:tabs&gt;
            &lt;w:tab w:val="left" w:pos="2160"/&gt;
        &lt;/w:tabs&gt;</emphasis>
        &lt;w:spacing w:before="240" w:after="240" w:line="480" w:lineRule="auto"/&gt;
        &lt;w:ind w:left="2160" w:hanging="720"/&gt;
        &lt;w:rPr&gt;
            &lt;w:rFonts w:eastAsiaTheme="minorHAnsi"/&gt;
        &lt;/w:rPr&gt;
    &lt;/w:pPr&gt;
    &lt;w:bookmarkStart w:id="138" w:name="_Ref34871600"/&gt;
    &lt;w:r w:rsidRPr="002754EC"&gt;
        &lt;w:rPr&gt;
            &lt;w:rFonts w:eastAsiaTheme="minorHAnsi"/&gt;
        &lt;/w:rPr&gt;
        &lt;w:t&gt;Calculation of Physical Impacts&lt;/w:t&gt;
    &lt;/w:r&gt;
    &lt;w:bookmarkEnd w:id="138"/&gt;
&lt;/w:p&gt;
</programlisting>
            </figure>
        </section>
        <section>
            <title>Word to USLM Conversion</title>
            <para><xref linkend="fig2"/> below shows an example of the beginning of the
                Intermediate USLM XML file. </para>
            <figure xml:id="fig2">
                <title>Snippet of the Intermediate XML File</title>
<programlisting xml:space="preserve">
&lt;uslm:document xmlns:uslm="http://schemas.gpo.gov/xml/uslm"
    xmlns:xhtml="http://www.w3.org/1999/xhtml"&gt;
    &lt;uslm:meta/&gt;
    &lt;uslm:content&gt;
        &lt;uslm:p class="Normal"&gt;
            &lt;uslm:span&gt;<emphasis role="bold">&amp;lt;NOTICE&amp;gt;</emphasis>&lt;/uslm:span&gt;
            &lt;uslm:span/&gt;
        &lt;/uslm:p&gt;
        &lt;uslm:p class="Normal" style="padding-bottom:10pt;line-height:13pt;text-align:left;"&gt;
            &lt;uslm:span&gt;<emphasis role="bold">&amp;lt;PREAMB&amp;gt;</emphasis>&lt;/uslm:span&gt;
            &lt;uslm:span/&gt;
        &lt;/uslm:p&gt;
        &lt;uslm:p class="Normal" style="padding-bottom:0pt;line-height:12pt;text-align:right;"/&gt;
        &lt;uslm:p class="Normal" style="padding-bottom:0pt;line-height:24pt;"&gt;
            &lt;uslm:span style="font-family:Times New Roman;font-weight:bold;font-size:12pt;"
                &gt;<emphasis role="bold">&amp;lt;AGENCY TYPE='S'&amp;gt;</emphasis>&lt;/uslm:span&gt;
            &lt;uslm:span style="font-family:Times New Roman;font-weight:bold;font-size:12pt;"
                &gt;DEPARTMENT OF COMMERCE&lt;/uslm:span&gt;
        &lt;/uslm:p&gt;
        &lt;uslm:p class="Normal" style="padding-bottom:0pt;line-height:24pt;"&gt;
            &lt;uslm:span style="font-family:Times New Roman;font-weight:bold;font-size:12pt;"
                &gt;<emphasis role="bold">&amp;lt;SUBAGY&amp;gt;</emphasis>
            &lt;uslm:span style="font-family:Times New Roman;font-weight:bold;font-size:12pt;"&gt;
                &lt;/uslm:span&gt;
            &lt;uslm:span style="font-family:Times New Roman;font-weight:bold;font-size:12pt;"
                &gt;International Trade Administration&lt;/uslm:span&gt;
        &lt;/uslm:p&gt;
        &lt;uslm:p class="Normal" style="padding-bottom:0pt;line-height:24pt;"&gt;
            &lt;uslm:span style="font-family:Times New Roman;font-weight:bold;font-size:12pt;"
                &gt;<emphasis role="bold">&amp;lt;DEPDOC&amp;gt;</emphasis>[&lt;/uslm:span&gt;
            &lt;uslm:span style="font-family:Times New Roman;font-weight:bold;font-size:12pt;"
                &gt;C-&lt;/uslm:span&gt;
            &lt;uslm:span style="font-family:Times New Roman;font-weight:bold;font-size:12pt;"
                &gt;469&lt;/uslm:span&gt;
            &lt;uslm:span style="font-family:Times New Roman;font-weight:bold;font-size:12pt;"
                &gt;-8&lt;/uslm:span&gt;
            &lt;uslm:span style="font-family:Times New Roman;font-weight:bold;font-size:12pt;"
                &gt;18&lt;/uslm:span&gt;
            &lt;uslm:span style="font-family:Times New Roman;font-weight:bold;font-size:12pt;"
                &gt;]&lt;/uslm:span&gt;
        &lt;/uslm:p&gt;
        &lt;uslm:p class="Normal" style="padding-bottom:0pt;line-height:24pt;"&gt;
            &lt;uslm:span style="font-family:Times New Roman;font-weight:bold;font-size:12pt;"
                <emphasis role="bold">&gt;&amp;lt;SUBJECT&amp;gt;</emphasis>&lt;/uslm:span&gt;
            &lt;uslm:span style="font-family:Times New Roman;font-weight:bold;font-size:12pt;"&gt;Ripe
                Olives from Spain: Preliminary &lt;/uslm:span&gt;
            &lt;uslm:span style="font-family:Times New Roman;font-weight:bold;font-size:12pt;"
                &gt;Results&lt;/uslm:span&gt;
            &lt;uslm:span style="font-family:Times New Roman;font-weight:bold;font-size:12pt;"&gt; of
                Countervailing Duty &lt;/uslm:span&gt;
            &lt;uslm:span style="font-family:Times New Roman;font-weight:bold;font-size:12pt;"
                &gt;Administrative Review&lt;/uslm:span&gt;
            &lt;uslm:span style="font-family:Times New Roman;font-weight:bold;font-size:12pt;"&gt; &lt;/uslm:span&gt;
            &lt;uslm:span style="font-family:Times New Roman;font-weight:bold;font-size:12pt;"&gt;and &lt;/uslm:span&gt;
            &lt;uslm:span style="font-family:Times New Roman;font-weight:bold;font-size:12pt;"&gt;Partial &lt;/uslm:span&gt;
            &lt;uslm:span style="font-family:Times New Roman;font-weight:bold;font-size:12pt;"
                &gt;Rescission of &lt;/uslm:span&gt;
            &lt;uslm:span style="font-family:Times New Roman;font-weight:bold;font-size:12pt;"
                &gt;Review&lt;/uslm:span&gt;
            &lt;uslm:span style="font-family:Times New Roman;font-weight:bold;font-size:12pt;"&gt;;
                2022&lt;/uslm:span&gt;
        &lt;/uslm:p&gt;
</programlisting>
            </figure>
            <para>The Intermediate XML file has the same issues that any Word file has when you are
                converting to XML. Every click that a user makes in a Word file results in
                underlying tagging. The file has a lot of <emphasis>noise</emphasis> that has to be
                filtered out. Notice how many <emphasis role="bold">uslm:span</emphasis>  are in the
                above figure for a single paragraph.  Each <emphasis role="bold">span</emphasis>
                element represents a single 'w:r' structure in the Word file.  I have found single
                paragraphs that have hundreds of <emphasis role="bold">span</emphasis>elements.</para>
            <para>We have had our challenges with the conversion from Word to a flat USLM XML
                document.  </para>
        </section>
    </section>
    <section>
        <title>Different Document Types</title>
        <para>The <emphasis role="bold">Federal Register</emphasis> contains multiple document
            types.  Each type of document has variations in what elements are allowed and order of
            elements.  The document types are:</para>
        <itemizedlist>
            <listitem>
                <para><emphasis role="bold">NOTICE</emphasis>:   Informs the public about federal
                    agency actions, including meetings, investigations, and funding availability.
                    There are different types of notices and data can be handled differently
                    depending on the type of notice and/or the agency it came from.</para>
            </listitem>
            <listitem>
                <para><emphasis role="bold">PRORULE</emphasis>: The <emphasis role="bold">PRORULE</emphasis> is a proposed rule. It provides a plan to create, amend,
                    or repeal a regulation.   There is usually a comment period provided for the
                    public to comment on the rule.</para>
            </listitem>
            <listitem>
                <para><emphasis role="bold">RULE</emphasis>: The <emphasis role="bold">RULE</emphasis> provides information on a new or amended federal
                    regulation.</para>
            </listitem>
            <listitem>
                <para><emphasis role="bold">PRESDOC</emphasis>: The <emphasis role="bold">PRESDOC</emphasis> is a presidential document.  This is an official
                    document issued by the President of the United States.  This document types has
                    subtypes of documents</para>
                <itemizedlist>
                    <listitem>
                        <itemizedlist>
                            <listitem>
                                <para>
                                    <emphasis role="bold">Executive Orders:</emphasis>Official
                                    documents issued by the President to manage operations of the
                                    federal government.</para>
                            </listitem>
                            <listitem>
                                <para>
                                    <emphasis role="bold">Proclamations:</emphasis>Signed documents
                                    that typically relate to ceremonial matters, national
                                    observances, or trade matters.</para>
                            </listitem>
                            <listitem>
                                <para>
                                    <emphasis role="bold">Presidential
                                    Memorandums:</emphasis>Directives that may be published in the
                                    Federal Register.</para>
                            </listitem>
                            <listitem>
                                <para><emphasis role="bold">Determinations:</emphasis> Official
                                    decisions by the President.</para>
                                <para><emphasis role="bold">Administrative Orders:</emphasis>
                                    Notices, letters, and other miscellaneous orders.</para>
                            </listitem>
                            <listitem>
                                <para><emphasis role="bold">Reorganization Plans:</emphasis> Plans
                                    submitted to Congress for restructuring executive agencies.
                                </para>
                            </listitem>
                        </itemizedlist>
                    </listitem>
                </itemizedlist>
            </listitem>
        </itemizedlist>
    </section>
    <section>
        <title>Conversion Processes</title>
        <para>In this section I am going to describe the conversion process and some of the thought
            processes  that were used to get the correct hierarchy.</para>
        <section>
            <title>Identification of the Information</title>
            <para>As you can see in <xref linkend="fig2"/> the USLM file is very verbose. The first
                step is to identify as many components as possible during the first pass of the
                data. The following tasks are performed during the first pass at the file.</para>
            <itemizedlist>
                <listitem>
                    <para>Assign id's to paragraphs.</para>
                </listitem>
                <listitem>
                    <para>Identify all the styles as possible.  For example,  "<emphasis>
                            &lt;uslm:span style="font-family:Times New
                            Roman;font-weight:bold;font-size:12pt;"                 &gt;Administrative
                            Review&lt;/uslm:span&gt;</emphasis>" gets converted to &lt;b&gt;Administrative
                        Review&lt;/b&gt;</para>
                </listitem>
                <listitem>
                    <para>Identify the elements and add them to an <emphasis role="bold">&lt;element&gt;</emphasis> tag. This isn't always possible in the first
                        pass because the elements can span across multiple span elements.  The
                            <emphasis role="bold">element</emphasis> tag will be deleted when the
                        structures are created. </para>
                </listitem>
                <listitem>
                    <para>When the information is identifiable, add a 'class' attribute that will
                        help in creating correct structures.</para>
                </listitem>
                <listitem>
                    <para>Where possible, add a <emphasis role="bold">&lt;marker&gt;</emphasis>
                        element.  I will describe it's use later in this paper.</para>
                </listitem>
            </itemizedlist>
            <figure xml:id="fig3">
                <title>XML After Pass 1</title>
<programlisting xml:space="preserve">
&lt;document xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"
          xmlns:mml="http://www.w3.org/1998/Math/MathML"&gt;
   &lt;content class="root"
            id="rootcontent-d29e2"
            uri="file:/D:/FederalRegisterConversion/Conversion/Testing/2024-20623.ixml.xml"&gt;
      &lt;heading&gt;Federal Register&lt;/heading&gt;
      &lt;heading class="HD1"&gt;
         &lt;element location="start"&gt;NOTICE&lt;/element&gt;
      &lt;/heading&gt;
      &lt;heading class="HD1"&gt;
         &lt;element location="start"&gt;PREAMB&lt;/element&gt;
      &lt;/heading&gt;
      &lt;p class="AGENCY" id="AGENCY4-d29e12"&gt;
         &lt;element location="start"&gt;AGENCY TYPE='S'&lt;/element&gt;
         &lt;b&gt;DEPARTMENT OF COMMERCE&lt;/b&gt;
      &lt;/p&gt;
      &lt;p id="process-def-d29e17" class="Normal"&gt;
         &lt;element location="start"&gt;SUBAGY&lt;/element&gt;
         &lt;b&gt;International Trade Administration&lt;/b&gt;
      &lt;/p&gt;
      &lt;p class="DEPDOC" id="DEPDOC-d29e22"&gt;
         &lt;element location="start"&gt;DEPDOC&lt;/element&gt;[
         <emphasis role="bold">&lt;b&gt;C-&lt;/b&gt;
         &lt;b&gt;469&lt;/b&gt;
         &lt;b&gt;-8&lt;/b&gt;
         &lt;b&gt;18&lt;/b&gt;
         &lt;b&gt;]&lt;/b&gt;</emphasis>
      &lt;/p&gt;
      &lt;p class="SUBJECT"&gt;
         &lt;element location="start"&gt;SUBJECT&lt;/element&gt;
         <emphasis role="bold">&lt;b&gt;Ripe Olives from Spain:  Preliminary &lt;/b&gt;
         &lt;b&gt;Results&lt;/b&gt;
         &lt;b&gt; of Countervailing Duty &lt;/b&gt;
         &lt;b&gt;Administrative Review&lt;/b&gt;
         &lt;b&gt;and &lt;/b&gt;
         &lt;b&gt;Partial &lt;/b&gt;
         &lt;b&gt;Rescission of &lt;/b&gt;
         &lt;b&gt;Review&lt;/b&gt;
         &lt;b&gt;; 2022&lt;/b&gt;</emphasis>
      &lt;/p&gt;
</programlisting>
            </figure>
        </section>
        <section>
            <title>Merging Like Formatting Elements</title>
            <para>During the first pass it was impossible to merge all the like elements (bold,
                italic, underline, etc.) because of the different variations of the span styles
                because of spacing, font styles, etc. The second phase of the conversion merges all
                the adjacent like tagging into a single tag.  All adjacent bold, italic and
                underscore elements get combined into a single element.</para>
            <figure xml:id="fig4">
                <title>Results After Merging Formatting Elements</title>
<programlisting xml:space="preserve">
&lt;document&gt;
   &lt;content class="root" id="rootcontent-d29e2"
      uri="file:/D:/FederalRegisterConversion/Conversion/Testing/2024-20623.ixml.xml"&gt;
      &lt;heading&gt;Federal Register&lt;/heading&gt;
      &lt;heading class="HD1"&gt;
         &lt;element location="start"&gt;NOTICE&lt;/element&gt;
      &lt;/heading&gt;
      &lt;heading class="HD1"&gt;
         &lt;element location="start"&gt;PREAMB&lt;/element&gt;
      &lt;/heading&gt;
      &lt;p class="AGENCY" id="AGENCY4-d29e12"&gt;
         &lt;element location="start"&gt;AGENCY TYPE='S'&lt;/element&gt;
         &lt;b&gt;DEPARTMENT OF COMMERCE&lt;/b&gt;
      &lt;/p&gt;
      &lt;p id="process-def-d29e17" class="Normal"&gt;
         &lt;element location="start"&gt;SUBAGY&lt;/element&gt;
         &lt;b&gt;International Trade Administration&lt;/b&gt;
      &lt;/p&gt;
      &lt;p class="DEPDOC" id="DEPDOC-d29e22"&gt;
         &lt;element location="start"&gt;DEPDOC&lt;/element&gt;[<emphasis role="bold">&lt;b&gt;C-469-818]&lt;/b&gt;</emphasis>
      &lt;/p&gt;
      &lt;p class="SUBJECT"&gt;
         &lt;element location="start"&gt;SUBJECT&lt;/element&gt;
         <emphasis role="bold">&lt;b&gt;Ripe Olives from Spain: Preliminary Results of Countervailing Duty 
            Administrative Review and Partial Rescission of Review; 2022&lt;/b&gt;</emphasis>
      &lt;/p&gt;
</programlisting>
            </figure>
        </section>
        <section>
            <title>Cleanup and Identifying Hierarchy</title>
            <para>After the merge there can be elements that didn't get identified because they
                spanned mulitple uslm:span elements and they weren't identifiable until after the
                merge happened. Elements are identified as starting with an &amp;lt; and ending with
                a &amp;gt; entity. This process can also be flawed because often both &amp;lt; and
                &amp;gt; are used in the same paragraph as content.We had to modify our initial
                REGEX because we were occasionally picking up paragraph data and assigning it the
                    <emphasis role="bold">&lt;element&gt;</emphasis> tag.</para>
            <para>During this phase we identify the heirarchical structure. We use an element called
                    <emphasis role="bold">&lt;marker&gt;</emphasis> with a <emphasis>class</emphasis>
                and <emphasis>id</emphasis> attributes to determine the beginning an end of the
                structure. These elements are the building blocks for actually structuring the
                hierarchy in following processes. We try to identify hierarchical structure in phase
                1 but it is not always possible because of the multiple span elements.</para>
            <para>The end <emphasis role="bold">marker</emphasis> has a <emphasis>rid</emphasis> or
                'reference identifier' for the beginning marker.</para>
            <figure xml:id="fig5">
                <title>Beginning Marker for  PREAMB Structure</title>
<programlisting xml:space="preserve">
&lt;marker class="<emphasis role="bold">beginPREAMB</emphasis>" id="beginPREAMB-1d102e8"/&gt;
. . .
&lt;marker class="<emphasis role="bold">endPREAMB</emphasis>" id="endPREAMB22-d29e160" rid="beginPREAMB-1d102e8"/&gt;
</programlisting>
            </figure>
        </section>
        <section>
            <title>Creating Content Elements</title>
            <para>The conversion has many steps. Low level hierarchies are created first. We are
                following the USLM schema but have deviated by adding the <emphasis role="bold">&lt;marker&gt;</emphasis> element. The conversion calls a template that picks up
                all the elements inside the <emphasis>class="beginPREAMB"</emphasis> and
                    <emphasis>class="endPREAMB"</emphasis>.</para>
            <para>The <emphasis>class</emphasis> attribute and the <emphasis>id</emphasis> of the
                beginning marker and the reference id (<emphasis>rid</emphasis>) are used to guide
                the conversion into creating the following <emphasis role="bold">&lt;content&gt;</emphasis> heirarchy. </para>
            <para>The next step after creating the <emphasis role="bold">&lt;content&gt;</emphasis>
                hierarchy is to removes  the original content between the 2 marker elements.  If
                this step isn't completed then duplicate text will be included in the file.</para>
            <figure>
                <title>Marker Example</title>
<programlisting xml:space="preserve">
&lt;marker class="<emphasis role="bold">beginPREAMB</emphasis>" <emphasis role="bold">id="preamb-1d215e8"</emphasis>/&gt;
      &lt;p id="preamb-ad215e8" class=""&gt;
         &lt;element&gt;PREAMB&lt;/element&gt;
      &lt;/p&gt;
      &lt;p class="AGENCY" id="pp-AGENCY4-d29e12"&gt;
         &lt;element&gt;AGENCY TYPE='S'&lt;/element&gt;SECURITIES AND EXCHANGE COMMISSION&lt;/p&gt;
      &lt;p class="DEPDOC" id="depdoc2-d215e15"&gt;
         &lt;element&gt;DEPDOC&lt;/element&gt;[Release No. 34-84997; File No. 4-678]&lt;/p&gt;
. . .
&lt;marker class="<emphasis role="bold">endPREAMB</emphasis>" id="endPREAM3-d215e824" <emphasis role="bold">rid="preamb-1d215e8"</emphasis>/&gt;
</programlisting>
            </figure>
            <para>Below is the result after the <emphasis role="bold">content</emphasis> structure
                is completed.</para>
            <figure>
                <title>Example Content for PREAMB</title>
<programlisting xml:space="preserve">
   &lt;content class="PREAMB"&gt;
         &lt;p class="AGENCY" id="pp-AGENCY4-d29e12"&gt;
            &lt;element&gt;AGENCY TYPE='S'&lt;/element&gt;
            &lt;b&gt;DEPARTMENT OF COMMERCE&lt;/b&gt;
         &lt;/p&gt;
         &lt;p class="SUBAGY"&gt;
            &lt;element&gt;SUBAGY&lt;/element&gt;
            &lt;b&gt;International Trade Administration&lt;/b&gt;
         &lt;/p&gt;
   . . .
   &lt;/content&gt;
</programlisting>
            </figure>
            <para>During the last stage of process after all the lower-level <emphasis role="bold">content</emphasis> elements have been created we have the following
                markup:</para>
            <figure>
                <title>Final PREAMB Structure</title>
<programlisting xml:space="preserve">
&lt;PREAMB&gt;
      &lt;AGENCY&gt;DEPARTMENT OF COMMERCE&lt;/AGENCY&gt;
      &lt;SUBAGY&gt;International Trade Administration&lt;/SUBAGY&gt;
      &lt;DEPDOC&gt;[C-469-818]&lt;/DEPDOC&gt;
      &lt;SUBJECT&gt;Ripe Olives from Spain: Preliminary Results of Countervailing Duty Administrative Review and Partial Rescission of Review; 2022&lt;/SUBJECT&gt;
      &lt;AGY&gt;
         &lt;HED&gt;AGENCY:&lt;/HED&gt;
         &lt;P&gt;Enforcement and Compliance, International Trade Administration, Department of Commerce.&lt;/P&gt;
      &lt;/AGY&gt;
. . .
&lt;/PREAMB&gt;
</programlisting>
            </figure>
            <section>
                <title>Lower Level Structures</title>
                <para>Each structure in the lower-level structures have their own challenges. Below
                    is an example of a pretty easy structure called &lt;ANNEX&gt;.  In this case we got
                    luck because there is a begin and end element.  You will also notice in this
                    example the user also put in &lt;P&gt; tages which are unnecessary.  I will use
                    this section to walk through the conversion:</para>
                <figure>
                    <title>Raw Intermediate XML</title>
<programlisting xml:space="preserve">
        &lt;uslm:p class="Normal"&gt;
            &lt;uslm:span&gt;<emphasis role="bold">&amp;lt;ANNEX&amp;gt;&amp;lt;HED&amp;gt;ANNEX&amp;lt;/HED&amp;gt;</emphasis>&lt;/uslm:span&gt;
        &lt;/uslm:p&gt;
        &lt;uslm:p class="Normal"&gt;
            &lt;uslm:span&gt; &amp;lt;P&amp;gt;1. Antonio José Benavides Torres [Commander of the Central Integral
                Strategic Defense Region of the National Armed Forces, former Director of Operations
                for the National Guard; born June 13, 1961] &amp;lt;/P&amp;gt;&lt;/uslm:span&gt;
        &lt;/uslm:p&gt;
        &lt;uslm:p class="Normal"&gt;
            &lt;uslm:span&gt; &amp;lt;P&amp;gt;2. Gustavo Enrique González López [Director General of the National
                Intelligence Service and President of the Strategic Center of Security and
                Protection of the Homeland; born November 2, 1960]&amp;lt;/P&amp;gt;&lt;/uslm:span&gt;
        &lt;/uslm:p&gt;
        &lt;uslm:p class="Normal"&gt;
            &lt;uslm:span&gt; &amp;lt;P&amp;gt;3. Justo José Noguera Pietri [President of the Venezuelan
                Corporation of Guayana, &lt;/uslm:span&gt;
            &lt;uslm:span&gt;former General Commander of the National Guard; born March 15, 1961]
                &amp;lt;/P&amp;gt;&lt;/uslm:span&gt;
        &lt;/uslm:p&gt;
        &lt;uslm:p class="Normal"&gt;
            &lt;uslm:span&gt; &amp;lt;P&amp;gt;4. Katherine Nayarith Haringhton Padron [National Level Prosecutor
                of the 20th District Office of the Public Ministry; born December 5, 1971]
                &amp;lt;/P&amp;gt;&lt;/uslm:span&gt;
        &lt;/uslm:p&gt;
        &lt;uslm:p class="Normal"&gt;
            &lt;uslm:span&gt; &amp;lt;P&amp;gt;5. Manuel Eduardo Pérez Urdaneta [Director of the National Police;
                born May 26, 1962] &amp;lt;/P&amp;gt;&lt;/uslm:span&gt;
        &lt;/uslm:p&gt;
        &lt;uslm:p class="Normal"&gt;
            &lt;uslm:span&gt; &amp;lt;P&amp;gt;6. Manuel Gregorio Bernal Martínez [Chief of the 31st Armored
                Brigade of Caracas, former Director General of the National Intelligence Service;
                born July 12, 1965] &amp;lt;/P&amp;gt;&lt;/uslm:span&gt;
        &lt;/uslm:p&gt;
        &lt;uslm:p class="Normal"&gt;
            &lt;uslm:span&gt; &amp;lt;P&amp;gt;7. Miguel Alcides Vivas Landino [Inspector General of the National
                Armed Forces, former Commander of the Andes Integral Strategic Defense Region of the
                National Armed Forces; born July 8, 1961] &amp;lt;/P&amp;gt;&lt;/uslm:span&gt;
        &lt;/uslm:p&gt;
        &lt;uslm:p class="Normal"&gt;
            &lt;uslm:span&gt;<emphasis role="bold">&amp;lt;/ANNEX&amp;gt;</emphasis>&lt;/uslm:span&gt;
        &lt;/uslm:p&gt;
</programlisting>
                </figure>
                <para>This is the structure of the ANNEX before it gets converted to hierarchy.  You
                    will see a begin marker and an end marker.  Later we will walk through the code
                    to convert it to a hierarchy element.</para>
                <figure>
                    <title>ANNEX Before Hierarchy</title>
<programlisting xml:space="preserve">
&lt;marker class="beginANNEX" id="beginANNEX-d29e759"/&gt;
&lt;heading&gt;ANNEX&lt;/heading&gt;
&lt;p class="Normal" id="Default-pp22-d244e278"&gt; 1. Antonio José Benavides Torres [Commander of the Central Integral Strategic Defense Region of the National Armed Forces, former Director of Operations for the National Guard; born June 13, 1961] &lt;element location="end"&gt;P&lt;/element&gt;&lt;/p&gt;
&lt;p class="Normal" id="Default-pp22-d244e281"&gt; 2. Gustavo Enrique González López [Director General of the National Intelligence Service and President of the Strategic Center of Security and Protection of the Homeland; born November 2, 1960]&lt;element location="end"&gt;P&lt;/element&gt;&lt;/p&gt;
&lt;p class="Normal" id="Default-pp22-d244e283"&gt; 3. Justo José Noguera Pietri [President of the Venezuelan Corporation of Guayana, former General Commander of the National Guard; born March 15, 1961] &lt;element location="end"&gt;P&lt;/element&gt;&lt;/p&gt;
&lt;p class="Normal" id="Default-pp22-d244e285"&gt; 4. Katherine Nayarith Haringhton Padron [National Level Prosecutor of the 20th District Office of the Public Ministry; born December 5, 1971] &lt;element location="end"&gt;P&lt;/element&gt;&lt;/p&gt;
&lt;p class="Normal" id="Default-pp22-d244e287"&gt; 5. Manuel Eduardo Pérez Urdaneta [Director of the National Police; born May 26, 1962] &lt;element location="end"&gt;P&lt;/element&gt;&lt;/p&gt;
&lt;p class="Normal" id="Default-pp22-d244e289"&gt; 6. Manuel Gregorio Bernal Martínez [Chief of the 31st Armored Brigade of Caracas, former Director General of the National Intelligence Service; born July 12, 1965] &lt;element location="end"&gt;P&lt;/element&gt;&lt;/p&gt;
&lt;p class="Normal" id="Default-pp22-d244e291"&gt; 7. Miguel Alcides Vivas Landino [Inspector General of the National Armed Forces, former Commander of the Andes Integral Strategic Defense Region of the National Armed Forces; born July 8, 1961] &lt;element location="end"&gt;P&lt;/element&gt;&lt;/p&gt;
&lt;marker class="endANNEX" id="endANNEX-d29e777" rid="beginANNEX-d29e759"/&gt;
</programlisting>
                </figure>
                <para>Now let's walk through the code to make the <emphasis role="bold">ANNEX</emphasis> hierarchy.</para>
                <para>Each phase of the conversion relies on using <emphasis role="bold">modes</emphasis>.  The use of modes ensures that we don't get any
                    unexpected output during each phase.</para>
                <para>Every mode has a default template for the elements that are not included in
                    the creation of the heirarchy</para>
                <figure>
                    <title>Default 'element' Template</title>
<programlisting xml:space="preserve">
    &lt;xsl:template match="element()" mode="createANNEX" &gt;
        &lt;xsl:variable name="el-name" select="name()"/&gt;
        &lt;xsl:variable name="ANNEX-id" select="preceding-sibling::marker[1][@class = 'beginANNEX']/@id"/&gt;
        &lt;xsl:choose&gt;
           &lt;!--Remove ANNEX internal content--&gt;
            &lt;xsl:when test="preceding-sibling::marker[@class='beginANNEX'][@id = $ANNEX-id] and 
                following-sibling::marker[@class = 'endANNEX'][@rid = $ANNEX-id]"&gt;
            &lt;/xsl:when&gt;
          &lt;!--Output content that isn't included in the ANNEX--&gt;
          &lt;xsl:otherwise&gt;
                &lt;xsl:element name="{$el-name}"&gt;
                    &lt;xsl:copy-of select="@*"/&gt;
                    &lt;xsl:apply-templates mode="createANNEX"/&gt;
                &lt;/xsl:element&gt;
            &lt;/xsl:otherwise&gt;
        &lt;/xsl:choose&gt;       
    &lt;/xsl:template&gt;
</programlisting>
                </figure>
                <para>The ANNEX is a very simple structure so the beginANNEX marker creates a
                    content with a <emphasis>class</emphasis> attribute.  The
                        <emphasis>class</emphasis> attribute is used in the final conversion to
                    create the Federal Register structure.</para>
                <figure>
                    <title>Begin Marker for ANNEX</title>
<programlisting xml:space="preserve">
    &lt;xsl:template match="marker[@class = 'beginANNEX']" mode="createANNEX"&gt;
        &lt;content class="ANNEX" id="{@id}"&gt;
            &lt;xsl:call-template name="createANNEXChildren"/&gt;
        &lt;/content&gt;
    &lt;/xsl:template&gt;
</programlisting>
                </figure>
                <para>The following code uses the begin marker <emphasis role="bold">id</emphasis>
                    and end marker <emphasis>rid</emphasis> attribute values to determine the child
                    elements.</para>
                <figure>
                    <title>Create Children Elements</title>
<programlisting xml:space="preserve">
    &lt;xsl:template name="createANNEXChildren"&gt;
        &lt;xsl:variable name="id" select="@id"/&gt;
        &lt;xsl:for-each select="following-sibling::element()[following::marker[@class='endANNEX'][@rid = $id]]"&gt;
            &lt;xsl:choose&gt;
                &lt;xsl:when test="contains(child::element[1], 'HD2')"&gt;
                    &lt;heading class="HD2"&gt;
                        &lt;xsl:apply-templates mode="createANNEX"/&gt;
                    &lt;/heading&gt;
                &lt;/xsl:when&gt;
                &lt;xsl:otherwise&gt;
                    &lt;xsl:copy-of select="."/&gt;
                &lt;/xsl:otherwise&gt;
            &lt;/xsl:choose&gt;    
        &lt;/xsl:for-each&gt;
    &lt;/xsl:template&gt;
</programlisting>
                </figure>
                <figure>
                    <title>Intermediate Structural Output</title>
<programlisting xml:space="preserve">
 &lt;content class="ANNEX" id="beginANNEX-d29e759"&gt;
        &lt;heading&gt;ANNEX&lt;/heading&gt;
        &lt;p class="Normal" id="Default-pp22-d244e278"&gt; 1. Antonio José Benavides Torres [Commander of the Central Integral Strategic Defense Region of the National Armed Forces, former Director of Operations for the National Guard; born June 13, 1961] &lt;element location="end"&gt;P&lt;/element&gt;
                  &lt;/p&gt;
        &lt;p class="Normal" id="Default-pp22-d244e281"&gt; 2. Gustavo Enrique González López [Director General of the National Intelligence Service and President of the Strategic Center of Security and Protection of the Homeland; born November 2, 1960]&lt;element location="end"&gt;P&lt;/element&gt;
        &lt;/p&gt;
        &lt;p class="Normal" id="Default-pp22-d244e283"&gt; 3. Justo José Noguera Pietri [President of the Venezuelan Corporation of Guayana, former General Commander of the National Guard; born March 15, 1961] &lt;element location="end"&gt;P&lt;/element&gt;
        &lt;/p&gt;
        &lt;p class="Normal" id="Default-pp22-d244e285"&gt; 4. Katherine Nayarith Haringhton Padron [National Level Prosecutor of the 20th District Office of the Public Ministry; born December 5, 1971] &lt;element location="end"&gt;P&lt;/element&gt;
        &lt;/p&gt;
        &lt;p class="Normal" id="Default-pp22-d244e287"&gt; 5. Manuel Eduardo Pérez Urdaneta [Director of the National Police; born May 26, 1962] &lt;element location="end"&gt;P&lt;/element&gt;
        &lt;/p&gt;
        &lt;p class="Normal" id="Default-pp22-d244e289"&gt; 6. Manuel Gregorio Bernal Martínez [Chief of the 31st Armored Brigade of Caracas, former Director General of the National Intelligence Service; born July 12, 1965] &lt;element location="end"&gt;P&lt;/element&gt;
        &lt;/p&gt;
        &lt;p class="Normal" id="Default-pp22-d244e291"&gt; 7. Miguel Alcides Vivas Landino [Inspector General of the National Armed Forces, former Commander of the Andes Integral Strategic Defense Region of the National Armed Forces; born July 8, 1961] &lt;element location="end"&gt;P&lt;/element&gt;
        &lt;/p&gt;
 &lt;/content&gt;
</programlisting>
</figure>
                <para>This structure will go through one more conversion to make it valid according
                    to the Federal Register schema.  This is the final ANNEX structure.</para>
                <figure>
                    <title>Final ANNEX Structure</title>
<programlisting xml:space="preserve">
&lt;ANNEX&gt;
    &lt;HED&gt;ANNEX&lt;/HED&gt;
    &lt;P&gt;1. Antonio José Benavides Torres [Commander of the Central Integral Strategic Defense Region of the National Armed Forces, former Director of Operations for the National Guard; born June 13, 1961] &lt;/P&gt;
    &lt;P&gt;2. Gustavo Enrique González López [Director General of the National Intelligence Service and President of the Strategic Center of Security and Protection of the Homeland; born November 2, 1960]&lt;/P&gt;
    &lt;P&gt;3. Justo José Noguera Pietri [President of the Venezuelan Corporation of Guayana, former General Commander of the National Guard; born March 15, 1961] &lt;/P&gt;
    &lt;P&gt;4. Katherine Nayarith Haringhton Padron [National Level Prosecutor of the 20th District Office of the Public Ministry; born December 5, 1971] &lt;/P&gt;
    &lt;P&gt;5. Manuel Eduardo Pérez Urdaneta [Director of the National Police; born May 26, 1962] &lt;/P&gt;
    &lt;P&gt;6. Manuel Gregorio Bernal Martínez [Chief of the 31st Armored Brigade of Caracas, former Director General of the National Intelligence Service; born July 12, 1965] &lt;/P&gt;
    &lt;P&gt;7. Miguel Alcides Vivas Landino [Inspector General of the National Armed Forces, former Commander of the Andes Integral Strategic Defense Region of the National Armed Forces; born July 8, 1961] &lt;/P&gt;
&lt;/ANNEX&gt;
</programlisting>
                </figure>
            </section>
            <section>
                <title>Complicated Structures (&lt;REGTEXT&gt;</title>
                <para>The most complicated structure that we have to deal with in
                        <emphasis>regulatory text</emphasis>.  This structure allows repeating
                    structures for:</para>
                <itemizedlist>
                    <listitem>
                        <para>Headings</para>
                    </listitem>
                    <listitem>
                        <para>Paragraphs</para>
                    </listitem>
                    <listitem>
                        <para>Legislative Structures, i.e., section, part, subpart</para>
                    </listitem>
                    <listitem>
                        <para>Table of Contents</para>
                    </listitem>
                    <listitem>
                        <para>Extract data from other documents.</para>
                    </listitem>
                </itemizedlist>
                <para>The <emphasis role="bold">REGTEXT</emphasis> element has 2 attributes that are
                    required in the output.</para>
                <figure>
                    <title>Word Begin REGTEXT</title>
                    <para>&lt;REGTEXT TITLE='12' PART='1041'&gt;</para>
                    <para><emphasis role="bold">&lt;PART&gt;&lt;HED&gt;PART 1041—PAYDAY, VEHICLE TITLE,
                            AND CERTAIN HIGH-COST INSTALLMENT LOANS</emphasis></para>
                </figure>
                <para>After the first process where content is identified and the
                        <emphasis>like</emphasis> 'span' elements are merged the following structure
                    is created to identify the attributes associated with the <emphasis role="bold">REGTEXT</emphasis> elements.  This process should be straight-forward but
                    because of the variances between how organizations provide data there are
                    multiple paths that need to be created.  Creating a <emphasis role="bold">&lt;metadata&gt;</emphasis> element ensures that the data is normalized before
                    the final output is created.  This particular example of a <emphasis role="bold">&lt;REGTEXT&gt;</emphasis> section is over 1500 pages long with thousands of
                    lower-level structures.</para>
                <figure>
                    <title>Pre-process for Normalizing REGTEXT</title>
<programlisting xml:space="preserve">
&lt;content class="REGTEXT" id="REGTEXT6-d4531e15882"&gt;
         <emphasis role="bold">&lt;meta&gt;
            &lt;set&gt;
               &lt;property class="TITLE"&gt;
                  &lt;text&gt;12&lt;/text&gt;
               &lt;/property&gt;
               &lt;property class="PART"&gt;
                  &lt;text&gt;1041&lt;/text&gt;
               &lt;/property&gt;
            &lt;/set&gt;
         &lt;/meta&gt;</emphasis>
         &lt;marker class="beginPart" id="beginPart2-d4531e15886"/&gt;
         &lt;heading class="beginPart" id="p-d25e28327"&gt;PART 1041—PAYDAY, VEHICLE TITLE, AND CERTAIN HIGH-COST INSTALLMENT LOANS&lt;/heading&gt;
         &lt;marker class="endPart" id="endPart2-d4531e15886"/&gt;
...
&lt;/content&gt;
</programlisting>
                </figure>
            </section>
        </section>
        <section>
            <title>Tables</title>
            <para>GPO has their own publishing system called <emphasis role="bold">Microcomp</emphasis>.  <emphasis role="bold">Microcomp</emphasis>has been used
                for the last 40+ years. The modernization process wants to move away from Microcomp
                to another publishing system.  However, until that happens we still have to convert
                the table into a format that Microcomp can consume. GPO has its own table model
                which is drastically different from either HTML or OASIS-Open (nee CALS) table
                model.</para>
            <para>In our conversion process we have to support the following table models:</para>
            <itemizedlist>
                <listitem>
                    <para><emphasis role="bold">Word Table Model</emphasis></para>
                </listitem>
                <listitem>
                    <para><emphasis role="bold">HTML Table Model.</emphasis>  The Word table model
                        gets converted to HTML table model during the Word to IXML
                        conversion.</para>
                </listitem>
                <listitem>
                    <para><emphasis role="bold">GPO Table.</emphasis> Currently the GPO table model
                        gets converted from the HTML table model during the conversion to the
                        Federal Register XML.</para>
                </listitem>
                <listitem>
                    <para><emphasis role="bold">OASIS-Open (CALS) Table Model.</emphasis> The CALS
                        table model will be used by the new publishing engine.  </para>
                </listitem>
            </itemizedlist>
            <para>In the XSLT conversion we have a parameter that tells the conversion whether to
                convert to the GPO table model or the CALS table model.  The attributes in the
                    <emphasis role="bold">GPOTABLE</emphasis> element tells Microcomp the typography
                of the table.</para>
            <figure>
                <title>GPO Table Model Example</title>
<programlisting xml:space="preserve">
&lt;GPOTABLE CDEF="s50,xs40" COLS="3" OPTS="L2,tp0,p7,7/8,i1"&gt;
    &lt;TTITLE&gt;Table Title&lt;/TTITLE&gt;
    &lt;BOXHD&gt; &lt;!--Equivalent to 'thead'--&gt;
       &lt;CHED H="1"&gt;First Column Head&lt;/CHED&gt;
       &lt;CHED H="1"&gt;Second Column Head&lt;/CHED&gt;
       &lt;CHED H="1"&gt;Second Column Head&lt;/CHED&gt;
    &lt;/BOXHD&gt;
    &lt;ROW&gt;
       &lt;ENT&gt;First body column&lt;/ENT&gt;
       &lt;ENT&gt;Second body column&lt;/ENT&gt;   
       &lt;ENT&gt;Third body column&lt;/ENT&gt;
    &lt;/ROW&gt;
&lt;/GPOTABLE&gt;
</programlisting>
            </figure>
        </section>
    </section>
    <section>
        <title>Problems Encountered</title>
        <para>The Word document is created by individuals in hundreds of agencies. People come,
            people go, processes change. Tweaking the conversion process is a never-ending process
            because we are always encountering variations on how individuals construct the Word
            document. Any organization that embarks on a Word to XML conversion project will hit
            many of the pitfalls that we have encountered in this process.</para>
        <section>
            <title>Misspellings and Phrase Variations</title>
            <para>The conversion relies mostly on creating the hierarchy by headings and/or phrases
                in the text. For example, one of the top level sections is called <emphasis role="bold">SUPPLINF</emphasis> relies on a heading "<emphasis role="bold">SUPPLEMENTARY INFORMATION:</emphasis>" in the text. We have encountered
                multiple variations of spelling "SUPPLEMENTARY", i.e., "SUPPLEMENTAL".</para>
            <para>The majority of the Federal Register files identify the <emphasis role="bold">SUPPLEMENTARY INFORMATION:</emphasis> either as a bolded paragraph or a styled
                heading.  Occasionally the heading will be included in the first paragraph of the
                section and we will need to parse the text to determine the beginning of the section
                and create a <emphasis role="bold">&lt;marker&gt;</emphasis> marker element.</para>
            <para>We have also encountered case differences: "Supplementary Information".</para>
        </section>
        <section>
            <title>Determining the Levels of Heading</title>
            <para>We caught a break because the Federal Register schema does not enforce hierarchy
                in what is considered standard structural sections of most documents. We only need
                to identify the heading and the level of heading. The Federal Register has 3 levels
                of heading: <emphasis role="bold">HD1</emphasis>, <emphasis role="bold">HD2</emphasis> and <emphasis role="bold">HD3</emphasis>. The heading element
                    <emphasis role="bold">HED</emphasis> is usually reserved for the first heading
                in a semantic structure.</para>
            <para>The Word files are all over the place with how headings are identified. Most of
                the time they are just regular paragraphs with formatting (italic, bold or
                underline). There are roman numeral, alphabetic, numbered and unnumbered headings.
                The order in which the heading appears in the file after the &lt;SUPPLINF&gt; section
                determines the level of heading. For example, a "I. " could be a <emphasis role="bold">&lt;HD1&gt;</emphasis> in one document or a <emphasis role="bold">&lt;HD2&gt; </emphasis> in another document. The conversion is required to parse
                the document and make heading determinations.</para>
            <para>There are so many rules that have been created to determine what constitutes a
                heading and what doesn't. Sometimes the Word file will have standard Word heading
                styles attached. However, you can't rely on the heading style. The conversion has to
                rely on context , as well as ending punctuation. Normally, if the text ends in a
                period, semi-colon, colon or question mark it is not a heading.</para>
            <figure>
                <title>Example 1 of Heading levels</title>
<programlisting xml:space="preserve">
<emphasis role="bold">HD1 - Bolded Text</emphasis>
...
<emphasis role="bold">I. HD2 - Upper-case Roman Numeral</emphasis>
...
<emphasis role="bold">A. HD3 - Upper-case Letter</emphasis>
...
<emphasis role="bold">1. HD3 - numbered text</emphasis>
</programlisting>
            </figure>
            <figure>
                <title>Example 2 of Heading levels</title>
<programlisting xml:space="preserve">
<emphasis role="bold">I. HD1 - Upper-case Roman Numeral</emphasis>
...
B.  <emphasis role="bold">This is considered</emphasis> a paragraph.
...
<emphasis role="bold">A. HD2 - Upper-case Letter</emphasis>
...
<emphasis role="bold">1. HD3 - numbered text</emphasis>
</programlisting>
            </figure>
            <para>The heading issue gets even stickier because you need to determine whether
                lettered or numbered text is actually a list rather than headers.  We have built
                rules to determine an actual list from headers.</para>
        </section>
        <section>
            <title>Line Breaks vs. Carriage Returns</title>
            <para>In Word if you type a <emphasis role="bold">Shift + Enter</emphasis> you will get
                a linefeed (break) instead of a new paragraph. There are some editors  who will use
                a linefeed instead of a straight <emphasis role="bold">Enter</emphasis> because they
                don't want the extra space in front the paragraph. The problem is that in reality
                the text is actually a new paragraph and in the initial conversion from Word to
                Intermediate XML the text comes out as one long paragraph with
                    <emphasis>&lt;br/&gt;</emphasis> elements in the text. </para>
            <para>The conversion has to parse the <emphasis>&lt;br/&gt;</emphasis> elements and create
                individual  paragraphs and/or semantic elements). It is impossible to determine
                where the <emphasis>&lt;br/&gt;</emphasis> will occur in the text.  </para>
            <figure>
                <title>Actual Example of  Paragraph With Breaks</title>
<programlisting xml:space="preserve">
 &lt;uslm:p&gt;
    &lt;uslm:span&gt;&amp;lt;AGENCY TYPE='S'&amp;gt;&lt;/uslm:span&gt;
    &lt;uslm:span&gt;ENVIRONMENTAL PROTECTION AGENCY&lt;/uslm:span&gt;
    &lt;uslm:span&gt;<emphasis role="bold">&lt;uslm:br/&gt;</emphasis>&lt;/uslm:span&gt;
    &lt;uslm:span&gt;&amp;lt;DEPDOC&amp;gt;[&lt;/uslm:span&gt;
    &lt;uslm:span&gt;FRL OP-OFA-192]&lt;/uslm:span&gt;
    &lt;uslm:span&gt;<emphasis role="bold">&lt;uslm:br/&gt;</emphasis>&lt;/uslm:span&gt;
    &lt;uslm:span&gt;&amp;lt;SUBJECT&amp;gt;&lt;/uslm:span&gt;
    &lt;uslm:span&gt;Environmental Impact Statements; Notice of Availability&lt;/uslm:span&gt;
    &lt;uslm:span&gt;;&lt;/uslm:span&gt;
    &lt;uslm:span&gt;<emphasis role="bold">&lt;uslm:br/&gt;</emphasis>Responsible Agency: Office of Federal Activities, 
              General Information 202-564-5632 or &lt;/uslm:span&gt;
    &lt;uslm:span&gt;https://www.epa.gov/nepa.&lt;/uslm:span&gt;
    &lt;uslm:span&gt;<emphasis role="bold">&lt;uslm:br/&gt;</emphasis>&lt;/uslm:span&gt;
    &lt;uslm:span&gt;Weekly receipt of Environmental Impact  Statements (EIS)&lt;/uslm:span&gt;
    &lt;uslm:span&gt;<emphasis role="bold">&lt;uslm:br/&gt;</emphasis>Filed August 11, 2025 10 a.m. EST Through 
               August 18, 2025 10 a.m. EST&lt;/uslm:span&gt;
    &lt;uslm:span&gt;<emphasis role="bold">&lt;uslm:br/&gt;</emphasis>Pursuant to CEQ Guidance on 42
                USC 4332.&lt;/uslm:span&gt;
    &lt;uslm:span&gt;<emphasis role="bold">&lt;uslm:br/&gt;</emphasis>Notice: Section 309(a) of the
                Clean Air Act requires that EPA make public its comments on EISs issued by other
                Federal agencies. EPA's comment letters on EISs are available at:
                https://cdxapps.epa.gov/cdx-enepa-II/public/action/eis/search.&lt;/uslm:span&gt;
    &lt;uslm:span&gt;<emphasis role="bold">&lt;uslm:br/&gt;</emphasis>EIS No. 20250118, Draft, FEMA,
                OR,&lt;/uslm:span&gt;
    &lt;uslm:span&gt;<emphasis role="bold">&lt;uslm:br/&gt;</emphasis>Oregon Implementation Plan for
                National Floo&lt;/uslm:span&gt;
    &lt;uslm:span&gt;d Insurance Program - Endangered Species
                Act Integration, &lt;/uslm:span&gt;
    &lt;uslm:span&gt;<emphasis role="bold">&lt;uslm:br/&gt;</emphasis>Comment Period Ends:
                10/06/2025,&lt;/uslm:span&gt;
    &lt;uslm:span&gt;<emphasis role="bold">&lt;uslm:br/&gt;</emphasis>Contact: Pxxxx Rxxx ###-###-###.&lt;/uslm:span&gt;
    &lt;uslm:span&gt;<emphasis role="bold">&lt;uslm:br/&gt;</emphasis>EIS No. 20250119, Draft,  USFWS, HI,&lt;/uslm:span&gt;
    &lt;uslm:span&gt;<emphasis role="bold">&lt;uslm:br/&gt;</emphasis>Kauai Island Utility Cooperative Habitat Conservation Plan, &lt;/uslm:span&gt;
    &lt;uslm:span&gt;<emphasis role="bold">&lt;uslm:br/&gt;</emphasis>Comment Period Ends:  10/21/2025,&lt;/uslm:span&gt;
     &lt;uslm:span&gt;<emphasis role="bold">&lt;uslm:br/&gt;</emphasis>Contact: Kxx Mxxxxxx ###-###-####.&lt;/uslm:span&gt;
     &lt;uslm:span&gt;<emphasis role="bold">&lt;uslm:br/&gt;</emphasis>EIS No. 20250120, Final, BLM,  WY,&lt;/uslm:span&gt;
     &lt;uslm:span&gt;<emphasis role="bold">&lt;uslm:br/&gt;</emphasis>West Antelope III Coal Lease Application, &lt;/uslm:span&gt;
     &lt;uslm:span&gt;<emphasis role="bold">&lt;uslm:br/&gt;</emphasis>&lt;/uslm:span&gt;
     &lt;uslm:span&gt;Review Period Ends: 09/22/2025,&lt;/uslm:span&gt;
     &lt;uslm:span&gt;<emphasis role="bold">&lt;uslm:br/&gt;</emphasis>Contact: Axxxxx Exxx ###-###-####.&lt;/uslm:span&gt;
     &lt;uslm:span&gt;<emphasis role="bold">&lt;uslm:br/&gt;</emphasis>&lt;/uslm:span&gt;
 &lt;/uslm:p&gt;
</programlisting>
            </figure>
            <para>The process of breaking content into paragraphs cannot be done until the file is
                cleaned up and the <emphasis role="bold">&lt;span&gt;</emphasis> elements are merged.
                Also, unique id's are added to the <emphasis role="bold">&lt;br&gt;</emphasis>
                elements.  The id's are used to parse through the data.</para>
            <figure>
                <title>Paragraph After Merging and ID's Added</title>
<programlisting xml:space="preserve">
&lt;p class="AGENCY" id="AGENCY4-d29e12"&gt;
         &lt;element location="start"&gt;AGENCY TYPE='S'&lt;/element&gt;
         &lt;b&gt;ENVIRONMENTAL PROTECTION AGENCY&lt;/b&gt;
         <emphasis role="bold">&lt;br id="br-p2-d29e17"/&gt;</emphasis>
         &lt;element location="start"&gt;DEPDOC&lt;/element&gt;[&lt;b&gt;FRL OP-OFA-192]&lt;/b&gt;
         <emphasis role="bold">&lt;br id="br-p2-d29e23"/&gt;</emphasis>
         &lt;element location="start"&gt;SUBJECT&lt;/element&gt;
         &lt;b&gt;Environmental Impact Statements; Notice of Availability;Responsible Agency: Office of
            Federal Activities, General Information 202-564-5632 or https://www.epa.gov/nepa.&lt;/b&gt;
         <emphasis role="bold">&lt;br id="br-p2-d29e37"/&gt;</emphasis>Weekly receipt of Environmental Impact Statements 
        (EIS)<emphasis role="bold">&lt;br id="br-p1-d29e42"/&gt;</emphasis>Filed August 11, 2025 10 a.m. EST Through August 18, 2025 10 a.m.
            EST<emphasis role="bold">&lt;br id="br-p1-d29e45"/&gt;</emphasis>Pursuant to CEQ Guidance on 42 USC 4332.<emphasis role="bold">&lt;br id="br-p1-d29e48"
         /&gt;</emphasis>Notice: Section 309(a) of the Clean Air Act requires that EPA make public its comments on
         EISs issued by other Federal agencies. EPA's comment letters on EISs are available at:
            https://cdxapps.epa.gov/cdx-enepa-II/public/action/eis/search.&lt;br id="br-p1-d29e51"/&gt;EIS
         No. 20250118, Draft, FEMA, OR,<emphasis role="bold">&lt;br id="br-p1-d29e54"/&gt;</emphasis>Oregon Implementation Plan for
         National Flood Insurance Program - Endangered Species Act Integration, <emphasis role="bold">&lt;br
            id="br-p1-d29e59"/&gt;</emphasis>Comment Period Ends: 10/06/2025,<emphasis role="bold">&lt;br id="br-p1-d29e62"/&gt;</emphasis>Contact:
         Pxxxxx Rxxx ###-###-###.<emphasis role="bold">&lt;br id="br-p1-d29e65"/&gt;</emphasis>EIS No. 20250119, Draft, USFWS, HI,<emphasis role="bold">&lt;br
            id="br-p1-d29e69"/&gt;</emphasis>Kauai Island Utility Cooperative Habitat Conservation Plan, <emphasis role="bold">&lt;br
            id="br-p1-d29e72"/&gt;</emphasis>Comment Period Ends: 10/21/2025,<emphasis role="bold">&lt;br id="br-p1-d29e75"/&gt;</emphasis>Contact: Kxx
         Mxxxxxx ###-###-###.<emphasis role="bold">&lt;br id="br-p1-d29e78"/&gt;</emphasis>EIS No. 20250120, Final, BLM, WY,<emphasis role="bold">&lt;br
            id="br-p1-d29e81"/&gt;</emphasis>West Antelope III Coal Lease Application, &lt;br id="br-p2-d29e83"
         /&gt;Review Period Ends: 09/22/2025,<emphasis role="bold">&lt;br id="br-p1-d29e88"/&gt;</emphasis>Contact: Axxxxx Exxxx
         ###-###-###.&lt;/p&gt;
</programlisting>
            </figure>
            <para>Below is example code that is being used to parse a paragraph with breaks.  The
                templates <emphasis role="bold">CreateParaBeforeMarkers</emphasis> and <emphasis role="bold">CreateParaAfterMarkers</emphasis> create the markers for creating
                the hierarchy.</para>
            <figure>
                <title>Example Code for Creating Paragraphs</title>
<programlisting xml:space="preserve">
  &lt;xsl:for-each select="br"&gt;
       &lt;xsl:variable name="current-id" select="@id"/&gt;
       &lt;xsl:variable name="preceding-id" select="preceding::br[1]/@id"/&gt;
       &lt;xsl:call-template name="CreateParaBeforeMarkers"/&gt;            
       &lt;p&gt;
          &lt;xsl:call-template name="getClassAtt"&gt;
                  &lt;xsl:with-param name="firstNode" select="following-sibling::node()[1]"&gt;
                  &lt;/xsl:with-param&gt;
          &lt;/xsl:call-template&gt;
          &lt;xsl:attribute name="id"&gt;SIG-Break-3-&lt;xsl:value-of select="generate-id()"/&gt;&lt;/xsl:attribute&gt;
           &lt;xsl:iterate select="following-sibling::node()"&gt;
                 &lt;xsl:choose&gt;
                      &lt;xsl:when test="name() = 'br'"&gt;&lt;xsl:break/&gt;&lt;/xsl:when&gt;
                      &lt;xsl:otherwise&gt;
                            &lt;xsl:copy-of select="."/&gt;
                       &lt;/xsl:otherwise&gt;
                 &lt;/xsl:choose&gt;
           &lt;/xsl:iterate&gt;
                  &lt;/p&gt;
              &lt;/xsl:for-each&gt;
       &lt;/p&gt;
    &lt;xsl:call-template name="CreateParaAfterMarkers"/&gt;
</programlisting>
            </figure>
            <para>There are multiple stages between creating the paragraphs and the final output.
                Below is the resulting output from the single paragraph with <emphasis role="bold">&lt;br/&gt; </emphasis> elements.</para>
            <figure>
                <title>After Conversion</title>
<programlisting xml:space="preserve">
&lt;AGENCY&gt;ENVIRONMENTAL PROTECTION AGENCY&lt;/AGENCY&gt;
&lt;DEPDOC&gt;[FRL OP-OFA-192] &lt;/DEPDOC&gt;
&lt;SUBJECT&gt;Environmental Impact Statements; Notice of Availability;Responsible Agency: Office of Federal Activities, General Information 202-564-5632 or https://www.epa.gov/nepa. &lt;/SUBJECT&gt;
&lt;P&gt;Weekly receipt of Environmental Impact Statements (EIS)&lt;/P&gt;
&lt;P&gt;Filed August 11, 2025 10 a.m. EST Through August 18, 2025 10 a.m. EST&lt;/P&gt;
&lt;P&gt;Pursuant to CEQ Guidance on 42 USC 4332.&lt;/P&gt;
&lt;P&gt;Notice: Section 309(a) of the Clean Air Act requires that EPA make public its comments on EISs issued by other Federal agencies. EPA's comment letters on EISs are available at: https://cdxapps.epa.gov/cdx-enepa-II/public/action/eis/search.&lt;/P&gt;
&lt;P&gt;EIS No. 20250118, Draft, FEMA, OR,&lt;/P&gt;
&lt;P&gt;Oregon Implementation Plan for National Flood Insurance Program - Endangered Species Act Integration, &lt;/P&gt;
&lt;P&gt;Comment Period Ends: 10/06/2025,&lt;/P&gt;
&lt;P&gt;Contact: Portia Ross 425-487-4713.&lt;/P&gt;
&lt;P&gt;EIS No. 20250119, Draft, USFWS, HI,&lt;/P&gt;
&lt;P&gt;Kauai Island Utility Cooperative Habitat Conservation Plan, &lt;/P&gt;
&lt;P&gt;Comment Period Ends: 10/21/2025,&lt;/P&gt;
&lt;P&gt;Contact: Koa Matsuoka 808-210-6295.&lt;/P&gt;
&lt;P&gt;EIS No. 20250120, Final, BLM, WY,&lt;/P&gt;
&lt;P&gt;West Antelope III Coal Lease Application, &lt;/P&gt;
&lt;P&gt;Review Period Ends: 09/22/2025,&lt;/P&gt;
&lt;P&gt;Contact: Alfred Elser 307-775-6146.&lt;/P&gt;
</programlisting>
            </figure>
        </section>
        <section>
            <title>Table Issues</title>
            <para>We have encountered several issues when converting Word tables to XML content. </para>
            <section>
                <title>Tables Within Tables</title>
                <para>Word allows tables within tables.  In fact the original CALS model allowed
                    tables within tables.  In practice I haven't seen anyone actually use tables
                    within tables in SGML or XML.  Some organizations talked about it in theory but
                    I don't personally know of an organization that actually implemented it.</para>
                <para>We have encountered several documents which had tables within tables.  The
                    hierarchy of the tables are sometimes 4 levels deep.</para>
                <figure>
                    <title>Table Within Tables</title>
                    <mediaobject>
                        <imageobject>
                            <imagedata fileref="../../../vol31/graphics/Harvey01/Harvey01-004.jpg" format="jpg"/>
                        </imageobject>
                    </mediaobject>
                </figure>
                <para>Intermediate XML converts the Word table to HTML tables.  HTML tables also
                    allow tables within tables.  The GPO and CALS table model does not allow tables
                    within a table.</para>
                <para>This wasn't an easy problem to solve and we really haven't completely solved
                    it.  Until we can come up with a valid approach we have unwrapped the table
                    structure when a table is within a cell.  This isn't ideal but it is a
                    semi-reasonable solution until we can find a better mechanism.  Luckily we
                    haven't encountered too many of these tables.</para>
            </section>
            <section>
                <title>Table Headings and Table Notes</title>
                <para>All table headings and table notes are created outside the table in the Word
                    file.  The conversion is required to pick up the table head and place it in the
                    &lt;TTITLE&gt; element for GPO tables or &lt;title&gt; element for CALS.  The table
                    title is relatively easy if the preceding sibling of the table starts with
                        "<emphasis role="bold">Table #.</emphasis>".  However, this isn't always
                    case.  We need to evaluate the preceding sibling(s) - yes sometimes there are 2
                    paragraphs - and place the text in the appropriate element, then remove the
                    paragraph from its original location.</para>
                <para>The same goes for table notes.  GPO table model has a child element called
                        <emphasis role="bold">TNOTE</emphasis>.  The conversion iterates through the
                    following siblings that start with "(a)" or "a." or "1." and creates the TNOTE
                    or &lt;tfoot&gt; constructs.  It then removes the paragraphs from the original
                    location.</para>
            </section>
        </section>
        <section>
            <title>Word Style Differences</title>
            <para>We cannot change or modify how the Word files are constructed by the various
                organizations.  We must take what we get and process the files.  As a result, each
                organization uses their own template or no template.  Some have created their own
                named styles in the Word file.  We are able to capture the name of the style but are
                not able (currently) to determine what  that named style actually means.  We are
                looking into the possibility of pulling the style information for a named style into
                the Intermediate XML file.</para>
            <figure>
                <title>Real Example of Word Named Style</title>
<programlisting xml:space="preserve">
&lt;w:rStyle w:val="dewidow"/&gt;
</programlisting>
            </figure>
            <para>The <emphasis>w:val</emphasis> attribute gets turned into a
                    <emphasis>class</emphasis> attribute during the Word to Intermediate XML
                conversion. We are able to manually go into the Word XML file and find the
                'style.xml' file to determine how to process this information. However, this is
                always a one-off process and only done when we encounter a difference in the
                formatting from the Word to the XML.  </para>
            <para>Hopefully we will be able to capture the style from named styles in the Word file
                to the Intermediate XML file.</para>
            <para>We have also found that the 'standard' (using this term loosely) Word styles are
                not consistently formatted in the same way across organizations. A good example of
                this is the standard 'Emphasis' style in Word. Normally, the Emphasis style is
                italics. We have found instances where an organization and/or user has modified the
                standard Emphasis to mean 'bold' or no style.</para>
            <para>Once we can get all the style information included in the Intermediate XML file
                some of the issues we have encountered will go away.</para>
            <section>
                <title>Word Style Nuances</title>
                <para>A problem that we encountered in the Intermediate XML file which has been
                    solved is 'ghost' styles. Everytime a user clicks in a Word file something
                    happens. A user may create italicized or bolded text then change their mind. The
                    style attributes are still included in the underlying Word XML. Initially, the
                    unhighlighted text was being included as highlighted in the Intermediate
                    XML.</para>
                <para>We were able to get the Word to Intermediate XML conversion modified to not
                    include the highlighting based on the <emphasis>w:val</emphasis> attribute in
                    the Word file.</para>
                <figure>
                    <para>Word XML Encoding</para>
<programlisting xml:space="preserve">
&lt;w:i/&gt;           &lt;!--Italicized Text--&gt;
&lt;w:i w:val="0"/&gt; &lt;!--Text Not Italicized--&gt;


&lt;w:b/&gt;           &lt;!--Bolded Text--&gt;
&lt;w:b w:val="0"/&gt; &lt;!--Text Not Bold--&gt;
</programlisting>
                </figure>
            </section>
        </section>
        <section>
            <title>Text Manipulation</title>
            <para>We now have subject-matter experts reviewing and commenting on the converted
                files. They have been making requests for enhancing the text manipulation of the
                actual text in the file. Where possible we are trying to accommodate their requests.
                Here are a few requests that we have received and implemented.</para>
            <itemizedlist>
                <listitem>
                    <para>Move punctuation outside of formatting (italics, and bold) except for
                        phrases such as 'i.e.,', 'et al.,', etc.</para>
                </listitem>
                <listitem>
                    <para>Add italic tags to all URL's and email addresses.</para>
                </listitem>
            </itemizedlist>
            <para>Another critical part of the conversion is removing the SGML elements from the
                file.  Identifying the elements early in the process makes this relatively easy.
                However, there are occasions where and element will not get identified because of
                some anomaly in the file and we have to make adjustments to the XSLT.</para>
        </section>
    </section>
    <section>
        <title>Validation Efforts</title>
        <para>A preliminary authoring environment in Oxygen has been created by Joel Kalvesmaki.
            Joel has done an incredable job of creating an environment that enhances the
            authoring/editing process for the users. The user experience thus far has been
            excellent. A pipeline has been created that takes a Word file and passes it along to a
            service that converts the Word to USLM XML. The Word to USLM file is provided to the
            user which can then be converted to the Federal Register XML format. There are also
            postprocess scripts that looks at the file and does some clean up GPO protocol.</para>
        <para>There is a SGML Document Type Definition (DTD) has been available for the Federal
            Register for decades.  A RelaxNG schema as been developed that relies on the structure
            of the original Federal Register DTD makes some dramatic enhances.  The schema allows
            both GPO tables and OASIS-Open tables.  Currently GPO publishes the Federal Register
            using the GPO table model.  However, in the future the OASIS-Open table model will be
            used.</para>
        <para>The RelaxNG schema gets converted to an XML Schema that is used internally in
            Oxygen.</para>
        <para>Anyone who has worked with Oxygen knows that it flags any parsing errors against a
            schema. Schematron rules are  being developed to provide further validation of GPO
            rules, i.e., title casing, punctuation, etc. </para>
    </section>
    <section>
        <title>Conclusion</title>
        <para>I am sure there are many ways to approach the problem of creating XML hierarchy from
            flat files. This is just our approach. Even while I was writing this paper I found a few
            places where we could make the code more efficient. When we first embarked on this
            project we were given only a few sample files. These files were NOTICE files which are
            simplist files are normally only several pages long. </para>
        <para>However, as we started receiving more document types and more complex documents we
            found that we were dealing with a much harder problem than we anticipated. If I could go
            back to the beginning knowing what I know now I might have done a few things
            differently.</para>
    </section>
    <bibliography>
        <title>Bibliography</title>
        <bibliomixed xml:id="bharvey-uslm1"><emphasis role="bold">United State Markup Language</emphasis>, <link xlink:href="https://www.govinfo.gov/features/beta-uslm-xml" xlink:type="simple" xlink:show="new" xlink:actuate="onRequest"/></bibliomixed>
        <bibliomixed xml:id="bharvey-uslm2"><emphasis role="bold">USLM Schema and Supporting Information</emphasis>, <link xlink:href="https://github.com/usgpo/uslm" xlink:type="simple" xlink:show="new" xlink:actuate="onRequest"/></bibliomixed>
    </bibliography>
</article>