From e2876b2062f10e5c4f909923a63104bcaa8e20e9 Mon Sep 17 00:00:00 2001 From: benfry Date: Sat, 9 Aug 2008 19:56:19 +0000 Subject: [PATCH] change getName() to getLocalName(); and getFullName() to getName() --- xml/src/processing/xml/StdXMLBuilder.java | 2 +- xml/src/processing/xml/XMLElement.java | 20 ++++++++++---------- xml/src/processing/xml/XMLWriter.java | 12 ++++++------ 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/xml/src/processing/xml/StdXMLBuilder.java b/xml/src/processing/xml/StdXMLBuilder.java index 2fb848994..e7ee7f211 100644 --- a/xml/src/processing/xml/StdXMLBuilder.java +++ b/xml/src/processing/xml/StdXMLBuilder.java @@ -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); } diff --git a/xml/src/processing/xml/XMLElement.java b/xml/src/processing/xml/XMLElement.java index 66614d475..a0a0f5d8b 100644 --- a/xml/src/processing/xml/XMLElement.java +++ b/xml/src/processing/xml/XMLElement.java @@ -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()) { diff --git a/xml/src/processing/xml/XMLWriter.java b/xml/src/processing/xml/XMLWriter.java index eab5db26c..e96b181b4 100644 --- a/xml/src/processing/xml/XMLWriter.java +++ b/xml/src/processing/xml/XMLWriter.java @@ -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("'); + writer.print("'); if (prettyPrint) { writer.println(); @@ -243,7 +243,7 @@ public class XMLWriter } } - this.writer.print(""); + this.writer.print(""); if (prettyPrint) { writer.println();