Examples of Orphan


Examples of client.net.sf.saxon.ce.tree.util.Orphan

            return null;
        }
        String content = contentItem.getStringValue();
        content = checkContent(content, context);
        final TypeHierarchy th = context.getConfiguration().getTypeHierarchy();
        Orphan o = new Orphan(context.getConfiguration());
        o.setNodeKind((short)getItemType(th).getPrimitiveType());
        o.setStringValue(content);
        o.setNameCode(evaluateNameCode(context));
        return o;
    }
View Full Code Here

Examples of client.net.sf.saxon.ce.tree.util.Orphan

                    next = base.next();
                }
                if (fsb.length() == 0) {
                    return next();
                } else {
                    Orphan o = new Orphan(((NodeInfo)current).getConfiguration());
                    o.setNodeKind(Type.TEXT);
                    o.setStringValue(fsb);
                    current = o;
                    position++;
                    return current;
                }
            } else {
View Full Code Here

Examples of client.net.sf.saxon.ce.tree.util.Orphan

    public void namespace(NamespaceBinding nsBinding, int properties)
    throws XPathException {
        if (level == 0) {
            NamePool namePool = getNamePool();
            Orphan o = new Orphan(getConfiguration());
            o.setNodeKind(Type.NAMESPACE);
            o.setNameCode(namePool.allocate("", "", nsBinding.getPrefix()));
            o.setStringValue(nsBinding.getURI());
            append(o, NodeInfo.ALL_NAMESPACES);
        } else {
            outputter.namespace(nsBinding, properties);
        }
        previousAtomic = false;
View Full Code Here

Examples of client.net.sf.saxon.ce.tree.util.Orphan

    */

    public void attribute(int nameCode, CharSequence value)
    throws XPathException {
        if (level == 0) {
            Orphan o = new Orphan(getConfiguration());
            o.setNodeKind(Type.ATTRIBUTE);
            o.setNameCode(nameCode);
            o.setStringValue(value);
            append(o, NodeInfo.ALL_NAMESPACES);
        } else {
            outputter.attribute(nameCode, value);
        }
        previousAtomic = false;
View Full Code Here

Examples of client.net.sf.saxon.ce.tree.util.Orphan

    * @throws client.net.sf.saxon.ce.trans.XPathException for any failure
    */

    public void characters(CharSequence s) throws XPathException {
        if (level == 0) {
            Orphan o = new Orphan(getConfiguration());
            o.setNodeKind(Type.TEXT);
            o.setStringValue(s.toString());
            append(o, NodeInfo.ALL_NAMESPACES);
        } else {
            if (s.length() > 0) {
                if (inStartTag) {
                    startContent();
View Full Code Here

Examples of client.net.sf.saxon.ce.tree.util.Orphan

    public void comment(CharSequence comment) throws XPathException {
        if (inStartTag) {
            startContent();
        }
        if (level == 0) {
            Orphan o = new Orphan(getConfiguration());
            o.setNodeKind(Type.COMMENT);
            o.setStringValue(comment);
            append(o, NodeInfo.ALL_NAMESPACES);
        } else {
            outputter.comment(comment);
        }
        previousAtomic = false;
View Full Code Here

Examples of client.net.sf.saxon.ce.tree.util.Orphan

    public void processingInstruction(String target, CharSequence data) throws XPathException {
        if (inStartTag) {
            startContent();
        }
        if (level == 0) {
            Orphan o = new Orphan(getConfiguration());
            o.setNameCode(getNamePool().allocate("", "", target));
            o.setNodeKind(Type.PROCESSING_INSTRUCTION);
            o.setStringValue(data);
            append(o, NodeInfo.ALL_NAMESPACES);
        } else {
            outputter.processingInstruction(target, data);
        }
        previousAtomic = false;
View Full Code Here

Examples of client.net.sf.saxon.ce.tree.util.Orphan

                    val = "";
                }
            } else {
                val = item.getStringValueCS();
            }
            Orphan o = new Orphan(context.getController().getConfiguration());
            o.setNodeKind(Type.TEXT);
            o.setStringValue(val);
            return o;
        } catch (XPathException err) {
            err.maybeSetLocation(getSourceLocator());
            throw err;
        }
View Full Code Here

Examples of net.sf.saxon.om.Orphan

                    break;
                }

            case ATTRIBUTE:
                if (out instanceof SequenceReceiver) {
                    Orphan o = new Orphan(in.getPipelineConfiguration().getConfiguration());
                    o.setNameCode(getNameCode());
                    o.setNodeKind(Type.ATTRIBUTE);
                    o.setStringValue(getStringValue());
                    ((SequenceReceiver)out).append(o, 0, 0);
                    break;
                } else {
                    out.attribute(getNameCode(), getTypeAnnotation(), getStringValue(), 0, 0);
                    break;
                    //throw new XPathException("Cannot serialize a free-standing attribute node");
                }

            case NAMESPACE:
                 if (out instanceof SequenceReceiver) {
                    Orphan o = new Orphan(in.getPipelineConfiguration().getConfiguration());
                    o.setNameCode(getNameCode());
                    o.setNodeKind(Type.NAMESPACE);
                    o.setStringValue(getStringValue());
                    ((SequenceReceiver)out).append(o, 0, 0);
                    break;
                } else {
                     int nsCode = getNamePool().getNamespaceCode(getNameCode());
                     out.namespace(nsCode, 0);
View Full Code Here

Examples of net.sf.saxon.om.Orphan

            for (int a=0; a<attributes.size(); a++) {
                NodeInfo oldAtt = (NodeInfo)attributes.get(a);
                int oldCode = oldAtt.getNameCode();
                int newCode = fixup(pool, oldCode, a);
                if (oldCode != newCode) {
                    Orphan att = new Orphan(oldAtt.getConfiguration());
                    att.setNodeKind(Type.ATTRIBUTE);
                    att.setNameCode(newCode);
                    att.setStringValue(oldAtt.getStringValue());
                    att.setTypeAnnotation(oldAtt.getTypeAnnotation());
                    att.setSystemId(oldAtt.getSystemId());
                    attributes.set(a, att);
                }
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.