Edit C:\galaxie\deploy\res\generation_pdf\xsl\auxiliary.xsl
<?xml version="1.0" encoding="UTF-8"?> <!-- =============================================== This stylesheet defines named templates for common tasks: 1. conversion of hexadecimal color values from Word to XSL-FO; 2. substitution of Unicode for character codes in symbol fonts; 3. normalization of font family names; 4. parsing of 'CSS style'-like structures; 5. page number format setting. ==================================================== --> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:my="dummy.namespace" version="1.0"> <xsl:output method="xml" version="1.0" indent="no" encoding="utf-8" /> <!-- ======================= --> <!-- Custom recording tables --> <!-- ======================= --> <!-- =========== --> <!-- Symbol font --> <!-- =========== --> <!-- 03/06/2006: Provided a comprehensive recoding table for many more Symbol characters --> <!-- Attention! If you use @code or @entity attribute value (also for searching), you should use only first character of attribute value! --> <!-- In some cases value of attributes @code and @entity is doubled for compatibility reason. --> <!-- See http://www.w3.org/TR/xslt#attribute-value-templates 7.6.2 Attribute Value Templates --> <!-- It is an error if a right curly brace occurs in an attribute value template outside an expression without being followed by a second right curly brace. --> <my:recoding-table font="Symbol"> <my:char code="!" value="21" altvalue="F021" entity="!"/> <!--EXCLAMATION MARK--> <my:char code=""" value="22" altvalue="F022" entity="∀"/> <!--FOR ALL--> <my:char code="#" value="23" altvalue="F023" entity="#"/> <!--NUMBER SIGN--> <my:char code="$" value="24" altvalue="F024" entity="∃"/> <!--THERE EXISTS--> <my:char code="%" value="25" altvalue="F025" entity="%"/> <!--PERCENT SIGN--> <my:char code="&" value="26" altvalue="F026" entity="&"/> <!--AMPERSAND--> <my:char code="'" value="27" altvalue="F027" entity="∍"/> <!--SMALL CONTAINS AS MEMBER--> <my:char code="(" value="28" altvalue="F028" entity="("/> <!--LEFT PARENTHESIS--> <my:char code=")" value="29" altvalue="F029" entity=")"/> <!--RIGHT PARENTHESIS--> <my:char code="*" value="2A" altvalue="F02A" entity="∗"/> <!--ASTERISK OPERATOR--> <my:char code="+" value="2B" altvalue="F02B" entity="+"/> <!--PLUS SIGN--> <my:char code="," value="2C" altvalue="F02C" entity=","/> <!--COMMA--> <my:char code="-" value="2D" altvalue="F02D" entity="−"/> <!--MINUS SIGN--> <my:char code="." value="2E" altvalue="F02E" entity="."/> <!--FULL STOP--> <my:char code="/" value="2F" altvalue="F02F" entity="/"/> <!--SOLIDUS--> <my:char code="0" value="30" altvalue="F030" entity="0"/> <!--DIGIT ZERO--> <my:char code="1" value="31" altvalue="F031" entity="1"/> <!--DIGIT ONE--> <my:char code="2" value="32" altvalue="F032" entity="2"/> <!--DIGIT TWO--> <my:char code="3" value="33" altvalue="F033" entity="3"/> <!--DIGIT THREE--> <my:char code="4" value="34" altvalue="F034" entity="4"/> <!--DIGIT FOUR--> <my:char code="5" value="35" altvalue="F035" entity="5"/> <!--DIGIT FIVE--> <my:char code="6" value="36" altvalue="F036" entity="6"/> <!--DIGIT SIX--> <my:char code="7" value="37" altvalue="F037" entity="7"/> <!--DIGIT SEVEN--> <my:char code="8" value="38" altvalue="F038" entity="8"/> <!--DIGIT EIGHT--> <my:char code="9" value="39" altvalue="F039" entity="9"/> <!--DIGIT NINE--> <my:char code=":" value="3A" altvalue="F03A" entity=":"/> <!--COLON--> <my:char code=";" value="3B" altvalue="F03B" entity=";"/> <!--SEMICOLON--> <my:char code="<" value="3C" altvalue="F03C" entity="<"/> <!--LESS-THAN SIGN--> <my:char code="=" value="3D" altvalue="F03D" entity="="/> <!--EQUALS SIGN--> <my:char code=">" value="3E" altvalue="F03E" entity=">"/> <!--GREATER-THAN SIGN--> <my:char code="?" value="3F" altvalue="F03F" entity="?"/> <!--QUESTION MARK--> <my:char code="@" value="40" altvalue="F040" entity="≅"/> <!--APPROXIMATELY EQUAL TO--> <my:char code="A" value="41" altvalue="F041" entity="Α"/> <!--GREEK CAPITAL LETTER ALPHA--> <my:char code="B" value="42" altvalue="F042" entity="Β"/> <!--GREEK CAPITAL LETTER BETA--> <my:char code="C" value="43" altvalue="F043" entity="Χ"/> <!--GREEK CAPITAL LETTER CHI--> <my:char code="D" value="44" altvalue="F044" entity="Δ"/> <!--GREEK CAPITAL LETTER DELTA--> <my:char code="E" value="45" altvalue="F045" entity="Ε"/> <!--GREEK CAPITAL LETTER EPSILON--> <my:char code="F" value="46" altvalue="F046" entity="Φ"/> <!--GREEK CAPITAL LETTER PHI--> <my:char code="G" value="47" altvalue="F047" entity="Γ"/> <!--GREEK CAPITAL LETTER GAMMA--> <my:char code="H" value="48" altvalue="F048" entity="Η"/> <!--GREEK CAPITAL LETTER ETA--> <my:char code="I" value="49" altvalue="F049" entity="Ι"/> <!--GREEK CAPITAL LETTER IOTA--> <my:char code="J" value="4A" altvalue="F04A" entity="ϑ"/> <!--GREEK THETA SYMBOL--> <my:char code="K" value="4B" altvalue="F04B" entity="Κ"/> <!--GREEK CAPITAL LETTER KAPPA--> <my:char code="L" value="4C" altvalue="F04C" entity="Λ"/> <!--GREEK CAPITAL LETTER LAMDA--> <my:char code="M" value="4D" altvalue="F04D" entity="Μ"/> <!--GREEK CAPITAL LETTER MU--> <my:char code="N" value="4E" altvalue="F04E" entity="Ν"/> <!--GREEK CAPITAL LETTER NU--> <my:char code="O" value="4F" altvalue="F04F" entity="Ο"/> <!--GREEK CAPITAL LETTER OMICRON--> <my:char code="P" value="50" altvalue="F050" entity="Π"/> <!--GREEK CAPITAL LETTER PI--> <my:char code="Q" value="51" altvalue="F051" entity="Θ"/> <!--GREEK CAPITAL LETTER THETA--> <my:char code="R" value="52" altvalue="F052" entity="Ρ"/> <!--GREEK CAPITAL LETTER RHO--> <my:char code="S" value="53" altvalue="F053" entity="Σ"/> <!--GREEK CAPITAL LETTER SIGMA--> <my:char code="T" value="54" altvalue="F054" entity="Τ"/> <!--GREEK CAPITAL LETTER TAU--> <my:char code="U" value="55" altvalue="F055" entity="Υ"/> <!--GREEK CAPITAL LETTER UPSILON--> <my:char code="V" value="56" altvalue="F056" entity="ς"/> <!--GREEK SMALL LETTER FINAL SIGMA--> <my:char code="W" value="57" altvalue="F057" entity="Ω"/> <!--GREEK CAPITAL LETTER OMEGA--> <my:char code="X" value="58" altvalue="F058" entity="Ξ"/> <!--GREEK CAPITAL LETTER XI--> <my:char code="Y" value="59" altvalue="F059" entity="Ψ"/> <!--GREEK CAPITAL LETTER PSI--> <my:char code="Z" value="5A" altvalue="F05A" entity="Ζ"/> <!--GREEK CAPITAL LETTER ZETA--> <my:char code="[" value="5B" altvalue="F05B" entity="["/> <!--LEFT SQUARE BRACKET--> <my:char code="\" value="5C" altvalue="F05C" entity="∴"/> <!--THEREFORE--> <my:char code="]" value="5D" altvalue="F05D" entity="]"/> <!--RIGHT SQUARE BRACKET--> <my:char code="^" value="5E" altvalue="F05E" entity="⊥"/> <!--UP TACK--> <my:char code="_" value="5F" altvalue="F05F" entity="_"/> <!--LOW LINE--> <my:char code="`" value="60" altvalue="F060" entity="‾"/> <!--radical extender # corporate char--> <my:char code="a" value="61" altvalue="F061" entity="α"/> <!--GREEK SMALL LETTER ALPHA--> <my:char code="b" value="62" altvalue="F062" entity="β"/> <!--GREEK SMALL LETTER BETA--> <my:char code="c" value="63" altvalue="F063" entity="χ"/> <!--GREEK SMALL LETTER CHI--> <my:char code="d" value="64" altvalue="F064" entity="δ"/> <!--GREEK SMALL LETTER DELTA--> <my:char code="e" value="65" altvalue="F065" entity="ε"/> <!--GREEK SMALL LETTER EPSILON--> <my:char code="f" value="66" altvalue="F066" entity="φ"/> <!--GREEK SMALL LETTER PHI--> <my:char code="g" value="67" altvalue="F067" entity="γ"/> <!--GREEK SMALL LETTER GAMMA--> <my:char code="h" value="68" altvalue="F068" entity="η"/> <!--GREEK SMALL LETTER ETA--> <my:char code="i" value="69" altvalue="F069" entity="ι"/> <!--GREEK SMALL LETTER IOTA--> <my:char code="j" value="6A" altvalue="F06A" entity="ϖ"/> <!--GREEK PHI SYMBOL--> <my:char code="k" value="6B" altvalue="F06B" entity="κ"/> <!--GREEK SMALL LETTER KAPPA--> <my:char code="l" value="6C" altvalue="F06C" entity="λ"/> <!--GREEK SMALL LETTER LAMDA--> <my:char code="m" value="6D" altvalue="F06D" entity="μ"/> <!--GREEK SMALL LETTER MU--> <my:char code="n" value="6E" altvalue="F06E" entity="ν"/> <!--GREEK SMALL LETTER NU--> <my:char code="o" value="6F" altvalue="F06F" entity="ο"/> <!--GREEK SMALL LETTER OMICRON--> <my:char code="p" value="70" altvalue="F070" entity="π"/> <!--GREEK SMALL LETTER PI--> <my:char code="q" value="71" altvalue="F071" entity="θ"/> <!--GREEK SMALL LETTER THETA--> <my:char code="r" value="72" altvalue="F072" entity="ρ"/> <!--GREEK SMALL LETTER RHO--> <my:char code="s" value="73" altvalue="F073" entity="σ"/> <!--GREEK SMALL LETTER SIGMA--> <my:char code="t" value="74" altvalue="F074" entity="τ"/> <!--GREEK SMALL LETTER TAU--> <my:char code="u" value="75" altvalue="F075" entity="υ"/> <!--GREEK SMALL LETTER UPSILON--> <my:char code="v" value="76" altvalue="F076" entity="ϖ"/> <!--GREEK PI SYMBOL--> <my:char code="w" value="77" altvalue="F077" entity="ω"/> <!--GREEK SMALL LETTER OMEGA--> <my:char code="x" value="78" altvalue="F078" entity="ξ"/> <!--GREEK SMALL LETTER XI--> <my:char code="y" value="79" altvalue="F079" entity="ψ"/> <!--GREEK SMALL LETTER PSI--> <my:char code="z" value="7A" altvalue="F07A" entity="ζ"/> <!--GREEK SMALL LETTER ZETA--> <!--<my:char code="{" value="7B" altvalue="F07B" entity="{"/>--> <!--LEFT CURLY BRACKET--> <my:char code="{{" value="7B" altvalue="F07B" entity="{{"/> <!--LEFT CURLY BRACKET--> <my:char code="|" value="7C" altvalue="F07C" entity="|"/> <!--VERTICAL LINE--> <!--<my:char code="}" value="7D" altvalue="F07D" entity="}"/>--> <!--RIGHT CURLY BRACKET--> <my:char code="}}" value="7D" altvalue="F07D" entity="}}"/> <!--RIGHT CURLY BRACKET--> <my:char code="~" value="7E" altvalue="F07E" entity="∼"/> <!--TILDE OPERATOR--> <my:char code=" " value="A0" altvalue="F0A0" entity="€"/> <!--EURO SIGN--> <my:char code="¡" value="A1" altvalue="F0A1" entity="ϒ"/> <!--GREEK UPSILON WITH HOOK SYMBOL--> <my:char code="¢" value="A2" altvalue="F0A2" entity="′"/> <!--PRIME # minute--> <my:char code="£" value="A3" altvalue="F0A3" entity="≤"/> <!--LESS-THAN OR EQUAL TO--> <my:char code="¤" value="A4" altvalue="F0A4" entity="⁄"/> <!--FRACTION SLASH--> <my:char code="¥" value="A5" altvalue="F0A5" entity="∞"/> <!--INFINITY--> <my:char code="¦" value="A6" altvalue="F0A6" entity="ƒ"/> <!--LATIN SMALL LETTER F WITH HOOK--> <my:char code="§" value="A7" altvalue="F0A7" entity="♣"/> <!--BLACK CLUB SUIT--> <my:char code="¨" value="A8" altvalue="F0A8" entity="♦"/> <!--BLACK DIAMOND SUIT--> <my:char code="©" value="A9" altvalue="F0A9" entity="♥"/> <!--BLACK HEART SUIT--> <my:char code="ª" value="AA" altvalue="F0AA" entity="♠"/> <!--BLACK SPADE SUIT--> <my:char code="«" value="AB" altvalue="F0AB" entity="↔"/> <!--LEFT RIGHT ARROW--> <my:char code="¬" value="AC" altvalue="F0AC" entity="←"/> <!--LEFTWARDS ARROW--> <my:char code="­" value="AD" altvalue="F0AD" entity="↑"/> <!--UPWARDS ARROW--> <my:char code="®" value="AE" altvalue="F0AE" entity="→"/> <!--RIGHTWARDS ARROW--> <my:char code="¯" value="AF" altvalue="F0AF" entity="↓"/> <!--DOWNWARDS ARROW--> <my:char code="°" value="B0" altvalue="F0B0" entity="°"/> <!--DEGREE SIGN--> <my:char code="±" value="B1" altvalue="F0B1" entity="±"/> <!--PLUS-MINUS SIGN--> <my:char code="²" value="B2" altvalue="F0B2" entity="″"/> <!--DOUBLE PRIME # second--> <my:char code="³" value="B3" altvalue="F0B3" entity="≥"/> <!--GREATER-THAN OR EQUAL TO--> <my:char code="´" value="B4" altvalue="F0B4" entity="×"/> <!--MULTIPLICATION SIGN--> <my:char code="µ" value="B5" altvalue="F0B5" entity="∝"/> <!--PROPORTIONAL TO--> <my:char code="¶" value="B6" altvalue="F0B6" entity="∂"/> <!--PARTIAL DIFFERENTIAL--> <my:char code="·" value="B7" altvalue="F0B7" entity="•"/> <!--BULLET--> <my:char code="¸" value="B8" altvalue="F0B8" entity="÷"/> <!--DIVISION SIGN--> <my:char code="¹" value="B9" altvalue="F0B9" entity="≠"/> <!--NOT EQUAL TO--> <my:char code="º" value="BA" altvalue="F0BA" entity="≡"/> <!--IDENTICAL TO--> <my:char code="»" value="BB" altvalue="F0BB" entity="≈"/> <!--ALMOST EQUAL TO--> <my:char code="¼" value="BC" altvalue="F0BC" entity="…"/> <!--HORIZONTAL ELLIPSIS--> <my:char code="½" value="BD" altvalue="F0BD" entity="⏐"/> <!--VERTICAL LINE EXTENSION (for arrows) # for Unicode 4.0 and later--> <my:char code="¾" value="BE" altvalue="F0BE" entity="⎯"/> <!--HORIZONTAL LINE EXTENSION (for arrows) # for Unicode 3.2 and later--> <my:char code="¿" value="BF" altvalue="F0BF" entity="↵"/> <!--DOWNWARDS ARROW WITH CORNER LEFTWARDS--> <my:char code="À" value="C0" altvalue="F0C0" entity="ℵ"/> <!--ALEF SYMBOL--> <my:char code="Á" value="C1" altvalue="F0C1" entity="ℑ"/> <!--BLACK-LETTER CAPITAL I--> <my:char code="Â" value="C2" altvalue="F0C2" entity="ℜ"/> <!--BLACK-LETTER CAPITAL R--> <my:char code="Ã" value="C3" altvalue="F0C3" entity="℘"/> <!--SCRIPT CAPITAL P--> <my:char code="Ä" value="C4" altvalue="F0C4" entity="⊗"/> <!--CIRCLED TIMES--> <my:char code="Å" value="C5" altvalue="F0C5" entity="⊕"/> <!--CIRCLED PLUS--> <my:char code="Æ" value="C6" altvalue="F0C6" entity="∅"/> <!--EMPTY SET--> <my:char code="Ç" value="C7" altvalue="F0C7" entity="∩"/> <!--INTERSECTION--> <my:char code="È" value="C8" altvalue="F0C8" entity="∪"/> <!--UNION--> <my:char code="É" value="C9" altvalue="F0C9" entity="⊃"/> <!--SUPERSET OF--> <my:char code="Ê" value="CA" altvalue="F0CA" entity="⊇"/> <!--SUPERSET OF OR EQUAL TO--> <my:char code="Ë" value="CB" altvalue="F0CB" entity="⊄"/> <!--NOT A SUBSET OF--> <my:char code="Ì" value="CC" altvalue="F0CC" entity="⊂"/> <!--SUBSET OF--> <my:char code="Í" value="CD" altvalue="F0CD" entity="⊆"/> <!--SUBSET OF OR EQUAL TO--> <my:char code="Î" value="CE" altvalue="F0CE" entity="∈"/> <!--ELEMENT OF--> <my:char code="Ï" value="CF" altvalue="F0CF" entity="∉"/> <!--NOT AN ELEMENT OF--> <my:char code="Ð" value="D0" altvalue="F0D0" entity="∠"/> <!--ANGLE--> <my:char code="Ñ" value="D1" altvalue="F0D1" entity="∇"/> <!--NABLA--> <my:char code="Ò" value="D2" altvalue="F0D2" entity="®"/> <!--REGISTERED SIGN # serif--> <my:char code="Ó" value="D3" altvalue="F0D3" entity="©"/> <!--COPYRIGHT SIGN # serif--> <my:char code="Ô" value="D4" altvalue="F0D4" entity="™"/> <!--TRADE MARK SIGN # serif--> <my:char code="Õ" value="D5" altvalue="F0D5" entity="∏"/> <!--N-ARY PRODUCT--> <my:char code="Ö" value="D6" altvalue="F0D6" entity="√"/> <!--SQUARE ROOT--> <my:char code="×" value="D7" altvalue="F0D7" entity="ยท"/> <!--DOT OPERATOR--> <my:char code="Ø" value="D8" altvalue="F0D8" entity="¬"/> <!--NOT SIGN--> <my:char code="Ù" value="D9" altvalue="F0D9" entity="∧"/> <!--LOGICAL AND--> <my:char code="Ú" value="DA" altvalue="F0DA" entity="∨"/> <!--LOGICAL OR--> <my:char code="Û" value="DB" altvalue="F0DB" entity="⇔"/> <!--LEFT RIGHT DOUBLE ARROW--> <my:char code="Ü" value="DC" altvalue="F0DC" entity="⇐"/> <!--LEFTWARDS DOUBLE ARROW--> <my:char code="Ý" value="DD" altvalue="F0DD" entity="⇑"/> <!--UPWARDS DOUBLE ARROW--> <my:char code="Þ" value="DE" altvalue="F0DE" entity="⇒"/> <!--RIGHTWARDS DOUBLE ARROW--> <my:char code="ß" value="DF" altvalue="F0DF" entity="⇓"/> <!--DOWNWARDS DOUBLE ARROW--> <my:char code="à" value="E0" altvalue="F0E0" entity="⋄"/> <!--DIAMOND OPERATOR--> <my:char code="á" value="E1" altvalue="F0E1" entity="〈"/> <!--LEFT ANGLE BRACKET--> <my:char code="â" value="E2" altvalue="F0E2" entity="®"/> <!--REGISTERED SIGN # sans serif--> <my:char code="ã" value="E3" altvalue="F0E3" entity="©"/> <!--COPYRIGHT SIGN # sans serif--> <my:char code="ä" value="E4" altvalue="F0E4" entity="™"/> <!--TRADE MARK SIGN # sans serif--> <my:char code="å" value="E5" altvalue="F0E5" entity="∑"/> <!--N-ARY SUMMATION--> <my:char code="æ" value="E6" altvalue="F0E6" entity="⎛"/> <!--LEFT PARENTHESIS UPPER HOOK # for Unicode 3.2 and later--> <my:char code="ç" value="E7" altvalue="F0E7" entity="⎜"/> <!--LEFT PARENTHESIS EXTENSION # for Unicode 3.2 and later--> <my:char code="è" value="E8" altvalue="F0E8" entity="⎝"/> <!--LEFT PARENTHESIS LOWER HOOK # for Unicode 3.2 and later--> <my:char code="é" value="E9" altvalue="F0E9" entity="⎡"/> <!--LEFT SQUARE BRACKET UPPER CORNER # for Unicode 3.2 and later--> <my:char code="ê" value="EA" altvalue="F0EA" entity="⎢"/> <!--LEFT SQUARE BRACKET EXTENSION # for Unicode 3.2 and later--> <my:char code="ë" value="EB" altvalue="F0EB" entity="⎣"/> <!--LEFT SQUARE BRACKET LOWER CORNER # for Unicode 3.2 and later--> <my:char code="ì" value="EC" altvalue="F0EC" entity="⎧"/> <!--LEFT CURLY BRACKET UPPER HOOK # for Unicode 3.2 and later--> <my:char code="í" value="ED" altvalue="F0ED" entity="⎨"/> <!--LEFT CURLY BRACKET MIDDLE PIECE # for Unicode 3.2 and later--> <my:char code="î" value="EE" altvalue="F0EE" entity="⎩"/> <!--LEFT CURLY BRACKET LOWER HOOK # for Unicode 3.2 and later--> <my:char code="ï" value="EF" altvalue="F0EF" entity="⎪"/> <!--CURLY BRACKET EXTENSION # for Unicode 3.2 and later--> <my:char code="ð" value="F0" altvalue="F0F0" entity=""/> <!--Apple logo--> <my:char code="ñ" value="F1" altvalue="F0F1" entity="〉"/> <!--RIGHT ANGLE BRACKET--> <my:char code="ò" value="F2" altvalue="F0F2" entity="∫"/> <!--INTEGRAL--> <my:char code="ó" value="F3" altvalue="F0F3" entity="⌠"/> <!--TOP HALF INTEGRAL--> <my:char code="ô" value="F4" altvalue="F0F4" entity="⎮"/> <!--INTEGRAL EXTENSION # for Unicode 3.2 and later--> <my:char code="õ" value="F5" altvalue="F0F5" entity="⌡"/> <!--BOTTOM HALF INTEGRAL--> <my:char code="ö" value="F6" altvalue="F0F6" entity="⎞"/> <!--RIGHT PARENTHESIS UPPER HOOK # for Unicode 3.2 and later--> <my:char code="÷" value="F7" altvalue="F0F7" entity="⎟"/> <!--RIGHT PARENTHESIS EXTENSION # for Unicode 3.2 and later--> <my:char code="ø" value="F8" altvalue="F0F8" entity="⎠"/> <!--RIGHT PARENTHESIS LOWER HOOK # for Unicode 3.2 and later--> <my:char code="ù" value="F9" altvalue="F0F9" entity="⎤"/> <!--RIGHT SQUARE BRACKET UPPER CORNER # for Unicode 3.2 and later--> <my:char code="ú" value="FA" altvalue="F0FA" entity="⎥"/> <!--RIGHT SQUARE BRACKET EXTENSION # for Unicode 3.2 and later--> <my:char code="û" value="FB" altvalue="F0FB" entity="⎦"/> <!--RIGHT SQUARE BRACKET LOWER CORNER # for Unicode 3.2 and later--> <my:char code="ü" value="FC" altvalue="F0FC" entity="⎫"/> <!--RIGHT CURLY BRACKET UPPER HOOK # for Unicode 3.2 and later--> <my:char code="ý" value="FD" altvalue="F0FD" entity="⎬"/> <!--RIGHT CURLY BRACKET MIDDLE PIECE # for Unicode 3.2 and later--> <my:char code="þ" value="FE" altvalue="F0FE" entity="⎭"/> <!--RIGHT CURLY BRACKET LOWER HOOK # for Unicode 3.2 and later--> </my:recoding-table> <!-- ============== --> <!-- Wingdings font --> <!-- ============== --> <!-- 03/06/2006: Provided a comprehensive recoding table for many more Wingdings characters --> <!-- Attention! If you use @code or @entity attribute value (also for searching), you should use only first character of attribute value! --> <!-- In some cases value of attributes @code and @entity is doubled for compatibility reason. --> <!-- See http://www.w3.org/TR/xslt#attribute-value-templates 7.6.2 Attribute Value Templates --> <!-- It is an error if a right curly brace occurs in an attribute value template outside an expression without being followed by a second right curly brace. --> <my:recoding-table font="Wingdings"> <my:char code=""" value="22" altvalue="F022" entity="✂"/> <my:char code="#" value="23" altvalue="F023" entity="✁"/> <my:char code="(" value="28" altvalue="F028" entity="☎"/> <my:char code="*" value="2A" altvalue="F02A" entity="✉"/> <my:char code=">" value="3E" altvalue="F03E" entity="☢"/> <my:char code="?" value="3F" altvalue="F03F" entity="✍"/> <my:char code="A" value="41" altvalue="F041" entity="✌"/> <my:char code="F" value="46" altvalue="F046" entity="☞"/> <my:char code="L" value="4C" altvalue="F04C" entity="☹"/> <my:char code="X" value="58" altvalue="F058" entity="✠"/> <my:char code="Y" value="59" altvalue="F059" entity="✡"/> <my:char code="Z" value="5A" altvalue="F05A" entity="☪"/> <my:char code="[" value="5B" altvalue="F05B" entity="☯"/> <my:char code="]" value="5D" altvalue="F05D" entity="☸"/> <my:char code="R" value="52" altvalue="F052" entity="☼"/> <my:char code="^" value="5E" altvalue="F05E" entity="♈"/> <my:char code="_" value="5F" altvalue="F05F" entity="♉"/> <my:char code="`" value="60" altvalue="F060" entity="♊"/> <my:char code="a" value="61" altvalue="F061" entity="♋"/> <my:char code="b" value="62" altvalue="F062" entity="♌"/> <my:char code="c" value="63" altvalue="F063" entity="♍"/> <my:char code="d" value="64" altvalue="F064" entity="♎"/> <my:char code="e" value="65" altvalue="F065" entity="♏"/> <my:char code="f" value="66" altvalue="F066" entity="♐"/> <my:char code="g" value="67" altvalue="F067" entity="♑"/> <my:char code="h" value="68" altvalue="F068" entity="♒"/> <my:char code="i" value="69" altvalue="F069" entity="♓"/> <my:char code="l" value="6C" altvalue="F06C" entity="●"/> <my:char code="m" value="6D" altvalue="F06D" entity="❍"/> <my:char code="n" value="6E" altvalue="F06E" entity="■"/> <my:char code="o" value="6F" altvalue="F06F" entity="□"/> <my:char code="q" value="71" altvalue="F071" entity="❑"/> <my:char code="r" value="72" altvalue="F072" entity="❒"/> <my:char code="v" value="76" altvalue="F076" entity="❖"/> <my:char code="w" value="77" altvalue="F077" entity="◆"/> <!--<my:char code="{" value="7B" altvalue="F07B" entity="❀"/>--> <my:char code="{{" value="7B" altvalue="F07B" entity="❀"/> <!--<my:char code="}" value="7D" altvalue="F07D" entity="❝"/>--> <my:char code="}}" value="7D" altvalue="F07D" entity="❝"/> <my:char code="~" value="7E" altvalue="F07E" entity="❞"/> <my:char code="" value="81" altvalue="F081" entity="①"/> <my:char code="‚" value="82" altvalue="F082" entity="②"/> <my:char code="ƒ" value="83" altvalue="F083" entity="③"/> <my:char code="„" value="84" altvalue="F084" entity="④"/> <my:char code="…" value="85" altvalue="F085" entity="⑤"/> <my:char code="†" value="86" altvalue="F086" entity="⑥"/> <my:char code="‡" value="87" altvalue="F087" entity="⑦"/> <my:char code="ˆ" value="88" altvalue="F088" entity="⑧"/> <my:char code="‰" value="89" altvalue="F089" entity="⑨"/> <my:char code="Š" value="8A" altvalue="F08A" entity="⑩"/> <my:char code="Œ" value="8C" altvalue="F08C" entity="❶"/> <my:char code="" value="8D" altvalue="F08D" entity="❷"/> <my:char code="Ž" value="8E" altvalue="F08E" entity="❸"/> <my:char code="" value="8F" altvalue="F08F" entity="❹"/> <my:char code="" value="90" altvalue="F090" entity="❺"/> <my:char code="‘" value="91" altvalue="F091" entity="❻"/> <my:char code="’" value="92" altvalue="F092" entity="❼"/> <my:char code="“" value="93" altvalue="F093" entity="❽"/> <my:char code="”" value="94" altvalue="F094" entity="❾"/> <my:char code="•" value="95" altvalue="F095" entity="❿"/> <my:char code="Ÿ" value="9F" altvalue="F09F" entity="•"/> <my:char code="¡" value="A1" altvalue="F0A1" entity="◌"/> <my:char code="¤" value="A4" altvalue="F0A4" entity="◉"/> <my:char code="¦" value="A6" altvalue="F0A6" entity="❍"/> <my:char code="ª" value="AA" altvalue="F0AA" entity="✦"/> <my:char code="«" value="AB" altvalue="F0AB" entity="★"/> <my:char code="¬" value="AC" altvalue="F0AC" entity="✶"/> <my:char code="­" value="AD" altvalue="F0AD" entity="✷"/> <my:char code="®" value="AE" altvalue="F0AE" entity="✹"/> <my:char code="¯" value="AF" altvalue="F0AF" entity="✵"/> <my:char code="Õ" value="D5" altvalue="F0D5" entity="⌫"/> <my:char code="Ö" value="D6" altvalue="F0D6" entity="⌦"/> <my:char code="ï" value="EF" altvalue="F0EF" entity="⇦"/> <my:char code="ð" value="F0" altvalue="F0F0" entity="⇨"/> <my:char code="ñ" value="F1" altvalue="F0F1" entity="⇧"/> <my:char code="ò" value="F2" altvalue="F0F2" entity="⇩"/> <my:char code="û" value="FB" altvalue="F0FB" entity="✘"/> <my:char code="ü" value="FC" altvalue="F0FC" entity="✓"/> <my:char code="ý" value="FD" altvalue="F0FD" entity="☒"/> <my:char code="þ" value="FE" altvalue="F0FE" entity="☑"/> </my:recoding-table> <!-- ================= --> <!-- GENERAL TEMPLATES --> <!-- ================= --> <!-- ================================================= --> <!-- Convert hexadecimal color from MS Word to XSL-FO. --> <!-- ================================================= --> <!-- TODO: Needs refactoring --> <xsl:template name="ConvertHexColor"> <xsl:param name="hexColor" select="'auto'"/> <xsl:param name="style" select="'none'"/> <xsl:param name="type" select="'color'"/> <xsl:param name="bgColor" select="'none'"/> <xsl:choose> <xsl:when test="$hexColor='auto'"> <xsl:choose> <xsl:when test="$style='three-d-emboss' or $style='ridge'"> <xsl:text>#B0B0B0</xsl:text> </xsl:when> <xsl:otherwise> <xsl:choose> <xsl:when test="$type = 'color' "> <xsl:choose> <xsl:when test="$bgColor = 'none' or string($bgColor) = 'auto'">black</xsl:when> <xsl:otherwise> <xsl:variable name="decColorR1"> <xsl:call-template name="ConvertHexCiphToDec"> <xsl:with-param name="hex" select="substring(string($bgColor),1,1)"/> </xsl:call-template> </xsl:variable> <xsl:variable name="decColorR2"> <xsl:call-template name="ConvertHexCiphToDec"> <xsl:with-param name="hex" select="substring(string($bgColor),2,1)"/> </xsl:call-template> </xsl:variable> <xsl:variable name="decColorR" select="16*$decColorR1 + $decColorR2"/> <xsl:variable name="decColorG1"> <xsl:call-template name="ConvertHexCiphToDec"> <xsl:with-param name="hex" select="substring(string($bgColor),3,1)"/> </xsl:call-template> </xsl:variable> <xsl:variable name="decColorG2"> <xsl:call-template name="ConvertHexCiphToDec"> <xsl:with-param name="hex" select="substring(string($bgColor),4,1)"/> </xsl:call-template> </xsl:variable> <xsl:variable name="decColorG" select="16*$decColorG1 + $decColorG2"/> <xsl:variable name="decColorB1"> <xsl:call-template name="ConvertHexCiphToDec"> <xsl:with-param name="hex" select="substring(string($bgColor),5,1)"/> </xsl:call-template> </xsl:variable> <xsl:variable name="decColorB2"> <xsl:call-template name="ConvertHexCiphToDec"> <xsl:with-param name="hex" select="substring(string($bgColor),6,1)"/> </xsl:call-template> </xsl:variable> <xsl:variable name="decColorB" select="16*$decColorB1 + $decColorB2"/> <xsl:variable name="isWhite"> <xsl:call-template name="GetFontColorRGBbg"> <xsl:with-param name="decColorR" select="$decColorR"/> <xsl:with-param name="decColorG" select="$decColorG"/> <xsl:with-param name="decColorB" select="$decColorB"/> </xsl:call-template> </xsl:variable> <xsl:choose> <xsl:when test="$isWhite = 0">white</xsl:when> <xsl:otherwise>black</xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:when test="$type = 'fill' or $type = 'bgcolor' ">white</xsl:when> <xsl:otherwise>black</xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise><xsl:value-of select="concat('#', $hexColor)"/></xsl:otherwise> </xsl:choose> </xsl:template> <!-- ========================================== --> <!-- Convert hex color to dec --> <!-- ========================================== --> <xsl:template name="ConvertHexCiphToDec"> <xsl:param name="hex"/> <xsl:choose> <xsl:when test="$hex = 'a' or $hex = 'A' ">10</xsl:when> <xsl:when test="$hex = 'b' or $hex = 'B' ">11</xsl:when> <xsl:when test="$hex = 'c' or $hex = 'C' ">12</xsl:when> <xsl:when test="$hex = 'd' or $hex = 'D' ">13</xsl:when> <xsl:when test="$hex = 'e' or $hex = 'E' ">14</xsl:when> <xsl:when test="$hex = 'f' or $hex = 'F'">15</xsl:when> <xsl:otherwise> <xsl:value-of select="$hex"/> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- ========================================== --> <!-- Check RGB background and set flag isWhite font color --> <!-- ========================================== --> <xsl:template name="GetFontColorRGBbg"> <xsl:param name="decColorR"/> <xsl:param name="decColorG"/> <xsl:param name="decColorB"/> <xsl:choose> <xsl:when test="$decColorR <= 203 and $decColorG = 0 and $decColorB = 0">0</xsl:when> <xsl:when test="$decColorR = 0 and $decColorG <= 53 and $decColorB <= 255">0</xsl:when> <xsl:when test="$decColorR = 0 and $decColorG = 61 and $decColorB <= 218">0</xsl:when> <xsl:when test="$decColorR = 0 and $decColorG <= 103 and $decColorB = 0">0</xsl:when> <xsl:when test="$decColorR = 0 and $decColorG = 0 and $decColorB >= 0">0</xsl:when> <xsl:when test="$decColorR <= 60 and $decColorG <= 60 and $decColorB <= 60">0</xsl:when> <xsl:when test="$decColorR <= 103 and $decColorG <= 51 and $decColorB = 0">0</xsl:when> <xsl:when test="$decColorR <= 103 and $decColorG <= 21 and $decColorB <= 154">0</xsl:when> <xsl:when test="$decColorR <= 190 and $decColorG = 0 and $decColorB <= 33">0</xsl:when> <xsl:when test="$decColorR <= 173 and $decColorG = 0 and $decColorB <= 79">0</xsl:when> <xsl:when test="$decColorR <= 147 and $decColorG = 0 and $decColorB <= 147">0</xsl:when> <xsl:when test="$decColorR <= 105 and $decColorG = 0 and $decColorB <= 255">0</xsl:when> <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:template> <!-- ======================================== --> <!-- Check for existing unsupported elements. --> <!-- ======================================== --> <xsl:template name="CheckNotSupportedElements"> <xsl:param name="elements"/> <xsl:for-each select="$elements"> <xsl:if test="contains($not-supported-inlines, .)"> <xsl:value-of select="'presents'"/> </xsl:if> </xsl:for-each> </xsl:template> <!-- ================================ --> <!-- Convert "Symbol" and "Wingdings" --> <!-- symbol codes to Unicode. --> <!-- ================================ --> <xsl:template name="ConvertSymbol"> <xsl:param name="font-family"/> <xsl:param name="symbol"/> <xsl:apply-templates select="document('')//my:recoding-table[@font=$font-family]/my:char[@value=$symbol or @altvalue=$symbol]"/> </xsl:template> <!-- ================================ --> <!-- Convert string with chars from fonts "Symbol" and "Wingdings" --> <!-- symbol codes to Unicode. --> <!-- ================================ --> <xsl:template name="ConvertString"> <xsl:param name="font-family"/> <xsl:param name="string"/> <xsl:if test="string-length($string)"> <!--<xsl:value-of select="document('')//my:recoding-table[@font=$font-family]/my:char[@code=substring($string, 1, 1)]/@entity"/>--> <!-- Attention! If you use @code or @entity attribute value (also for searching), you should use only first character of attribute value! --> <!-- In some cases value of attributes @code and @entity is doubled for compatibility reason. --> <!-- See http://www.w3.org/TR/xslt#attribute-value-templates 7.6.2 Attribute Value Templates --> <!-- It is an error if a right curly brace occurs in an attribute value template outside an expression without being followed by a second right curly brace. --> <xsl:value-of select="substring(document('')//my:recoding-table[@font=$font-family]/my:char[substring(@code, 1, 1)=substring($string, 1, 1)]/@entity, 1, 1)"/> <xsl:call-template name="ConvertString"> <xsl:with-param name="font-family" select="$font-family"/> <xsl:with-param name="string" select="substring($string, 2)"/> </xsl:call-template> </xsl:if> </xsl:template> <!-- ============================================= --> <!-- Convert symbol codes (expressed as a unicode) --> <!-- to Unicode character. --> <!-- ============================================= --> <xsl:template name="ConvertChars"> <xsl:param name="font-family"/> <xsl:param name="char-string"/> <!--<xsl:variable name="recorded-char" select="document('')//my:recoding-table[@font=$font-family]/my:char[@code=$char-string]"/>--> <!-- Attention! If you use @code or @entity attribute value (also for searching), you should use only first character of attribute value! --> <!-- In some cases value of attributes @code and @entity is doubled for compatibility reason. --> <!-- See http://www.w3.org/TR/xslt#attribute-value-templates 7.6.2 Attribute Value Templates --> <!-- It is an error if a right curly brace occurs in an attribute value template outside an expression without being followed by a second right curly brace. --> <xsl:variable name="recorded-char" select="document('')//my:recoding-table[@font=$font-family]/my:char[substring(@code, 1, 1)=$char-string]"/> <xsl:choose> <xsl:when test="$recorded-char"> <xsl:attribute name="font-size"> <xsl:value-of select="$default-font-size.symbol"/><xsl:text>pt</xsl:text> </xsl:attribute> <xsl:attribute name="font-family"><xsl:text>ZapfDingbats, Arial</xsl:text></xsl:attribute> <xsl:apply-templates select="$recorded-char"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$char-string"/> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- ===================================== --> <!-- Apply an entry from a recording table --> <!-- ===================================== --> <xsl:template match="my:recoding-table/my:char"> <!-- 03/06/2006: Added explicit font reference to make Without font work properly. --> <xsl:attribute name="font-family"><xsl:text>Symbol, Zapf Dingbats, Helvetica</xsl:text></xsl:attribute> <!--<xsl:value-of select="@entity"/>--> <!-- Attention! If you use @code or @entity attribute value (also for searching), you should use only first character of attribute value! --> <!-- In some cases value of attributes @code and @entity is doubled for compatibility reason. --> <!-- See http://www.w3.org/TR/xslt#attribute-value-templates 7.6.2 Attribute Value Templates --> <!-- It is an error if a right curly brace occurs in an attribute value template outside an expression without being followed by a second right curly brace. --> <xsl:value-of select="substring(@entity,1,1)"/> </xsl:template> <!-- ================= --> <!-- Set border-style. --> <!-- ================= --> <xsl:template name="SetBorderStyle"> <xsl:param name="attribute-name"/> <xsl:param name="style"/> <xsl:attribute name="{$attribute-name}"> <xsl:choose> <xsl:when test="$style='double'"><xsl:text>double</xsl:text></xsl:when> <xsl:when test="$style='dotted' or $style='dot-dot-dash' or $style='basic-black-dots' or $style='basic-white-dots' or $style='coupon-cutout-dots'"><xsl:text>dotted</xsl:text></xsl:when> <xsl:when test="$style='dashed' or $style='dot-dash' or $style='dash-small-gap' or $style='dash-dot-stroked' or $style='basic-black-dashes' or $style='basic-white-dashes' or $style='coupon-cutout-dashes'"><xsl:text>dashed</xsl:text></xsl:when> <xsl:when test="$style='three-d-engrave'"><xsl:text>groove</xsl:text></xsl:when> <xsl:when test="$style='three-d-emboss'"><xsl:text>ridge</xsl:text></xsl:when> <xsl:when test="$style='inset'"><xsl:text>inset</xsl:text></xsl:when> <xsl:when test="$style='outset'"><xsl:text>outset</xsl:text></xsl:when> <xsl:otherwise> <xsl:choose> <xsl:when test="$style != 'nil' and $style != 'none'"><xsl:text>solid</xsl:text></xsl:when> <xsl:otherwise><xsl:text>none</xsl:text></xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:attribute> </xsl:template> <!-- ======================================== --> <!-- Convert tableWidthPropertyType (MS Word) --> <!-- to points or percents. --> <!-- ======================================== --> <xsl:template name="ConvertTableWidthPropertyType"> <xsl:param name="type" select="auto"/> <xsl:param name="value" select="0"/> <xsl:choose> <xsl:when test="$type='nil' or $type='dxa'"><xsl:value-of select="$value div 20"/><xsl:text>pt</xsl:text></xsl:when> <xsl:when test="$type='pct'"><xsl:value-of select="$value div 50"/><xsl:text>%</xsl:text></xsl:when> <xsl:otherwise><xsl:text>auto</xsl:text></xsl:otherwise> </xsl:choose> </xsl:template> <!-- ================================= --> <!-- The template return media subtype --> <!-- from the name of the binary data. --> <!-- ================================= --> <xsl:template name="RetrieveMediaSubtype"> <xsl:param name="name"/> <xsl:choose> <xsl:when test="contains($name, '.jpg') or contains($name, '.jpeg') or contains($name, '.jpe') or contains($name, '.jfif')"> <xsl:text>jpeg</xsl:text> </xsl:when> <xsl:when test="contains($name, '.gif')"> <xsl:text>gif</xsl:text> </xsl:when> <xsl:when test="contains($name, '.tif') or contains($name, '.tiff')"> <xsl:text>tiff</xsl:text> </xsl:when> <xsl:when test="contains($name, '.png')"> <xsl:text>png</xsl:text> </xsl:when> <xsl:otherwise><xsl:text>auto</xsl:text></xsl:otherwise> </xsl:choose> </xsl:template> <!-- ================================= --> <!-- Get content width from CSS style. --> <!-- ================================= --> <xsl:template name="GetWidthFromCSSStyle"> <xsl:param name="style"/> <xsl:param name="object"/> <xsl:param name="factor" select="1"/> <xsl:if test="contains($style, 'width:')"> <xsl:variable name="width-with-trailing" select="substring-after($style, 'width:')"/> <xsl:variable name="width"> <xsl:choose> <xsl:when test="contains($width-with-trailing, ';')"> <xsl:value-of select="substring-before($width-with-trailing, ';')"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$width-with-trailing"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="units" select="translate($width, '0123456789.', '')"/> <xsl:variable name="numeric-value"> <xsl:choose> <xsl:when test="not($units)"> <xsl:value-of select="$width"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="substring-before($width, $units)"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:value-of select="concat($factor * $numeric-value, $units)"/> </xsl:if> </xsl:template> <!-- ================================== --> <!-- Get content height from CSS style. --> <!-- ================================== --> <xsl:template name="GetHeightFromCSSStyle"> <xsl:param name="style"/> <xsl:param name="obect"/> <xsl:param name="factor" select="1"/> <xsl:if test="contains($style, 'height:')"> <xsl:variable name="height-with-trailing" select="substring-after($style, 'height:')"/> <xsl:variable name="height"> <xsl:choose> <xsl:when test="contains($height-with-trailing, ';')"> <xsl:value-of select="substring-before($height-with-trailing, ';')"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$height-with-trailing"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="units" select="translate($height, '0123456789.', '')"/> <xsl:variable name="numeric-value"> <xsl:choose> <xsl:when test="not($units)"> <xsl:value-of select="$height"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="substring-before($height, $units)"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:value-of select="concat($factor * $numeric-value, $units)"/> </xsl:if> </xsl:template> <!-- ================================= --> <!-- The template parses an CSS style. --> <!-- ================================= --> <xsl:template name="ParsingCSSStyle"> <xsl:param name="style"/> <xsl:param name="object"/> <xsl:param name="x-factor" select="1"/> <xsl:param name="y-factor" select="1"/> <xsl:if test="contains($style, 'width:')"> <xsl:variable name="attribute-name"> <xsl:choose> <xsl:when test="$object='image'"> <xsl:text>content-width</xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>width</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:attribute name="{$attribute-name}"> <xsl:call-template name="GetWidthFromCSSStyle"> <xsl:with-param name="style" select="$style"/> <xsl:with-param name="object" select="$object"/> <xsl:with-param name="factor" select="$x-factor"/> </xsl:call-template> </xsl:attribute> </xsl:if> <xsl:if test="contains($style, 'height:')"> <xsl:variable name="attribute-name"> <xsl:choose> <xsl:when test="$object='image'"> <xsl:text>content-height</xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>height</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:attribute name="{$attribute-name}"> <xsl:call-template name="GetHeightFromCSSStyle"> <xsl:with-param name="style" select="$style"/> <xsl:with-param name="object" select="$object"/> <xsl:with-param name="factor" select="$y-factor"/> </xsl:call-template> </xsl:attribute> </xsl:if> </xsl:template> <!-- ====================== --> <!-- Normalize font family. --> <!-- ====================== --> <xsl:template name="NormalizeFontFamilyName"> <xsl:param name="font-family" /> <xsl:choose> <xsl:when test="contains($font-family, ' ')"> <xsl:value-of select="substring-before($font-family, ' ')"/> <xsl:call-template name="NormalizeFontFamilyName"> <xsl:with-param name="font-family" select="substring-after($font-family, ' ')"/> </xsl:call-template> </xsl:when> <xsl:otherwise><xsl:value-of select="$font-family"/></xsl:otherwise> </xsl:choose> </xsl:template> <!-- ======================= --> <!-- Set page number format. --> <!-- ======================= --> <xsl:template name="PageNumberFormat"> <xsl:param name="format"/> <xsl:choose> <xsl:when test="$format='Arabic'"><xsl:text>1</xsl:text></xsl:when> <xsl:when test="$format='ArabicDash'"><xsl:text>- 1 -</xsl:text></xsl:when> <xsl:when test="$format='alphabetic'"><xsl:text>a</xsl:text></xsl:when> <xsl:when test="$format='ALPHABETIC'"><xsl:text>A</xsl:text></xsl:when> <xsl:when test="$format='roman'"><xsl:text>i</xsl:text></xsl:when> <xsl:when test="$format='ROMAN'"><xsl:text>I</xsl:text></xsl:when> <xsl:otherwise><xsl:text>1</xsl:text></xsl:otherwise> </xsl:choose> </xsl:template> <!-- ================= --> <!-- SPECIAL TEMPLATES --> <!-- ================= --> <!-- ================================== --> <!-- Count the number of spanned cells. --> <!-- ================================== --> <xsl:template name="CountCellsSpanned"> <xsl:param name="number-cells-spanned"/> <xsl:param name="following-cell"/> <xsl:param name="col-or-row"/> <xsl:param name="real-column-number"/> <xsl:choose> <xsl:when test="$col-or-row='col' and $following-cell/w:tcPr/w:hmerge[not(@w:val='restart')]"> <xsl:call-template name="CountCellsSpanned"> <xsl:with-param name="number-cells-spanned" select="$number-cells-spanned + 1"/> <xsl:with-param name="following-cell" select="$following-cell/following-sibling::w:tc[1]"/> <xsl:with-param name="col-or-row" select="'col'"/> </xsl:call-template> </xsl:when> <xsl:when test="$col-or-row='row' and $following-cell/w:tcPr/w:vmerge[not(@w:val='restart')]"> <xsl:call-template name="CountCellsSpanned"> <xsl:with-param name="number-cells-spanned" select="$number-cells-spanned + 1"/> <xsl:with-param name="following-cell" select="$following-cell/ancestor::w:tr[1]/following-sibling::w:tr[1]/w:tc[count(.|preceding-sibling::w:tc[not(w:tcPr/w:gridSpan)]) + sum(preceding-sibling::w:tc/w:tcPr/w:gridSpan/@w:val) = $real-column-number]"/> <xsl:with-param name="col-or-row" select="'row'"/> <xsl:with-param name="real-column-number" select="$real-column-number"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <xsl:choose> <xsl:when test="$col-or-row='col'"> <xsl:attribute name="number-columns-spanned"> <xsl:value-of select="$number-cells-spanned"/> </xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="number-rows-spanned"> <xsl:value-of select="$number-cells-spanned"/> </xsl:attribute> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- ===================== --> <!-- Select alt font name. --> <!-- ===================== --> <xsl:template name="AltFontName"> <xsl:param name="font-name"/> <xsl:variable name="alt-font-name" select="key('fonts', $font-name)/w:altName"/> <xsl:choose> <xsl:when test="$alt-font-name"> <xsl:variable name="apos">'</xsl:variable> <xsl:value-of select="concat($apos, $font-name, $apos, ', ', $apos, $alt-font-name/@w:val, $apos)"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$font-name"/> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- ========================== --> <!-- Concatanate an instruction --> <!-- ========================== --> <xsl:template name="ConcatInstruction"> <xsl:param name="current-run-element" select="."/> <xsl:param name="num-nested-loops" select="1"/> <xsl:value-of select="normalize-space($current-run-element/preceding-sibling::w:r[w:instrText][1]/w:instrText)"/> </xsl:template> <xsl:template name="PutOneBorderSpecifics"> <xsl:param name="specifier-node"/> <xsl:param name="side"/> <xsl:call-template name="SetBorderStyle"> <xsl:with-param name="attribute-name" select="concat('border-', $side, '-style')"/> <xsl:with-param name="style" select="$specifier-node/@w:val"/> </xsl:call-template> <xsl:if test="$specifier-node/@w:color"> <xsl:attribute name="border-{$side}-color"> <xsl:call-template name="ConvertHexColor"> <xsl:with-param name="hexColor" select="$specifier-node/@w:color"/> <xsl:with-param name="style" select="$specifier-node/@w:val"/> </xsl:call-template> </xsl:attribute> </xsl:if> <!-- set half border-width on the cell --> <xsl:if test="$specifier-node/@w:sz"> <xsl:attribute name="border-{$side}-width"> <xsl:value-of select="$specifier-node/@w:sz div 16"/><xsl:text>pt</xsl:text> </xsl:attribute> </xsl:if> <!-- if wx:bdrwidth attribute exists, it overwrites the w:sz --> <xsl:if test="$specifier-node/@wx:bdrwidth"> <xsl:attribute name="border-{$side}-width"> <xsl:value-of select="$specifier-node/@wx:bdrwidth div 20"/><xsl:text>pt</xsl:text> </xsl:attribute> </xsl:if> </xsl:template> <xsl:template name="PutBorderSpecificsForCell"> <xsl:param name="specifier-node"/> <xsl:param name="cell"/> <xsl:param name="direction"/> <!-- We need to determine if this border is only border of cell or border of table --> <!-- following X-Pathes keep in mind contiguous tables and merged cells --> <xsl:variable name="leftside-cells-exist" select="$cell/preceding-sibling::w:tc[ancestor::w:tbl = $cell/ancestor::w:tbl]"/> <xsl:variable name="upper-cells-exist" select="$cell/parent::w:tr/preceding-sibling::w:tr[ancestor::w:tbl = $cell/ancestor::w:tbl]"/> <xsl:variable name="rightside-cells-exist" select="$cell/following-sibling::w:tc[ancestor::w:tbl = $cell/ancestor::w:tbl and (not(w:tcPr/w:hmerge) or w:tcPr/w:hmerge/@w:val='restart')]"/> <!--<xsl:variable name="current-id" select="generate-id($cell)"/> <xsl:variable name="position"> <xsl:for-each select="$cell/../w:tc"> <!- -<xsl:if test=". = $cell"><xsl:value-of select="position()"/></xsl:if>- -> <xsl:if test="generate-id(.) = $current-id"><xsl:value-of select="position()"/></xsl:if> </xsl:for-each> </xsl:variable>--> <xsl:variable name="position" select="count($cell/preceding-sibling::w:tc[ancestor::w:tr = $cell/ancestor::w:tr]) + 1"/> <xsl:variable name="bottomside-cells-exist" select="$cell/parent::w:tr/following-sibling::w:tr[ancestor::w:tbl = $cell/ancestor::w:tbl and w:tc[position() = $position and (not(w:tcPr/w:vmerge) or w:tcPr/w:vmerge/@w:val='restart')]]"/> <xsl:choose> <xsl:when test="$direction = 'vertical'"> <xsl:if test="$cell"> <xsl:if test="count($cell/../w:tc) > 1"> <xsl:choose> <xsl:when test="not($leftside-cells-exist)"> <!-- is the first cell in a row --> <xsl:call-template name="PutOneBorderSpecifics"> <xsl:with-param name="specifier-node" select="$specifier-node"/> <xsl:with-param name="side" select="'right'"/> </xsl:call-template> </xsl:when> <xsl:when test="not($rightside-cells-exist)"> <!-- is the last cell in a row --> <xsl:call-template name="PutOneBorderSpecifics"> <xsl:with-param name="specifier-node" select="$specifier-node"/> <xsl:with-param name="side" select="'left'"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <!-- set for both sides... --> <!-- LEFT SIDE --> <xsl:call-template name="PutOneBorderSpecifics"> <xsl:with-param name="specifier-node" select="$specifier-node"/> <xsl:with-param name="side" select="'left'"/> </xsl:call-template> <!-- RIGHT SIDE --> <xsl:call-template name="PutOneBorderSpecifics"> <xsl:with-param name="specifier-node" select="$specifier-node"/> <xsl:with-param name="side" select="'right'"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:if> </xsl:if> </xsl:when> <xsl:when test="$direction = 'horizontal'"> <xsl:if test="$cell"> <xsl:if test="count($cell/parent::w:tr/parent::w:tbl/w:tr) > 1"> <xsl:choose> <xsl:when test="not($upper-cells-exist)"> <!-- the cell is in the first row --> <xsl:call-template name="PutOneBorderSpecifics"> <xsl:with-param name="specifier-node" select="$specifier-node"/> <xsl:with-param name="side" select="'bottom'"/> </xsl:call-template> </xsl:when> <xsl:when test="not($bottomside-cells-exist)"> <!-- the cell is in the last row --> <xsl:call-template name="PutOneBorderSpecifics"> <xsl:with-param name="specifier-node" select="$specifier-node"/> <xsl:with-param name="side" select="'top'"/> </xsl:call-template> </xsl:when> <xsl:otherwise> <!-- set for both sides --> <!-- BOTTOM SIDE --> <xsl:call-template name="PutOneBorderSpecifics"> <xsl:with-param name="specifier-node" select="$specifier-node"/> <xsl:with-param name="side" select="'bottom'"/> </xsl:call-template> <!-- TOP SIDE --> <xsl:call-template name="PutOneBorderSpecifics"> <xsl:with-param name="specifier-node" select="$specifier-node"/> <xsl:with-param name="side" select="'top'"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:if> </xsl:if> </xsl:when> <!-- keep the cases separate for this moment --> <xsl:when test="$direction = 'top'"> <xsl:if test="name($specifier-node/..)='w:tcBorders' or not($upper-cells-exist) "> <!-- w:tblBorders, w:tcBorders --> <xsl:call-template name="PutOneBorderSpecifics"> <xsl:with-param name="specifier-node" select="$specifier-node"/> <xsl:with-param name="side" select="'top'"/> </xsl:call-template> </xsl:if> </xsl:when> <xsl:when test="$direction = 'right'"> <xsl:if test="name($specifier-node/..)='w:tcBorders' or not($rightside-cells-exist) "> <!-- w:tblBorders, w:tcBorders --> <xsl:call-template name="PutOneBorderSpecifics"> <xsl:with-param name="specifier-node" select="$specifier-node"/> <xsl:with-param name="side" select="'right'"/> </xsl:call-template> </xsl:if> </xsl:when> <xsl:when test="$direction = 'bottom'"> <xsl:if test="name($specifier-node/..)='w:tcBorders' or not($bottomside-cells-exist) "> <!-- w:tblBorders, w:tcBorders --> <xsl:call-template name="PutOneBorderSpecifics"> <xsl:with-param name="specifier-node" select="$specifier-node"/> <xsl:with-param name="side" select="'bottom'"/> </xsl:call-template> </xsl:if> </xsl:when> <xsl:when test="$direction = 'left'"> <xsl:if test="name($specifier-node/..)='w:tcBorders' or not($leftside-cells-exist) "> <!-- w:tblBorders, w:tcBorders --> <xsl:call-template name="PutOneBorderSpecifics"> <xsl:with-param name="specifier-node" select="$specifier-node"/> <xsl:with-param name="side" select="'left'"/> </xsl:call-template> </xsl:if> </xsl:when> </xsl:choose> </xsl:template> <!-- ============================================== --> <!-- Chooses the last value from the list of items. --> <!-- ============================================== --> <xsl:template name="AnalyzeOverridings"> <xsl:param name="list"/> <xsl:param name="sep"/> <xsl:if test="string-length($list) > 0 and string-length($sep) > 0"> <xsl:variable name="current-item"> <xsl:choose> <xsl:when test="contains($list, $sep)"> <xsl:value-of select="substring-before($list, $sep)"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$list"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="item-from-rest"> <xsl:call-template name="AnalyzeOverridings"> <xsl:with-param name="list" select="substring-after($list, $sep)"/> <xsl:with-param name="sep" select="$sep"/> </xsl:call-template> </xsl:variable> <xsl:choose> <xsl:when test="normalize-space($item-from-rest)"> <xsl:value-of select="$item-from-rest"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$current-item"/> </xsl:otherwise> </xsl:choose> </xsl:if> </xsl:template> <!-- ========================================================================== --> <!-- Converts inches, points, centimeters, etc. to user units as defined in SVG --> <!-- ========================================================================== --> <xsl:template name="ConvertToUserUnits"> <xsl:param name="value"/> <xsl:variable name="unit" select="translate($value, '-0123456789.', '')"/> <xsl:choose> <xsl:when test="not($unit)"> <xsl:value-of select="$value"/> </xsl:when> <xsl:otherwise> <xsl:variable name="numeric-value" select="number(substring-before($value, $unit))"/> <xsl:choose> <xsl:when test="$unit = 'px'"> <xsl:value-of select="round($numeric-value)"/> </xsl:when> <xsl:when test="$unit = 'pt'"> <xsl:value-of select="round(1.25 * $numeric-value)"/> </xsl:when> <xsl:when test="$unit = 'pc'"> <xsl:value-of select="round(15 * $numeric-value)"/> </xsl:when> <xsl:when test="$unit = 'mm'"> <xsl:value-of select="round(3.543307 * $numeric-value)"/> </xsl:when> <xsl:when test="$unit = 'cm'"> <xsl:value-of select="round(35.43307 * $numeric-value)"/> </xsl:when> <xsl:when test="$unit = 'in'"> <xsl:value-of select="round(90 * $numeric-value)"/> </xsl:when> <xsl:otherwise> <!-- suppose the value already is in user units (SVG) --> <xsl:value-of select="$numeric-value"/> <!--<xsl:value-of select="round(1.25 * $numeric-value)"/>--> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:template> <!--====================================================================================================== Round specified number to the needed sign after a comma. For example - from 123.234567 you get 123.235 with default round param (0.001) Param: Source - source number (can be a string representation of number - it will be parsed through number function) Param: Precision - for what number after coma source number will be rounded (default is 0.001) _________________________________________________________________________________________________________ 2006/04/04 Tutyhin Alexander ========================================================================================================= --> <xsl:template name="DoubleRound"> <xsl:param name="Source"/> <xsl:param name="Precision">0.001</xsl:param> <xsl:choose> <xsl:when test="string(number($Source))='NaN'"> <xsl:value-of select="$Source"/> <!-- not a number! return source as is--> </xsl:when> <xsl:otherwise> <xsl:choose> <xsl:when test="$Precision=0"> <xsl:value-of select="number($Source)"/> <!-- round not need--> </xsl:when> <xsl:when test="$Precision=1"> <xsl:value-of select="round(number($Source))"/> <!-- simple round--> </xsl:when> <xsl:otherwise> <xsl:value-of select="round(number($Source) div $Precision) * $Precision"/> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- ================================== --> <!-- Convert string to lowercase --> <!-- ================================== --> <xsl:template name="ConvertStringToLowercase"> <xsl:param name="field-name"/> <xsl:variable name="lc-letter" select="'abcdefghijklmnopqrstuvwxyz'" /> <xsl:variable name="uc-letter" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" /> <xsl:value-of select="translate($field-name, $uc-letter, $lc-letter)"/> </xsl:template> <xsl:template name="HexCompare"> <xsl:param name="hex1"/> <xsl:param name="hex2"/> <xsl:choose> <xsl:when test="string-length($hex1) > string-length($hex2)">1</xsl:when> <xsl:when test="string-length($hex2) > string-length($hex1)">-1</xsl:when> <xsl:otherwise> <xsl:variable name="hex1lower" select="translate($hex1, 'ABCDEF', 'abcdef' )"/> <xsl:variable name="hex2lower" select="translate($hex2, 'ABCDEF', 'abcdef' )"/> <xsl:choose> <xsl:when test="$hex1lower = $hex2lower">0</xsl:when> <xsl:otherwise> <xsl:call-template name="HexCompareRecursive"> <xsl:with-param name="hex1" select="$hex1lower"/> <xsl:with-param name="hex2" select="$hex2lower"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="HexCompareRecursive"> <xsl:param name="hex1"/> <xsl:param name="hex2"/> <xsl:choose> <xsl:when test="string-length($hex1)>0 and string-length($hex2)>0"> <xsl:variable name="char1" select="substring($hex1, 1, 1)"/> <xsl:variable name="char2" select="substring($hex2, 1, 1)"/> <xsl:variable name="num1"> <xsl:call-template name="ConvertHexCiphToDec"> <xsl:with-param name="hex.cipher" select="$char1"/> </xsl:call-template> </xsl:variable> <xsl:variable name="num2"> <xsl:call-template name="ConvertHexCiphToDec"> <xsl:with-param name="hex.cipher" select="$char2"/> </xsl:call-template> </xsl:variable> <xsl:choose> <xsl:when test="$num1 > $num2">1</xsl:when> <xsl:when test="$num2 > $num1">-1</xsl:when> <xsl:otherwise> <xsl:call-template name="HexCompareRecursive"> <xsl:with-param name="hex1" select="substring($hex1, 2)"/> <xsl:with-param name="hex2" select="substring($hex2, 2)"/> </xsl:call-template> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise>0</xsl:otherwise> </xsl:choose> </xsl:template> </xsl:stylesheet>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de