System.Xml.Xsl.Runtime.XsltFunctions.SystemProperty C# (CSharp) Method

SystemProperty() public static method

public static SystemProperty ( XmlQualifiedName name ) : XPathItem
name XmlQualifiedName
return System.Xml.XPath.XPathItem
        public static XPathItem SystemProperty(XmlQualifiedName name)
        {
            if (name.Namespace == XmlReservedNs.NsXslt)
            {
                // "xsl:version" must return 1.0 as a number, see http://www.w3.org/TR/xslt20/#incompatility-without-schema
                switch (name.Name)
                {
                    case "version": return new XmlAtomicValue(XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.Double), 1.0);
                    case "vendor": return new XmlAtomicValue(XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String), "Microsoft");
                    case "vendor-url": return new XmlAtomicValue(XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String), "http://www.microsoft.com");
                }
            }
            else if (name.Namespace == XmlReservedNs.NsMsxsl && name.Name == "version")
            {
                // msxsl:version
                return new XmlAtomicValue(XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String), typeof(XsltLibrary).GetTypeInfo().Assembly.ImageRuntimeVersion);
            }
            // If the property name is not recognized, return the empty string
            return new XmlAtomicValue(XmlSchemaType.GetBuiltInSimpleType(XmlTypeCode.String), string.Empty);
        }