Ejemplo n.º 1
0
        public static QNameValue Parse(string qname, XmlNamespaceManager resolver, string defaultNs)
        {
            string prefix;
            string localName;

            QNameParser.Split(qname.Trim(), out prefix, out localName);
            if (localName == null)
            {
                throw new XPath2Exception("FORG0001", Resources.FORG0001, qname, "xs:QName");
            }
            if (defaultNs == null)
            {
                defaultNs = String.Empty;
            }
            if (!String.IsNullOrEmpty(prefix))
            {
                string ns = resolver.LookupNamespace(prefix);
                if (ns == null)
                {
                    throw new XPath2Exception("XPST0081", Resources.XPST0081, prefix);
                }
                return(new QNameValue(prefix, localName, ns, resolver.NameTable));
            }
            else
            {
                return(new QNameValue("", localName, defaultNs, resolver.NameTable));
            }
        }
Ejemplo n.º 2
0
        public override void Bind()
        {
            XmlQualifiedName qname = QNameParser.Parse(_varName.ToString(),
                                                       Context.NamespaceManager, Context.NameTable);

            _varRef = Context.RunningContext.NameBinder.VarIndexByName(qname);
        }
Ejemplo n.º 3
0
        public override void Bind()
        {
            this[0].Bind();
            XmlQualifiedName qname = QNameParser.Parse(_varName.ToString(),
                                                       Context.NamespaceManager, Context.NameTable);

            _varRef = Context.RunningContext.NameBinder.PushVar(qname);
            this[1].Bind();
            Context.RunningContext.NameBinder.PopVar();
        }
Ejemplo n.º 4
0
        public static QNameValue Parse(string qname, string ns, XmlNameTable nameTable)
        {
            string prefix;
            string localName;

            QNameParser.Split(qname.Trim(), out prefix, out localName);
            if (localName == null)
            {
                throw new XPath2Exception("FORG0001", Resources.FORG0001, qname, "xs:QName");
            }
            return(new QNameValue(prefix, localName, ns, nameTable));
        }