Examples of DecimalFormatManager


Examples of net.sf.saxon.trans.DecimalFormatManager

                    dfURI = env.getURIForPrefix(parts[0]);
                } catch (QNameException e) {
                    throw new StaticError("Invalid decimal format name. " + e.getMessage());
                }

                DecimalFormatManager dfm = ((ExpressionContext)env).getXSLStylesheet().getDecimalFormatManager();
                requireFixup = true;
                dfm.registerUsage(dfURI, dfLocalName, this);
                    // this causes a callback to the fixup() method, either now, or later if it's a forwards reference
            } else {
                // we need to save the namespace context
                nsContext = env.getNamespaceResolver();
            }
        } else {
            // two arguments only: it uses the default decimal format
            if (env instanceof ExpressionContext) {
                // this is XSLT
                DecimalFormatManager dfm = ((ExpressionContext)env).getXSLStylesheet().getDecimalFormatManager();
                dfm.registerUsage("", "", this);
                // Note: if using the "default default", there will be no fixup call.
            } else {
                // using saxon:decimal-format in some other environment
            }
        }
View Full Code Here

Examples of net.sf.saxon.trans.DecimalFormatManager

        }
        if (patternSeparator!=null) {
            d.setPatternSeparator(toChar(patternSeparator));
        }

        DecimalFormatManager dfm = getPrincipalStylesheet().getDecimalFormatManager();
        if (name==null) {
            try {
                dfm.setDefaultDecimalFormat(d);
            } catch (TransformerConfigurationException err) {
                compileError(err.getMessage());
            }
        } else {
            try {
                makeNameCode(name);   // checks for reserved namespaces
                String[] parts = Name.getQNameParts(name);
              String uri = getURIForPrefix(parts[0], false);
                try {
                    dfm.setNamedDecimalFormat(uri, parts[1], d);
                } catch (TransformerConfigurationException err) {
                    compileError(err.getMessage());
                }
            } catch (XPathException err) {
                compileError("Invalid decimal format name. " + err.getMessage());
View Full Code Here

Examples of net.sf.saxon.trans.DecimalFormatManager

    * @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

Examples of net.sf.saxon.trans.DecimalFormatManager

            if (requireFixup) {
                // we registered for a fixup, but none came
                dynamicError("Unknown decimal format name", "XT1280", context);
                return null;
            }
            DecimalFormatManager dfm = ctrl.getDecimalFormatManager();
            if (numArgs==2) {
                dfs = dfm.getDefaultDecimalFormat();
            } else {
                // the decimal-format name was given as a run-time expression
                String qname = argument[2].evaluateItem(context).getStringValue();
                try {
                    String[] parts = Name.getQNameParts(qname);
                    String localName = parts[1];
                    String uri = nsContext.getURIForPrefix(parts[0], false);
                    if (uri==null) {
                        dynamicError("Namespace prefix '" + parts[0] + "' has not been defined", "XT1280", context);
                        return null;
                    }
                    dfs = dfm.getNamedDecimalFormat(uri, localName);
                    if (dfs==null) {
                        dynamicError(
                            "format-number function: decimal-format '" + localName + "' is not defined", "XT1280", context);
                        return null;
                    }
View Full Code Here

Examples of net.sf.saxon.trans.DecimalFormatManager

     * Get the DecimalFormatManager which handles decimal-format definitions
     */

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

Examples of net.sf.saxon.trans.DecimalFormatManager

     * Get the Decimal Format Manager.
     * @return the Decimal Format Manager
     */
    public DecimalFormatManager getDecimalFormatManager() {
        if (decimalFormatManager==null) {
            decimalFormatManager = new DecimalFormatManager();
        }
        return decimalFormatManager;
    }
View Full Code Here

Examples of net.sf.saxon.trans.DecimalFormatManager

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

Examples of org.pdf4j.saxon.trans.DecimalFormatManager

    public void register() throws XPathException
    {
        prepareAttributes();
        DecimalSymbols d = makeDecimalFormatSymbols();
        DecimalFormatManager dfm = getPrincipalStylesheet().getDecimalFormatManager();
        if (name==null) {
            try {
                dfm.setDefaultDecimalFormat(d, getPrecedence());
            } catch (XPathException err) {
                compileError(err.getMessage(), err.getErrorCodeLocalPart());
            }
        } else {
            try {
                StructuredQName formatName = makeQName(name);
                try {
                    dfm.setNamedDecimalFormat(formatName, d, getPrecedence());
                } catch (XPathException err) {
                    compileError(err.getMessage(), err.getErrorCodeLocalPart());
                }
            } catch (XPathException err) {
                compileError("Invalid decimal format name. " + err.getMessage(), "XTSE0020");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.