From caa9faf57c46d0e41c717ffa417713acd70b76d1 Mon Sep 17 00:00:00 2001 From: benfry Date: Mon, 5 May 2008 01:05:22 +0000 Subject: [PATCH] cleaning up errors and warnings --- xml/src/processing/xml/StdXMLParser.java | 51 +++++++++++------------- xml/src/processing/xml/XMLElement.java | 6 +-- xml/src/processing/xml/XMLUtil.java | 2 + 3 files changed, 29 insertions(+), 30 deletions(-) diff --git a/xml/src/processing/xml/StdXMLParser.java b/xml/src/processing/xml/StdXMLParser.java index c286a0b9d..fc2c7ba1c 100644 --- a/xml/src/processing/xml/StdXMLParser.java +++ b/xml/src/processing/xml/StdXMLParser.java @@ -298,13 +298,13 @@ public class StdXMLParser { XMLUtil.skipWhitespace(this.reader, null); String target = XMLUtil.scanIdentifier(this.reader); XMLUtil.skipWhitespace(this.reader, null); - Reader reader = new PIReader(this.reader); - - if (! target.equalsIgnoreCase("xml")) { - this.builder.newProcessingInstruction(target, reader); + Reader r = new PIReader(this.reader); + + if (!target.equalsIgnoreCase("xml")) { + this.builder.newProcessingInstruction(target, r); } - reader.close(); + r.close(); } @@ -356,9 +356,7 @@ public class StdXMLParser { * @throws java.lang.Exception * if something went wrong */ - protected void processCDATA() - throws Exception - { + protected void processCDATA() throws Exception { if (! XMLUtil.checkLiteral(this.reader, "CDATA[")) { XMLUtil.errorExpectedInput(reader.getSystemID(), reader.getLineNr(), @@ -367,10 +365,10 @@ public class StdXMLParser { this.validator.PCDataAdded(this.reader.getSystemID(), this.reader.getLineNr()); - Reader reader = new CDATAReader(this.reader); - this.builder.addPCData(reader, this.reader.getSystemID(), + Reader r = new CDATAReader(this.reader); + this.builder.addPCData(r, this.reader.getSystemID(), this.reader.getLineNr()); - reader.close(); + r.close(); } @@ -389,7 +387,7 @@ public class StdXMLParser { } XMLUtil.skipWhitespace(this.reader, null); - String systemID = null; +// String systemID = null; StringBuffer publicID = new StringBuffer(); /*String rootElement =*/ XMLUtil.scanIdentifier(this.reader); //System.out.println("rootElement is " + rootElement); @@ -397,11 +395,11 @@ public class StdXMLParser { char ch = this.reader.read(); if (ch == 'P') { - systemID = XMLUtil.scanPublicID(publicID, reader); +// systemID = XMLUtil.scanPublicID(publicID, reader); XMLUtil.skipWhitespace(this.reader, null); ch = this.reader.read(); } else if (ch == 'S') { - systemID = XMLUtil.scanSystemID(reader); +// systemID = XMLUtil.scanSystemID(reader); XMLUtil.skipWhitespace(this.reader, null); ch = this.reader.read(); } @@ -421,19 +419,18 @@ public class StdXMLParser { "`>'"); } - if (false) { // TODO currently disabled - if (systemID != null) { - Reader reader = this.reader.openStream(publicID.toString(), - systemID); - this.reader.startNewStream(reader); - this.reader.setSystemID(systemID); - this.reader.setPublicID(publicID.toString()); - this.validator.parseDTD(publicID.toString(), - this.reader, - this.entityResolver, - true); - } - } +// if (false) { // TODO currently disabled +// if (systemID != null) { +// Reader r = this.reader.openStream(publicID.toString(), systemID); +// this.reader.startNewStream(r); +// this.reader.setSystemID(systemID); +// this.reader.setPublicID(publicID.toString()); +// this.validator.parseDTD(publicID.toString(), +// this.reader, +// this.entityResolver, +// true); +// } +// } } diff --git a/xml/src/processing/xml/XMLElement.java b/xml/src/processing/xml/XMLElement.java index c413b16f3..6cc55fbda 100644 --- a/xml/src/processing/xml/XMLElement.java +++ b/xml/src/processing/xml/XMLElement.java @@ -1093,10 +1093,10 @@ public class XMLElement implements Serializable { String namespace, String value) { int index = fullName.indexOf(':'); - String name = fullName.substring(index + 1); - XMLAttribute attr = this.findAttribute(name, namespace); + String vorname = fullName.substring(index + 1); + XMLAttribute attr = this.findAttribute(vorname, namespace); if (attr == null) { - attr = new XMLAttribute(fullName, name, namespace, value, "CDATA"); + attr = new XMLAttribute(fullName, vorname, namespace, value, "CDATA"); this.attributes.addElement(attr); } else { attr.setValue(value); diff --git a/xml/src/processing/xml/XMLUtil.java b/xml/src/processing/xml/XMLUtil.java index 261019b13..6adad79be 100644 --- a/xml/src/processing/xml/XMLUtil.java +++ b/xml/src/processing/xml/XMLUtil.java @@ -75,6 +75,8 @@ class XMLUtil if (dashesRead == 2) { return; } + dashesRead = 0; + break; default: dashesRead = 0;