Пример #1
0
        private void Initialize(Compiler c)
        {
            XPathNavigator n = c.Input;

            IXmlLineInfo li = n as IXmlLineInfo;

            if (li != null)
            {
                lineNumber   = li.LineNumber;
                linePosition = li.LinePosition;
            }
            baseUri = n.BaseURI;

            if (n.MoveToFirstAttribute())
            {
                do
                {
                    if (n.NamespaceURI != String.Empty)
                    {
                        continue;
                    }

                    switch (n.LocalName)
                    {
                    case "name": break;                     // already handled

                    case "decimal-separator":
                        if (n.Value.Length != 1)
                        {
                            throw new XsltCompileException("XSLT decimal-separator value must be exact one character.", null, n);
                        }
                        javaFormat.setDecimalSeparator(n.Value[0]);
                        break;

                    case "grouping-separator":
                        if (n.Value.Length != 1)
                        {
                            throw new XsltCompileException("XSLT grouping-separator value must be exact one character.", null, n);
                        }
                        javaFormat.setGroupingSeparator(n.Value[0]);
                        break;

                    case "infinity":
                        javaFormat.setInfinity(n.Value);
                        break;

                    case "minus-sign":
                        if (n.Value.Length != 1)
                        {
                            throw new XsltCompileException("XSLT minus-sign value must be exact one character.", null, n);
                        }
                        javaFormat.setMinusSign(n.Value[0]);
                        break;

                    case "NaN":
                        javaFormat.setNaN(n.Value);
                        break;

                    case "percent":
                        if (n.Value.Length != 1)
                        {
                            throw new XsltCompileException("XSLT percent value must be exact one character.", null, n);
                        }
                        javaFormat.setPercent(n.Value[0]);
                        break;

                    case "per-mille":
                        if (n.Value.Length != 1)
                        {
                            throw new XsltCompileException("XSLT per-mille value must be exact one character.", null, n);
                        }
                        javaFormat.setPerMill(n.Value[0]);
                        break;

                    case "digit":
                        if (n.Value.Length != 1)
                        {
                            throw new XsltCompileException("XSLT digit value must be exact one character.", null, n);
                        }
                        javaFormat.setDigit(n.Value[0]);
                        break;

                    case "zero-digit":
                        if (n.Value.Length != 1)
                        {
                            throw new XsltCompileException("XSLT zero-digit value must be exact one character.", null, n);
                        }
                        javaFormat.setZeroDigit(n.Value [0]);
                        break;

                    case "pattern-separator":
                        if (n.Value.Length != 1)
                        {
                            throw new XsltCompileException("XSLT pattern-separator value must be exact one character.", null, n);
                        }
                        javaFormat.setPatternSeparator(n.Value [0]);
                        break;
                    }
                } while (n.MoveToNextAttribute());
                n.MoveToParent();
            }
        }
		XslDecimalFormat ()
		{
			javaFormat = new java.text.DecimalFormatSymbols ();
			javaFormat.setNaN ("NaN");
			javaFormat.setInfinity ("Infinity");
		}
Пример #3
0
 XslDecimalFormat()
 {
     javaFormat = new java.text.DecimalFormatSymbols();
     javaFormat.setNaN("NaN");
     javaFormat.setInfinity("Infinity");
 }