lookupNS() protected method

Test whether the URL is defined in the scope. Null is allowed to indicate the name space is undefined. Creation date: (11/16/03 7:54:01 PM)
When there is any encoding conversion error or unknown /// entity. ///
protected lookupNS ( ) : int
return int
Ejemplo n.º 1
0
        private String getNameSpaceURI(VTDNav vn)
        {
            if (argCount1 == 0)
            {
                try
                {
                    int i = vn.getCurrentIndex();
                    int type = vn.getTokenType(i);

                    if (vn.ns && (type == VTDNav.TOKEN_STARTING_TAG
                            || type == VTDNav.TOKEN_ATTR_NAME))
                    {
                        int a = vn.lookupNS();
                        if (a == 0)
                            return "";
                        else
                            return vn.toString(a);
                    }
                    return "";
                }
                catch (Exception e)
                {
                    return "";
                }
            }
            else if (argCount1 == 1 && argumentList.e.NodeSet)
            {
                vn.push2();
                int size = vn.contextStack2.size;
                int a = -1;
                try
                {
                    a = argumentList.e.evalNodeSet(vn);
                }
                catch (Exception e)
                {
                }
                String s = "";
                // return a;
                try
                {
                    if (a == -1 || vn.ns == false)
                    { }
                    else
                    {
                        int type = vn.getTokenType(a);
                        if (type == VTDNav.TOKEN_STARTING_TAG
                                || type == VTDNav.TOKEN_ATTR_NAME)
                            s = vn.toString(vn.lookupNS());

                    }
                }
                catch (Exception e) { };
                vn.contextStack2.size = size;
                argumentList.e.reset(vn);
                vn.pop2();
                return s;

            }
            else
                throw new System.ArgumentException
                ("namespace-uri()'s argument count is invalid");
        }