change getName() to getLocalName(); and getFullName() to getName()

This commit is contained in:
benfry
2008-08-09 19:56:19 +00:00
parent 59e55dda83
commit e2876b2062
3 changed files with 17 additions and 17 deletions
+1 -1
View File
@@ -234,7 +234,7 @@ public class StdXMLBuilder
if (elt.getChildCount() == 1) {
XMLElement child = elt.getChildAtIndex(0);
if (child.getName() == null) {
if (child.getLocalName() == null) {
elt.setContent(child.getContent());
elt.removeChildAtIndex(0);
}
+10 -10
View File
@@ -350,7 +350,7 @@ public class XMLElement implements Serializable {
*
* @return the name, or null if the element only contains #PCDATA.
*/
public String getFullName() {
public String getName() {
return this.fullName;
}
@@ -360,7 +360,7 @@ public class XMLElement implements Serializable {
*
* @return the name, or null if the element only contains #PCDATA.
*/
public String getName() {
public String getLocalName() {
return this.name;
}
@@ -416,10 +416,10 @@ public class XMLElement implements Serializable {
if (child == null) {
throw new IllegalArgumentException("child must not be null");
}
if ((child.getName() == null) && (! this.children.isEmpty())) {
if ((child.getLocalName() == null) && (! this.children.isEmpty())) {
XMLElement lastChild = (XMLElement) this.children.lastElement();
if (lastChild.getName() == null) {
if (lastChild.getLocalName() == null) {
lastChild.setContent(lastChild.getContent()
+ child.getContent());
return;
@@ -440,9 +440,9 @@ public class XMLElement implements Serializable {
if (child == null) {
throw new IllegalArgumentException("child must not be null");
}
if ((child.getName() == null) && (! this.children.isEmpty())) {
if ((child.getLocalName() == null) && (! this.children.isEmpty())) {
XMLElement lastChild = (XMLElement) this.children.lastElement();
if (lastChild.getName() == null) {
if (lastChild.getLocalName() == null) {
lastChild.setContent(lastChild.getContent()
+ child.getContent());
return;
@@ -559,7 +559,7 @@ public class XMLElement implements Serializable {
int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
XMLElement kid = getChild(i);
if (kid.getFullName().equals(name)) {
if (kid.getName().equals(name)) {
return kid;
}
}
@@ -587,7 +587,7 @@ public class XMLElement implements Serializable {
int childCount = getChildCount();
for (int i = 0; i < childCount; i++) {
XMLElement kid = getChild(i);
if (kid.getFullName().equals(items[offset])) {
if (kid.getName().equals(items[offset])) {
if (offset == items.length-1) {
return kid;
} else {
@@ -685,7 +685,7 @@ public class XMLElement implements Serializable {
int matchCount = 0;
for (int i = 0; i < childCount; i++) {
XMLElement kid = getChild(i);
if (kid.getFullName().equals(name)) {
if (kid.getName().equals(name)) {
matches[matchCount++] = kid;
}
}
@@ -1279,7 +1279,7 @@ public class XMLElement implements Serializable {
* @param rawElement the element to compare to
*/
public boolean equalsXMLElement(XMLElement elt) {
if (! this.name.equals(elt.getName())) {
if (! this.name.equals(elt.getLocalName())) {
return false;
}
if (this.attributes.size() != elt.getAttributeCount()) {
+6 -6
View File
@@ -156,7 +156,7 @@ public class XMLWriter
}
}
if (xml.getName() == null) {
if (xml.getLocalName() == null) {
if (xml.getContent() != null) {
if (prettyPrint) {
this.writeEncoded(xml.getContent().trim());
@@ -167,14 +167,14 @@ public class XMLWriter
}
} else {
this.writer.print('<');
this.writer.print(xml.getFullName());
this.writer.print(xml.getName());
Vector nsprefixes = new Vector();
if (xml.getNamespace() != null) {
if (xml.getName().equals(xml.getFullName())) {
if (xml.getLocalName().equals(xml.getName())) {
this.writer.print(" xmlns=\"" + xml.getNamespace() + '"');
} else {
String prefix = xml.getFullName();
String prefix = xml.getName();
prefix = prefix.substring(0, prefix.indexOf(':'));
nsprefixes.addElement(prefix);
this.writer.print(" xmlns:" + prefix);
@@ -217,7 +217,7 @@ public class XMLWriter
&& (xml.getContent().length() > 0)) {
writer.print('>');
this.writeEncoded(xml.getContent());
writer.print("</" + xml.getFullName() + '>');
writer.print("</" + xml.getName() + '>');
if (prettyPrint) {
writer.println();
@@ -243,7 +243,7 @@ public class XMLWriter
}
}
this.writer.print("</" + xml.getFullName() + ">");
this.writer.print("</" + xml.getName() + ">");
if (prettyPrint) {
writer.println();