Package client.net.sf.saxon.ce.trans

Examples of client.net.sf.saxon.ce.trans.DecimalFormatManager


        checked = true;
        super.checkArguments(visitor);
        decimalFormatManager = env.getDecimalFormatManager();
        if (decimalFormatManager == null) {
            // create a decimal format manager which will allow a "default default" format only
            decimalFormatManager = new DecimalFormatManager();
        }
        if (argument[1] instanceof StringLiteral) {
            // picture is known statically - optimize for this common case
            picture = ((StringLiteral)argument[1]).getStringValue();
        }
View Full Code Here


            av0 = DoubleValue.NaN;
        }
        NumericValue number = (NumericValue)av0;

        if (dfs == null) {
            DecimalFormatManager dfm = decimalFormatManager;
            if (numArgs==2) {
                dfs = dfm.getDefaultDecimalFormat();
            } else {
                // the decimal-format name was given as a run-time expression
                String lexicalName = argument[2].evaluateItem(context).getStringValue();
                StructuredQName qName = null;
                try {
                    qName = StructuredQName.fromLexicalQName(lexicalName, false, nsContext);
                } catch (XPathException e) {
                    dynamicError("Invalid decimal format name. " + e.getMessage(), "XTDE1280", context);
                }

                dfs = dfm.getNamedDecimalFormat(qName);
                if (dfs==null) {
                    dynamicError("format-number function: decimal-format '" + lexicalName + "' is not defined", "XTDE1280", context);
                }
            }
        }
View Full Code Here

    public void index(Declaration decl, PrincipalStylesheetModule top) throws XPathException
    {
        prepareAttributes();
        DecimalSymbols d = makeDecimalFormatSymbols();
        DecimalFormatManager dfm = getPreparedStylesheet().getDecimalFormatManager();
        if (name==null) {
            try {
                dfm.setDefaultDecimalFormat(d, decl.getPrecedence());
            } catch (XPathException err) {
                compileError(err.getMessage(), err.getErrorCodeQName());
            }
        } else {
            try {
                StructuredQName formatName = makeQName(name);
                try {
                    dfm.setNamedDecimalFormat(formatName, d, decl.getPrecedence());
                } catch (XPathException err) {
                    compileError(err.getMessage(), err.getErrorCodeQName());
                }
            } catch (XPathException err) {
                compileError("Invalid decimal format name. " + err.getMessage(), "XTSE0020");
View Full Code Here

     * @return the DecimalFormatManager containing the named xsl:decimal-format definitions
     */

    public DecimalFormatManager getDecimalFormatManager() {
        if (decimalFormatManager == null) {
            decimalFormatManager = new DecimalFormatManager();
        }
        return decimalFormatManager;
    }
View Full Code Here

TOP

Related Classes of client.net.sf.saxon.ce.trans.DecimalFormatManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.