This is an automated email from the ASF dual-hosted git repository. mseidel pushed a commit to branch AOO42X in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit 38d8ef9985bec878fe9746fb94fcc1a135857da1 Author: mseidel <msei...@apache.org> AuthorDate: Sat Mar 8 07:47:20 2025 +0100 Fix typos, cleanup (cherry picked from commit a972dc1365f6e5b974cdae4f8cc04d846d2f9c46) --- .../source/xslt/odf2xhtml/export/xhtml/body.xsl | 9 ++- .../source/xslt/odf2xhtml/export/xhtml/header.xsl | 70 +++++++++++----------- .../xslt/odf2xhtml/export/xhtml/opendoc2xhtml.xsl | 22 +++---- .../source/xslt/odf2xhtml/export/xhtml/table.xsl | 24 ++++---- 4 files changed, 62 insertions(+), 63 deletions(-) diff --git a/main/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl b/main/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl index 137c45a225..e0f4202f87 100644 --- a/main/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl +++ b/main/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> + <!--*********************************************************** * * Licensed to the Apache Software Foundation (ASF) under one @@ -20,8 +21,6 @@ * ***********************************************************--> - - <!-- For further documentation and updates visit https://xml.openoffice.org/odf2xhtml --> @@ -798,7 +797,7 @@ <xsl:when test="$createDiv and normalize-space(.) != ''"> <!-- every following frame sibling till the next draw:frame have to be encapsulated within a div with left indent. - To be moved altogether according the indent (usually right) --> + To be moved altogether according to the indent (usually right) --> <xsl:comment>Next 'div' added for floating.</xsl:comment> <xsl:element name="div"> <xsl:attribute name="style"> @@ -991,7 +990,7 @@ <xsl:if test="@text:anchor-type='paragraph'"> <xsl:comment>Next 'div' is emulating the top hight of a draw:frame.</xsl:comment> <!-- When the svg:y is set relative to the paragraph content, the best way to emulate a positive height, - is to add an invisible division between with a height. + is to add an invisible division in between with a height. Often text will flow into this 'gap', which is handled separately! --> <xsl:if test="$svgY > 0"> @@ -1010,7 +1009,7 @@ <!-- <xsl:variable name="followingSibling" select="following-sibling::node()[1]"/> <xsl:choose> - HEURISTIC: if the frame is anchored on a paragraph and the above gab is big enough to hold a text line, + HEURISTIC: if the frame is anchored on a paragraph and the above gab is big enough to hold a text line, move it behind the text <xsl:when test="@text:anchor-type='paragraph' and ( diff --git a/main/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl b/main/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl index 4e1612d4b6..1514717c42 100644 --- a/main/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl +++ b/main/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl @@ -1,6 +1,7 @@ <?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 @@ -8,21 +9,20 @@ * 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. - * + * ***********************************************************--> - <!-- - For further documentation and updates visit http://xml.openoffice.org/odf2xhtml + For further documentation and updates visit https://xml.openoffice.org/odf2xhtml --> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" @@ -111,8 +111,8 @@ </xsl:text> <xsl:text>span.footnodeNumber { padding-right:1em; } </xsl:text> -<xsl:text>span.annotation_style_by_filter { font-size:95%; font-family:Arial; background-color:#fff000; margin:0; border:0; padding:0; } - </xsl:text> +<xsl:text>span.annotation_style_by_filter { font-size:95%; font-family:Arial; background-color:#fff000; margin:0; border:0; padding:0; } + </xsl:text> <xsl:text>* { margin:0;} </xsl:text> <xsl:call-template name="write-mapped-CSS-styles"> @@ -133,7 +133,7 @@ <xsl:for-each select="$globalData/all-styles/style[$styleNo]"> <xsl:choose> <xsl:when test="final-properties != ''"> - <!-- NOTE: easy process, as only the style family in conjunction with the style name, makes the style unambigous --> + <!-- NOTE: easy process, as only the style family in conjunction with the style name, makes the style unambiguous --> <xsl:text>.</xsl:text><!--<xsl:value-of select="@style:family" /><xsl:text>:</xsl:text>--><xsl:value-of select="translate(@style:name, '.,;: %()[]/\+', '_____________')"/><xsl:text> { </xsl:text> <xsl:value-of select="final-properties" /><xsl:text>} </xsl:text> <xsl:call-template name="write-mapped-CSS-styles"> @@ -168,24 +168,24 @@ <!-- approximation to find the correct master page style (with page dimensions) --> <xsl:variable name="masterPageNames"> - <!-- set context to styles.xml --> - <xsl:for-each select="$globalData/all-doc-styles/style"> - <!-- Loop over every style:style containing a @style:master-page-name attribute --> - <xsl:for-each select="key('masterPage','count')"> - <!-- set context to styles.xml --> - <xsl:for-each select="/*/office:body"> - <!-- Check if this style is being used in the body --> - <xsl:if test="key('elementUsingStyle', ../@style:name)"> - <!-- Check every master-page-name if it is not emtpy and return as ';' separated list --> - <xsl:if test="string-length(../@style:master-page-name) > 0"><xsl:value-of select="../@style:master-page-name"/>;</xsl:if> - </xsl:if> - </xsl:for-each> - </xsl:for-each> - </xsl:for-each> + <!-- set context to styles.xml --> + <xsl:for-each select="$globalData/all-doc-styles/style"> + <!-- Loop over every style:style containing a @style:master-page-name attribute --> + <xsl:for-each select="key('masterPage','count')"> + <!-- set context to styles.xml --> + <xsl:for-each select="/*/office:body"> + <!-- Check if this style is being used in the body --> + <xsl:if test="key('elementUsingStyle', ../@style:name)"> + <!-- Check every master-page-name if it is not empty and return as ';' separated list --> + <xsl:if test="string-length(../@style:master-page-name) > 0"><xsl:value-of select="../@style:master-page-name"/>;</xsl:if> + </xsl:if> + </xsl:for-each> + </xsl:for-each> + </xsl:for-each> </xsl:variable> - <!-- Take the first of the masterpage list and get the according style:master-page element and find the @style:page-layout-name --> + <!-- Take the first of the masterpage list and get the according style:master-page element and find the @style:page-layout-name --> <xsl:variable name="pageLayoutName" select="key('masterPageElements', substring-before($masterPageNames,';'))/@style:page-layout-name"/> - <!-- Find the according style:page-layout and store the properties in a variable --> + <!-- Find the according style:page-layout and store the properties in a variable --> <xsl:variable name="pageProperties" select="key('pageLayoutElements', $pageLayoutName)/style:page-layout-properties"/> <xsl:text>@page { </xsl:text> @@ -234,25 +234,25 @@ <xsl:param name="globalData" /> <xsl:param name="pageProperties" /> - <xsl:variable name="marginTop" select="$pageProperties/@fo:margin-top" /> + <xsl:variable name="marginTop" select="$pageProperties/@fo:margin-top" /> <xsl:if test="$marginTop"> <xsl:text>margin-top: </xsl:text> <xsl:value-of select="$marginTop" /> <xsl:text>; </xsl:text> </xsl:if> - <xsl:variable name="marginBottom" select="$pageProperties/@fo:margin-bottom" /> + <xsl:variable name="marginBottom" select="$pageProperties/@fo:margin-bottom" /> <xsl:if test="$marginBottom"> <xsl:text>margin-bottom: </xsl:text> <xsl:value-of select="$marginBottom" /> <xsl:text>; </xsl:text> </xsl:if> - <xsl:variable name="marginLeft" select="$pageProperties/@fo:margin-left" /> + <xsl:variable name="marginLeft" select="$pageProperties/@fo:margin-left" /> <xsl:if test="$marginLeft"> <xsl:text>margin-left: </xsl:text> <xsl:value-of select="$marginLeft" /> <xsl:text>; </xsl:text> </xsl:if> - <xsl:variable name="marginRight" select="$pageProperties/@fo:margin-right" /> + <xsl:variable name="marginRight" select="$pageProperties/@fo:margin-right" /> <xsl:if test="$marginRight"> <xsl:text>margin-right: </xsl:text> <xsl:value-of select="$marginRight" /> @@ -334,21 +334,21 @@ <xsl:element name="meta"> <xsl:attribute name="name">DCTERMS.title</xsl:attribute> <xsl:attribute name="content"> - <xsl:value-of select="$globalData/meta-file/*/office:meta/dc:title" /> + <xsl:value-of select="$globalData/meta-file/*/office:meta/dc:title" /> </xsl:attribute> <xsl:attribute name="lang" namespace="http://www.w3.org/XML/1998/namespace"> - <xsl:value-of select="$lang" /> + <xsl:value-of select="$lang" /> </xsl:attribute> </xsl:element> - <!-- the identifier for source (identifier) --> + <!-- the identifier for source (identifier) --> <xsl:call-template name="add-meta-tag"> <xsl:with-param name="meta-name" select="'DCTERMS.identifier'" /> <xsl:with-param name="meta-data" select="translate($netloc, ' ','')" /> <xsl:with-param name="meta-enc" select="'DCTERMS.URI'" /> </xsl:call-template> - <!-- the language for source (language) --> + <!-- the language for source (language) --> <xsl:call-template name="add-meta-tag"> <xsl:with-param name="meta-name" select="'DCTERMS.language'" /> <xsl:with-param name="meta-data" select="$lang" /> @@ -437,11 +437,11 @@ <link rel="transformation" href="http://xml.openoffice.org/odf2xhtml/rdf-extract.xsl" /> --> - <!-- base URL of document for resolving relative links + <!-- base URL of document for resolving relative links NOTE: CHROME has a problem, with relative references as from content table, referencing to root directory instead of document <xsl:element name="base"> <xsl:attribute name="href">--> - <!-- earlier 'targetURL' was used for an absoulte reference of base provided by the Office (file URL) + <!-- earlier 'targetURL' was used for an absolute reference of base provided by the Office (file URL) <xsl:value-of select="$targetURL" /> now '.' let relative links work, even if document has been moved --> <!--<xsl:text>.</xsl:text> diff --git a/main/filter/source/xslt/odf2xhtml/export/xhtml/opendoc2xhtml.xsl b/main/filter/source/xslt/odf2xhtml/export/xhtml/opendoc2xhtml.xsl index 020e43c949..6293723916 100644 --- a/main/filter/source/xslt/odf2xhtml/export/xhtml/opendoc2xhtml.xsl +++ b/main/filter/source/xslt/odf2xhtml/export/xhtml/opendoc2xhtml.xsl @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> + <!--*********************************************************** * * Licensed to the Apache Software Foundation (ASF) under one @@ -20,7 +21,6 @@ * ***********************************************************--> - <!-- For further documentation and updates visit https://xml.openoffice.org/odf2xhtml --> @@ -103,7 +103,7 @@ <!-- OPTIONAL: (MANDATORY: for session management by URL rewriting) Useful for WebApplications: if a HTTP session is not cookie based, URL rewriting is being used (the session is appended to the URL). - This URL session is used for example when links to graphics are created by XSLT. Otherwise the user has to log in again for every graphic he likes to see. --> + This URL session is used for example when links to graphics are created by XSLT. Otherwise the user has to log again in for every graphic he likes to see. --> <xsl:param name="optionalURLSuffix" /> <!-- OPTIONAL: URL to office meta file (flat xml use the URL to the input file) --> @@ -113,12 +113,12 @@ <xsl:param name="stylesFileURL" /> <!-- OPTIONAL: DPI (dots per inch) the standard resolution of given pictures (necessary for the conversion of 'cm' into 'pixel')--> - <!-- Although many pictures have a 96 dpi resolution, a higher resolution gives better results for common browsers --> + <!-- Although many pictures have a 96 dpi resolution, a higher resolution give better results for common browsers --> <!-- Cp. measure_conversion.xsl: <xsl:param name="dpi" select="111" /> --> - <!-- OPTIONAL: in case of using a different processor than a JAVA XSLT, you can enable the Java functionality + <!-- OPTIONAL: in case of using a different processor than a JAVA XSLT, you can unable the Java functionality (e.g. encoding chapter names for the content-table as href and anchors ) --> <xsl:param name="java" select="true()" /> <xsl:param name="javaEnabled" select="boolean($java)" /> @@ -129,16 +129,16 @@ <xsl:param name="onlyStyleOutput" select="false()" /> <xsl:param name="onlyStyleOutputEnabled" select="boolean($onlyStyleOutput)" /> - <!-- *************************************** --> - <!-- *** build the appropriate HTML file *** --> - <!-- *************************************** --> + <!-- ************************************* --> + <!-- *** build the propriate HTML file *** --> + <!-- ************************************* --> <xsl:template match="/"> <!-- debug output of parameter value set --> <xsl:if test="$debugEnabled"> - <xsl:call-template name="debug-check-parameter" /> + <xsl:call-template name="debug-check-paramter" /> </xsl:if> <!-- gathers style properties and - returns them as globalData parameter to the 'start-main' template --> + returns them as globalData parameter to the 'start-main' template --> <xsl:call-template name="collect-global-odf-properties" /> </xsl:template> @@ -150,7 +150,7 @@ <xsl:param name="globalData" /> <xsl:element name="html"> - <xsl:comment>This file was converted to xhtml by Apache OpenOffice - see https://xml.openoffice.org/odf2xhtml for more info.</xsl:comment> + <xsl:comment>This file was converted to xhtml by OpenOffice.org - see http://xml.openoffice.org/odf2xhtml for more info.</xsl:comment> <xsl:call-template name='create-header'> <xsl:with-param name="globalData" select="$globalData" /> </xsl:call-template> @@ -164,7 +164,7 @@ <!-- debug purpose only: verbose checking of the parameters of this template--> - <xsl:template name="debug-check-parameter"> + <xsl:template name="debug-check-paramter"> <xsl:message>Parameter dpi: <xsl:value-of select="$dpi" /></xsl:message> <xsl:message>Parameter metaFileURL: <xsl:value-of select="$metaFileURL" /></xsl:message> <xsl:message>Parameter stylesFileURL: <xsl:value-of select="$stylesFileURL" /></xsl:message> diff --git a/main/filter/source/xslt/odf2xhtml/export/xhtml/table.xsl b/main/filter/source/xslt/odf2xhtml/export/xhtml/table.xsl index 93e535faf0..1de977a5b1 100644 --- a/main/filter/source/xslt/odf2xhtml/export/xhtml/table.xsl +++ b/main/filter/source/xslt/odf2xhtml/export/xhtml/table.xsl @@ -1,6 +1,7 @@ <?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 @@ -8,21 +9,20 @@ * 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. - * + * ***********************************************************--> - <!-- - For further documentation and updates visit http://xml.openoffice.org/odf2xhtml + For further documentation and updates visit https://xml.openoffice.org/odf2xhtml --> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" @@ -122,7 +122,7 @@ The cell-style depends on two attributes: - 1) table:style-name - the style properties of cell. When they exist, a default alignement (cp. below) will be added for the + 1) table:style-name - the style properties of cell. When they exist, a default alignment (cp. below) will be added for the case of no alignment in the style exist. 2) office:value-type - the value type of the table-cell giving the default alignments. @@ -207,11 +207,11 @@ <!-- set column style (disjunct of cell style) --> <xsl:value-of select="$globalData/all-styles/style[@style:name = $currentTableColumn/@table:style-name]/final-properties" /> - </xsl:attribute> + </xsl:attribute> - <!-- cell style header --> - <xsl:attribute name="class"> - <xsl:value-of select="translate($styleName, '.,;: %()[]/\+', '_____________')"/> - </xsl:attribute> + <!-- cell style header --> + <xsl:attribute name="class"> + <xsl:value-of select="translate($styleName, '.,;: %()[]/\+', '_____________')"/> + </xsl:attribute> </xsl:template> </xsl:stylesheet>