/** * Write a processing instruction * No-op in this implementation */ public void processingInstruction(String target, CharSequence data, int locationId, int properties) 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, locationId, NodeInfo.ALL_NAMESPACES); } else { outputter.processingInstruction(target, data, locationId, properties); } previousAtomic = false; }
/** * Write a processing instruction * No-op in this implementation */ public void processingInstruction(String target, CharSequence data, int locationId, int properties) 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, locationId, NodeInfo.ALL_NAMESPACES); } else { outputter.processingInstruction(target, data, locationId, properties); } previousAtomic = false; }
/** * Output a namespace declaration. <br> * This is added to a list of pending namespaces for the current start tag. * If there is already another declaration of the same prefix, this one is * ignored. * Note that unlike SAX2 startPrefixMapping(), this call is made AFTER writing the start tag. * @param nscode The namespace code * @param properties Allows special properties to be passed if required * @throws net.sf.saxon.trans.XPathException if there is no start tag to write to (created using writeStartTag), * or if character content has been written since the start tag was written. */ public void namespace(int nscode, int properties) throws XPathException { if (level == 0) { NamePool namePool = getNamePool(); Orphan o = new Orphan(getConfiguration()); o.setNodeKind(Type.NAMESPACE); o.setNameCode(namePool.allocate("", "", namePool.getPrefixFromNamespaceCode(nscode))); o.setStringValue(namePool.getURIFromNamespaceCode(nscode)); append(o, 0, NodeInfo.ALL_NAMESPACES); } else { outputter.namespace(nscode, properties); } previousAtomic = false; }
/** * Output a namespace declaration. <br> * This is added to a list of pending namespaces for the current start tag. * If there is already another declaration of the same prefix, this one is * ignored. * Note that unlike SAX2 startPrefixMapping(), this call is made AFTER writing the start tag. * @param nscode The namespace code * @param properties Allows special properties to be passed if required * @throws net.sf.saxon.trans.XPathException if there is no start tag to write to (created using writeStartTag), * or if character content has been written since the start tag was written. */ public void namespace(int nscode, int properties) throws XPathException { if (level == 0) { NamePool namePool = getNamePool(); Orphan o = new Orphan(getConfiguration()); o.setNodeKind(Type.NAMESPACE); o.setNameCode(namePool.allocate("", "", namePool.getPrefixFromNamespaceCode(nscode))); o.setStringValue(namePool.getURIFromNamespaceCode(nscode)); append(o, 0, NodeInfo.ALL_NAMESPACES); } else { outputter.namespace(nscode, properties); } previousAtomic = false; }