/** * This method is used to remove the output node from the output * buffer if that node has not yet been committed. This allows a * node that has been created to be deleted, ensuring that it * will not affect the resulting XML document structure. * * @param node this is the output node that is to be removed */ public void remove(OutputNode node) throws Exception { if(stack.top() != node) { throw new NodeException("Cannot remove node"); } stack.pop(); }
/** * This method is used to remove the output node from the output * buffer if that node has not yet been committed. This allows a * node that has been created to be deleted, ensuring that it * will not affect the resulting XML document structure. * * @param node this is the output node that is to be removed */ public void remove(OutputNode node) throws Exception { if(stack.top() != node) { throw new NodeException("Cannot remove node"); } stack.pop(); }
/** * This method is used to remove the output node from the output * buffer if that node has not yet been committed. This allows a * node that has been created to be deleted, ensuring that it * will not affect the resulting XML document structure. * * @param node this is the output node that is to be removed */ public void remove(OutputNode node) throws Exception { if(stack.top() != node) { throw new NodeException("Cannot remove node"); } stack.pop(); }
/** * This method is used to commit all nodes on the stack up to and * including the specified node. This will effectively create end * tags for any nodes that are currently open up to the specified * element. Once committed the output node can no longer be used * to create child elements, nor can any of its child elements. * * @param parent this is the node that is to be committed */ public void commit(OutputNode parent) throws Exception { if(stack.contains(parent)) { OutputNode top = stack.top(); if(!isCommitted(top)) { writeStart(top); } while(stack.top() != parent) { writeEnd(stack.pop()); } writeEnd(parent); stack.pop(); } }
/** * This method is used to commit all nodes on the stack up to and * including the specified node. This will effectively create end * tags for any nodes that are currently open up to the specified * element. Once committed the output node can no longer be used * to create child elements, nor can any of its child elements. * * @param parent this is the node that is to be committed */ public void commit(OutputNode parent) throws Exception { if(stack.contains(parent)) { OutputNode top = stack.top(); if(!isCommitted(top)) { writeStart(top); } while(stack.top() != parent) { writeEnd(stack.pop()); } writeEnd(parent); stack.pop(); } }
/** * This method is used to commit all nodes on the stack up to and * including the specified node. This will effectively create end * tags for any nodes that are currently open up to the specified * element. Once committed the output node can no longer be used * to create child elements, nor can any of its child elements. * * @param parent this is the node that is to be committed */ public void commit(OutputNode parent) throws Exception { if(stack.contains(parent)) { OutputNode top = stack.top(); if(!isCommitted(top)) { writeStart(top); } while(stack.top() != parent) { writeEnd(stack.pop()); } writeEnd(parent); stack.pop(); } }