KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > xalan > processor > ProcessorDecimalFormat


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 /*
17  * $Id: ProcessorDecimalFormat.java,v 1.11 2004/02/11 18:15:51 minchau Exp $
18  */

19 package org.apache.xalan.processor;
20
21 import org.apache.xalan.templates.DecimalFormatProperties;
22 import org.xml.sax.Attributes JavaDoc;
23
24 /**
25  * Process xsl:decimal-format by creating a DecimalFormatProperties
26  * object and passing it to the stylesheet.
27  *
28  * @see org.apache.xalan.templates.Stylesheet#setDecimalFormat
29  * @see org.apache.xalan.templates.DecimalFormatProperties
30  * @see <a HREF="http://www.w3.org/TR/xslt#format-number">format-number in XSLT Specification</a>
31  * @xsl.usage internal
32  */

33 class ProcessorDecimalFormat extends XSLTElementProcessor
34 {
35
36   /**
37    * Receive notification of the start of an element.
38    *
39    * @param handler The calling StylesheetHandler/TemplatesBuilder.
40    * @param uri The Namespace URI, or the empty string if the
41    * element has no Namespace URI or if Namespace
42    * processing is not being performed.
43    * @param localName The local name (without prefix), or the
44    * empty string if Namespace processing is not being
45    * performed.
46    * @param rawName The raw XML 1.0 name (with prefix), or the
47    * empty string if raw names are not available.
48    * @param attributes The attributes attached to the element. If
49    * there are no attributes, it shall be an empty
50    * Attributes object.
51    * @see org.apache.xalan.processor.StylesheetHandler#startElement
52    * @see org.apache.xalan.processor.StylesheetHandler#endElement
53    * @see org.xml.sax.ContentHandler#startElement
54    * @see org.xml.sax.ContentHandler#endElement
55    * @see org.xml.sax.Attributes
56    */

57   public void startElement(
58           StylesheetHandler handler, String JavaDoc uri, String JavaDoc localName, String JavaDoc rawName, Attributes JavaDoc attributes)
59             throws org.xml.sax.SAXException JavaDoc
60   {
61
62     DecimalFormatProperties dfp = new DecimalFormatProperties(handler.nextUid());
63     
64     dfp.setDOMBackPointer(handler.getOriginatingNode());
65     dfp.setLocaterInfo(handler.getLocator());
66     
67     setPropertiesFromAttributes(handler, rawName, attributes, dfp);
68     handler.getStylesheet().setDecimalFormat(dfp);
69     
70     handler.getStylesheet().appendChild(dfp);
71   }
72 }
73
Popular Tags