public final static String escapeXMLChars(String input) { return escapeXMLChars(input, true); }
public void outputAttributes(PrintWriter ps) { int nAttributes = getNAttributes(); for (int n=0; n<nAttributes; n++) { Attribute attr = getAttribute(n); ps.print(" " + attr.getName() + "=\"" + XML.escapeXMLChars(attr.getValue()) + "\""); } }
public void output(PrintWriter ps, int indentLevel, boolean hasChildNode) { String indentString = getIndentLevelString(indentLevel); String name = getName(); String value = getValue(); if (hasNodes() == false || hasChildNode == false) { ps.print(indentString + "<" + name); outputAttributes(ps); // Thnaks for Tho Beisch (11/09/04) if (value == null || value.length() == 0) { // Not using the short notation <node /> because it cause compatibility trouble ps.println("></" + name + ">"); } else { ps.println(">" + XML.escapeXMLChars(value) + "</" + name + ">"); } return; } ps.print(indentString + "<" + name); outputAttributes(ps); ps.println(">"); int nChildNodes = getNNodes(); for (int n=0; n<nChildNodes; n++) { Node cnode = getNode(n); cnode.output(ps, indentLevel+1, true); } ps.println(indentString +"</" + name + ">"); }
public final static String escapeXMLChars(String input) { return escapeXMLChars(input, true); }
public final static String escapeXMLChars(String input) { return escapeXMLChars(input, true); }
public void outputAttributes(PrintWriter ps) { int nAttributes = getNAttributes(); for (int n=0; n<nAttributes; n++) { Attribute attr = getAttribute(n); ps.print(" " + attr.getName() + "=\"" + XML.escapeXMLChars(attr.getValue()) + "\""); } }
public void outputAttributes(PrintWriter ps) { int nAttributes = getNAttributes(); for (int n=0; n<nAttributes; n++) { Attribute attr = getAttribute(n); ps.print(" " + attr.getName() + "=\"" + XML.escapeXMLChars(attr.getValue()) + "\""); } }
public void output(PrintWriter ps, int indentLevel, boolean hasChildNode) { String indentString = getIndentLevelString(indentLevel); String name = getName(); String value = getValue(); if (hasNodes() == false || hasChildNode == false) { ps.print(indentString + "<" + name); outputAttributes(ps); // Thnaks for Tho Beisch (11/09/04) if (value == null || value.length() == 0) { // Not using the short notation <node /> because it cause compatibility trouble ps.println("></" + name + ">"); } else { ps.println(">" + XML.escapeXMLChars(value) + "</" + name + ">"); } return; } ps.print(indentString + "<" + name); outputAttributes(ps); ps.println(">"); int nChildNodes = getNNodes(); for (int n=0; n<nChildNodes; n++) { Node cnode = getNode(n); cnode.output(ps, indentLevel+1, true); } ps.println(indentString +"</" + name + ">"); }
public void output(PrintWriter ps, int indentLevel, boolean hasChildNode) { String indentString = getIndentLevelString(indentLevel); String name = getName(); String value = getValue(); if (hasNodes() == false || hasChildNode == false) { ps.print(indentString + "<" + name); outputAttributes(ps); // Thnaks for Tho Beisch (11/09/04) if (value == null || value.length() == 0) { // Not using the short notation <node /> because it cause compatibility trouble ps.println("></" + name + ">"); } else { ps.println(">" + XML.escapeXMLChars(value) + "</" + name + ">"); } return; } ps.print(indentString + "<" + name); outputAttributes(ps); ps.println(">"); int nChildNodes = getNNodes(); for (int n=0; n<nChildNodes; n++) { Node cnode = getNode(n); cnode.output(ps, indentLevel+1, true); } ps.println(indentString +"</" + name + ">"); }