bungeni-org / bungeni-editor

The Bungeni Editor is Drafting and Markup framework for XML production built on the OpenOffice.org platform. It supports different legislative document types (e.g hansard, bill) and supports definition of custom types, and allows markup and storage of metadata within the ODF document.
3 stars 0 forks source link

Incorrect translation of <from> attribute in speeches #38

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The editor uses text-reference marks to markup the <from> attribute in the text.

The translator attempts to interpret the <from> markup as both a 'reference' 
and as the 'from' 
markup.

This results in incorrect translation of marked up text as :

<from><ref href="33">Emanuel Ongeri:</ref></from>

instead of :

<from>Emanuel Ongeri:</from>

further -- there is loss of data with the translation as paragraph text 
appearing inline with the 
<from /> is lost... (i.e. text appearing in the same line as <from /> is lost.

Original issue reported on code.google.com by ashok.ha...@gmail.com on 3 Aug 2009 at 9:24

GoogleCodeExporter commented 9 years ago
A conditional was added to the <ref> xslt translation :

    <xsl:template match="*[@name='ref']">
        <xsl:if test="@href">
            <xsl:if test="@class">
                <xsl:choose>
                    <!--check if speechBy attribute exists in metalex output, if true  then generate a 'from' 
-->
                    <xsl:when test="@class='BungeniSpeechBy'">
                        <from>
                            <xsl:value-of select="."/>
                        </from>
                    </xsl:when>
                    <!-- otherwise generate normal reference -->
                    <xsl:otherwise>
                         <ref>
                           <xsl:attribute name="href"><xsl:value-of select="@href"/></xsl:attribute>
                         </ref>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:if>
        </xsl:if>
        <xsl:apply-templates/>
    </xsl:template>

instead of :

        <ref>
            <xsl:if test="@href">
                <xsl:attribute name="href"><xsl:value-of select="@href" /></xsl:attribute>
            </xsl:if>
         </ref> 

Original comment by ashok.ha...@gmail.com on 3 Aug 2009 at 9:26

GoogleCodeExporter commented 9 years ago

Original comment by ashok.ha...@gmail.com on 3 Aug 2009 at 9:27