toNormalizedXPathString() 공개 메소드

public toNormalizedXPathString ( int j ) : String
j int
리턴 String
예제 #1
0
        private System.String normalizeSpace(VTDNav vn)
        {
            if (argCount1 == 0)
            {
                String s = null;
                try
                {
                    if (vn.atTerminal)
                    {
                        int ttype = vn.getTokenType(vn.LN);
                        if (ttype == VTDNav.TOKEN_CDATA_VAL)
                            s = vn.toRawString(vn.LN);
                        else if (ttype == VTDNav.TOKEN_ATTR_NAME ||
                             ttype == VTDNav.TOKEN_ATTR_NS)
                        {
                            s = vn.toString(vn.LN + 1);
                        }
                        else
                            s = vn.toString(vn.LN);
                    }
                    else
                    {
                        int i = vn.getCurrentIndex();
                        int t = vn.getTokenType(i);
                        if (t == VTDNav.TOKEN_STARTING_TAG || t == VTDNav.TOKEN_DOCUMENT)
                        {
                            s = vn.toNormalizedXPathString(i);
                        }
                        else
                            s = vn.toNormalizedString(i);
                    }
                    return normalize(s);
                }
                catch (NavException e)
                {
                    return ""; // this will almost never occur
                }
            }
            else if (argCount1 == 1)
            {
                String s = "";
                if (argumentList.e.NodeSet)
                {
                    //boolean b = false;
                    int a = evalFirstArgumentListNodeSet(vn);
                    if (a == -1)
                        return "";
                    else
                    {
                        try
                        {
                            int t = vn.getTokenType(a);
                            if (t == VTDNav.TOKEN_STARTING_TAG || t == VTDNav.TOKEN_DOCUMENT)
                            {
                                s = vn.toNormalizedXPathString(a);
                            }
                            else
                                s = vn.toNormalizedString(a);
                        }
                        catch (Exception e)
                        {
                        }
                        return s;
                    }
                }
                else
                {
                    s = argumentList.e.evalString(vn);
                    return normalize(s);
                }
	        
            }
            throw new System.ArgumentException("normalize-space()'s argument count is invalid");
            //return null;
        }