/** * This is the prefix that is associated with the source element. * If the source element does not contain a namespace reference * then this will return its parents namespace. This ensures * that if a namespace has been declared its child elements will * inherit its prefix. * * @return this returns the prefix that is currently in scope */ public String getPrefix() { return source.getPrefix(); }
/** * This is the prefix that is associated with the source element. * If the source element does not contain a namespace reference * then this will return its parents namespace. This ensures * that if a namespace has been declared its child elements will * inherit its prefix. * * @return this returns the prefix that is currently in scope */ public String getPrefix() { return source.getPrefix(); }
/** * This is the prefix that is associated with the source element. * If the source element does not contain a namespace reference * then this will return its parents namespace. This ensures * that if a namespace has been declared its child elements will * inherit its prefix. * * @return this returns the prefix that is currently in scope */ public String getPrefix() { return source.getPrefix(); }
/** * This is used to acquire the prefix for this output node. If * the output node is an element then this will search its parent * nodes until the prefix that is currently in scope is found. * If however this node is an attribute then the hierarchy of * nodes is not searched as attributes to not inherit namespaces. * * @param inherit if there is no explicit prefix then inherit * * @return this returns the prefix associated with this node */ public String getPrefix(boolean inherit) { String prefix = scope.getPrefix(reference); if(inherit) { if(prefix == null) { return parent.getPrefix(); } } return prefix; }
/** * This is used to acquire the prefix for this output node. If * the output node is an element then this will search its parent * nodes until the prefix that is currently in scope is found. * If however this node is an attribute then the hierarchy of * nodes is not searched as attributes to not inherit namespaces. * * @param inherit if there is no explicit prefix then inherit * * @return this returns the prefix associated with this node */ public String getPrefix(boolean inherit) { String prefix = scope.getPrefix(reference); if(inherit) { if(prefix == null) { return parent.getPrefix(); } } return prefix; }
/** * This is used to acquire the prefix for this output node. If * the output node is an element then this will search its parent * nodes until the prefix that is currently in scope is found. * If however this node is an attribute then the hierarchy of * nodes is not searched as attributes to not inherit namespaces. * * @param inherit if there is no explicit prefix then inherit * * @return this returns the prefix associated with this node */ public String getPrefix(boolean inherit) { String prefix = scope.getPrefix(reference); if(inherit) { if(prefix == null) { return parent.getPrefix(); } } return prefix; }
/** * This is used to write a new start element to the resulting XML * document. This will create an output node of the specified * name before writing the start tag. Once the tag is written * the node is pushed on to the head of the output node stack. * * @param node this is the node that is to have its name written */ private void writeName(OutputNode node) throws Exception { String prefix = node.getPrefix(verbose); String name = node.getName(); if(name != null) { writer.writeStart(name, prefix); } }
/** * This is used to write a new start element to the resulting XML * document. This will create an output node of the specified * name before writing the start tag. Once the tag is written * the node is pushed on to the head of the output node stack. * * @param node this is the node that is to have its name written */ private void writeName(OutputNode node) throws Exception { String prefix = node.getPrefix(verbose); String name = node.getName(); if(name != null) { writer.writeStart(name, prefix); } }
/** * This is used to write a new start element to the resulting XML * document. This will create an output node of the specified * name before writing the start tag. Once the tag is written * the node is pushed on to the head of the output node stack. * * @param node this is the node that is to have its name written */ private void writeName(OutputNode node) throws Exception { String prefix = node.getPrefix(verbose); String name = node.getName(); if(name != null) { writer.writeStart(name, prefix); } }
/** * 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 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(); } }