1 /* 2 * The contents of this file are subject to the Mozilla Public 3 * License Version 1.1 (the "License"); you may not use this file 4 * except in compliance with the License. You may obtain a copy of 5 * the License at http://www.mozilla.org/MPL/ 6 * 7 * Software distributed under the License is distributed on an "AS 8 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or 9 * implied. See the License for the specific language governing 10 * rights and limitations under the License. 11 * 12 * The Original Code is the Sablotron XSLT Processor. 13 * 14 * The Initial Developer of the Original Code is Ginger Alliance Ltd. 15 * Portions created by Ginger Alliance are Copyright (C) 2000-2002 16 * Ginger Alliance Ltd. All Rights Reserved. 17 * 18 * Contributor(s): 19 * 20 * Alternatively, the contents of this file may be used under the 21 * terms of the GNU General Public License Version 2 or later (the 22 * "GPL"), in which case the provisions of the GPL are applicable 23 * instead of those above. If you wish to allow use of your 24 * version of this file only under the terms of the GPL and not to 25 * allow others to use your version of this file under the MPL, 26 * indicate your decision by deleting the provisions above and 27 * replace them with the notice and other provisions required by 28 * the GPL. If you do not delete the provisions above, a recipient 29 * may use your version of this file under either the MPL or the 30 * GPL. 31 */ 32 33 #ifndef NumberingHIncl 34 #define NumberingHIncl 35 36 #include "base.h" 37 #include "datastr.h" 38 39 typedef List<int> ListInt; 40 41 // possible values of xsl:number/@level 42 43 enum NumberingLevel 44 { 45 NUM_SINGLE, 46 NUM_MULTIPLE, 47 NUM_ANY 48 }; 49 50 // possible values of xsl:number/@letter-value 51 52 enum NumberingLetterValue 53 { 54 NUM_ALPHABETIC, 55 NUM_TRADITIONAL 56 }; 57 58 //class Vertex; 59 class Expression; 60 61 // counts nodes as xsl:number without @value should 62 // curr is the current node 63 // returns the count in 'result' 64 65 eFlag xslNumberCount( 66 Sit S, NumberingLevel level, 67 Expression* count, Expression* from, 68 NodeHandle curr, ListInt& result); 69 70 // formats 'num' according to the format string 71 // returns the string in 'result' 72 73 eFlag xslNumberFormat( 74 Sit S, ListInt& nums, const Str& format, 75 const Str& lang, NumberingLetterValue letterValue, 76 const Str& groupingSep, int groupingSize, Str& result); 77 78 #endif // NumberingHIncl 79