ResolveXmlNamespace() public method

public ResolveXmlNamespace ( string prefix ) : string
prefix string
return string
        private static PrefixQName CreateElementQName(string name, string nsUri, InputScopeManager manager) {
            if (nsUri == XmlReservedNs.NsXmlNs) {
                throw XsltException.Create(Res.Xslt_ReservedNS, nsUri);
            }

            PrefixQName qname = new PrefixQName();
            qname.SetQName(name);

            if (nsUri == null) {
                qname.Namespace = manager.ResolveXmlNamespace(qname.Prefix);
            }
            else {
                qname.Namespace = nsUri;
            }
            return qname;
        }
        private XmlDataType ParseDataType(string value, InputScopeManager manager) {
            if(value == null) { // Avt is not constant, or attribute wasn't defined
                return XmlDataType.Text; 
            }
            if (value == Keywords.s_Text) {
                return XmlDataType.Text;
            }
            if (value == Keywords.s_Number) {
                return XmlDataType.Number; 
            }
            String prefix, localname;
            PrefixQName.ParseQualifiedName(value, out prefix, out localname);
			manager.ResolveXmlNamespace(prefix);
            if (prefix.Length == 0 && ! this.forwardCompatibility) {
                throw XsltException.Create(Res.Xslt_InvalidAttrValue, Keywords.s_DataType, value); 
            }
            return XmlDataType.Text;
        }
示例#3
0
        private static PrefixQName CreateElementQName(string name, string nsUri, InputScopeManager manager)
        {
            if (nsUri == XmlReservedNs.NsXmlNs)
            {
                throw XsltException.Create(SR.Xslt_ReservedNS, nsUri);
            }

            PrefixQName qname = new PrefixQName();

            qname.SetQName(name);

            if (nsUri == null)
            {
                qname.Namespace = manager.ResolveXmlNamespace(qname.Prefix);
            }
            else
            {
                qname.Namespace = nsUri;
            }
            return(qname);
        }
示例#4
0
        private XmlDataType ParseDataType(string value, InputScopeManager manager)
        {
            if (value == null)
            { // Avt is not constant, or attribute wasn't defined
                return(XmlDataType.Text);
            }
            if (value == "text")
            {
                return(XmlDataType.Text);
            }
            if (value == "number")
            {
                return(XmlDataType.Number);
            }
            String prefix, localname;

            PrefixQName.ParseQualifiedName(value, out prefix, out localname);
            manager.ResolveXmlNamespace(prefix);
            if (prefix.Length == 0 && !_forwardCompatibility)
            {
                throw XsltException.Create(SR.Xslt_InvalidAttrValue, "data-type", value);
            }
            return(XmlDataType.Text);
        }