Package net.sf.saxon.trace

Examples of net.sf.saxon.trace.InstructionInfo


    private static String getInstructionName(InstructionInfoProvider inst, XPathContext context) {
        if (context==null) {
            return "";
        }
        try {
            InstructionInfo info = inst.getInstructionInfo();
            int construct = info.getConstructType();
            if (construct < 1024 &&
                    construct != StandardNames.XSL_FUNCTION &&
                    construct != StandardNames.XSL_TEMPLATE) {
                // it's a standard name
                return StandardNames.getDisplayName(construct);
            }
            switch (construct) {
                case Location.LITERAL_RESULT_ELEMENT: {
                    int fp = info.getObjectNameCode();
                    String name = "element constructor";
                    if (context != null) {
                        name += " <" + context.getController().getNamePool().getDisplayName(fp) + '>';
                    }
                    return name;
                }
                case Location.LITERAL_RESULT_ATTRIBUTE: {
                    int fp = info.getObjectNameCode();
                    String name = "attribute constructor";
                    if (context != null) {
                        name += ' ' + context.getController().getNamePool().getDisplayName(fp) + "=\"{...}\"";
                    }
                    return name;
                }
                case StandardNames.XSL_FUNCTION: {
                    int fp = info.getObjectNameCode();
                    String name = "function";
                    if (context != null) {
                        name += ' ' + context.getController().getNamePool().getDisplayName(fp) + "()";
                    }
                    return name;
                }
                case StandardNames.XSL_TEMPLATE: {
                    int fp = info.getObjectNameCode();
                    String name = "template";
                    if (context != null && fp != -1) {
                        name += " name=\"" + context.getController().getNamePool().getDisplayName(fp) + '\"';
                    }
                    return name;
View Full Code Here


        if (context==null) {
            return "";
        }
        NamePool pool = context.getNamePool();
        try {
            InstructionInfo info = inst.getInstructionInfo();
            int construct = info.getConstructType();
            if (construct < 1024 &&
                    construct != StandardNames.XSL_FUNCTION &&
                    construct != StandardNames.XSL_TEMPLATE) {
                // it's a standard name
                if (context.getController().getExecutable().getHostLanguage() == Configuration.XSLT) {
                    return StandardNames.getDisplayName(construct);
                } else {
                    String s = StandardNames.getDisplayName(construct);
                    int colon = s.indexOf(':');
                    if (colon > 0) {
                        String local = s.substring(colon+1);
                        if (local.equals("document")) {
                            return "document node constructor";
                        } else if (local.equals("text") || s.equals("value-of")) {
                            return "text node constructor";
                        } else if (local.equals("element")) {
                            return "computed element constructor";
                        } else if (local.equals("attribute")) {
                            return "computed attribute constructor";
                        } else if (local.equals("variable")) {
                            return "variable declaration";
                        } else if (local.equals("param")) {
                            return "external variable declaration";
                        }
                    }
                    return s;
                }
            }
            switch (construct) {
                case Location.LITERAL_RESULT_ELEMENT: {
                    StructuredQName qName = info.getObjectName(pool);
                    String name = "element constructor";
                    if (context != null) {
                        name += " <" + qName.getDisplayName() + '>';
                    }
                    return name;
                }
                case Location.LITERAL_RESULT_ATTRIBUTE: {
                    StructuredQName qName = info.getObjectName(pool);
                    String name = "attribute constructor";
                    if (context != null) {
                        name += ' ' + qName.getDisplayName() + "=\"{...}\"";
                    }
                    return name;
                }
                case StandardNames.XSL_FUNCTION: {
                    StructuredQName qName = info.getObjectName(pool);
                    String name = "function";
                    if (context != null) {
                        name += ' ' + qName.getDisplayName() + "()";
                    }
                    return name;
                }
                case StandardNames.XSL_TEMPLATE: {
                    StructuredQName qName = info.getObjectName(pool);
                    String name = "template";
                    if (context != null && qName != null) {
                        name += " name=\"" + qName.getDisplayName() + '\"';
                    }
                    return name;
View Full Code Here

TOP

Related Classes of net.sf.saxon.trace.InstructionInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.