/** * This is used to write the attributes of the specified node to * the output. This will iterate over each node entered on to * the node. Once written the node is considered inactive. * * @param node this is the node to have is attributes written */ private void writeAttributes(OutputNode node) throws Exception { NodeMap<OutputNode> map = node.getAttributes(); for(String name : map) { OutputNode entry = map.get(name); String value = entry.getValue(); String prefix = entry.getPrefix(verbose); writer.writeAttribute(name, value, prefix); } active.remove(node); }
/** * This is used to write the attributes of the specified node to * the output. This will iterate over each node entered on to * the node. Once written the node is considered inactive. * * @param node this is the node to have is attributes written */ private void writeAttributes(OutputNode node) throws Exception { NodeMap<OutputNode> map = node.getAttributes(); for(String name : map) { OutputNode entry = map.get(name); String value = entry.getValue(); String prefix = entry.getPrefix(verbose); writer.writeAttribute(name, value, prefix); } active.remove(node); }
/** * This is used to write the attributes of the specified node to * the output. This will iterate over each node entered on to * the node. Once written the node is considered inactive. * * @param node this is the node to have is attributes written */ private void writeAttributes(OutputNode node) throws Exception { NodeMap<OutputNode> map = node.getAttributes(); for(String name : map) { OutputNode entry = map.get(name); String value = entry.getValue(); String prefix = entry.getPrefix(verbose); writer.writeAttribute(name, value, prefix); } active.remove(node); }
/** * This is used to write an element value to the resulting XML * document. This will search the nodes parents for the write * mode, if the mode is CDATA then that is what is used to write * the data, otherwise the value is written as plain text. * <p> * One side effect of this method is that it clears the value * of the output node once it has been written to the XML. This * is needed, it can however cause confusion within the API. * * @param node this is the node to write the value of */ private void writeValue(OutputNode node) throws Exception { Mode mode = node.getMode(); String value = node.getValue(); if(value != null) { for(OutputNode next : stack) { if(mode != Mode.INHERIT) { break; } mode = next.getMode(); } writer.writeText(value, mode); } node.setValue(null); }
/** * This is used to write an element value to the resulting XML * document. This will search the nodes parents for the write * mode, if the mode is CDATA then that is what is used to write * the data, otherwise the value is written as plain text. * <p> * One side effect of this method is that it clears the value * of the output node once it has been written to the XML. This * is needed, it can however cause confusion within the API. * * @param node this is the node to write the value of */ private void writeValue(OutputNode node) throws Exception { Mode mode = node.getMode(); String value = node.getValue(); if(value != null) { for(OutputNode next : stack) { if(mode != Mode.INHERIT) { break; } mode = next.getMode(); } writer.writeText(value, mode); } node.setValue(null); }
/** * This is used to write an element value to the resulting XML * document. This will search the nodes parents for the write * mode, if the mode is CDATA then that is what is used to write * the data, otherwise the value is written as plain text. * <p> * One side effect of this method is that it clears the value * of the output node once it has been written to the XML. This * is needed, it can however cause confusion within the API. * * @param node this is the node to write the value of */ private void writeValue(OutputNode node) throws Exception { Mode mode = node.getMode(); String value = node.getValue(); if(value != null) { for(OutputNode next : stack) { if(mode != Mode.INHERIT) { break; } mode = next.getMode(); } writer.writeText(value, mode); } node.setValue(null); }
/** * This is used to write a new end element to the resulting XML * document. This will acquire the name and value of the given * node, if the node has a value that is written. Finally a new * end tag is written to the document and the output is flushed. * * @param node this is the node that is to have an end tag */ private void writeEnd(OutputNode node) throws Exception { String name = node.getName(); String prefix = node.getPrefix(verbose); String value = node.getValue(); if(value != null) { writeValue(node); } if(name != null) { writer.writeEnd(name, prefix); writer.flush(); } }
/** * This is used to write a new end element to the resulting XML * document. This will acquire the name and value of the given * node, if the node has a value that is written. Finally a new * end tag is written to the document and the output is flushed. * * @param node this is the node that is to have an end tag */ private void writeEnd(OutputNode node) throws Exception { String name = node.getName(); String prefix = node.getPrefix(verbose); String value = node.getValue(); if(value != null) { writeValue(node); } if(name != null) { writer.writeEnd(name, prefix); writer.flush(); } }
/** * This is used to write a new end element to the resulting XML * document. This will acquire the name and value of the given * node, if the node has a value that is written. Finally a new * end tag is written to the document and the output is flushed. * * @param node this is the node that is to have an end tag */ private void writeEnd(OutputNode node) throws Exception { String name = node.getName(); String prefix = node.getPrefix(verbose); String value = node.getValue(); if(value != null) { writeValue(node); } if(name != null) { writer.writeEnd(name, prefix); writer.flush(); } }