public synchronized void endElement(String uri, String localName, String qName) {

			if (progressBar != null) {
				elementCounter++;
				if (elementCounter % 20 == 0)
					EventQueue.invokeLater(reportProgress);
			}

			str = buffer.toString();

			// qName = qName.intern(); // it seems no need to do string pooling here

			if (qName == "language") {
				page.setCharacterEncoding(str);
			}

			else if (qName == "page_title") {
				pageTitle = str;
			}

			else if (qName == "referenced_files") {
				referencedFiles = str;
			}

			else if (qName == "bgsound") {
				page.setBackgroundSound(str);
			}

			else if (qName == "mute") {
				mute = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "color") {
				Integer ig = Parser.parseInt(str, 16);
				if (ig != null)
					argb = ig.intValue();
			}

			else if (qName == "bgcolor") {
				Integer ig = Parser.parseInt(str, 16);
				if (ig != null)
					argb1 = ig.intValue();
			}

			else if (qName == "fgcolor") {
				Integer ig = Parser.parseInt(str, 16);
				if (ig != null)
					argb2 = ig.intValue();
			}

			/* ********************************************************** */
			// back compatible to old color encoding
			else if (qName == "red") {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					red = ig.intValue();
			}
			else if (qName == "green") {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					green = ig.intValue();
			}
			else if (qName == "blue") {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					blue = ig.intValue();
				argb1 = (0xff << 24) | (red << 16) | (green << 8) | blue;
				red = green = blue = -1;
			}
			else if (qName == "Red") {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					Red = ig.intValue();
			}
			else if (qName == "Green") {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					Green = ig.intValue();
			}
			else if (qName == "Blue") {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					Blue = ig.intValue();
				argb2 = (0xff << 24) | (Red << 16) | (Green << 8) | Blue;
				Red = Green = Blue = -1;
			}
			/* ********************************************************** */

			else if (qName.startsWith("bg_")) {
				if (qName.endsWith("gradient")) {
					setBackgroundGradient();
				}
				else if (qName.endsWith("pattern")) {
					setBackgroundPattern();
				}
				else if (qName.endsWith("color")) {
					if ((argb2 | ARGB_NOT_SET) != ARGB_NOT_SET) {
						setBackgroundColor();
						argb2 = ARGB_NOT_SET;
					}
					else {
						Integer ig = Parser.parseInt(str, 16);
						if (ig != null) {
							argb2 = ig.intValue();
							if ((argb2 | ARGB_NOT_SET) != ARGB_NOT_SET) {
								setBackgroundColor();
								argb2 = ARGB_NOT_SET;
							}
						}
					}
				}
				else if (qName.endsWith("image")) {
					loadBackgroundImage(str);
				}
			}

			else if (qName.startsWith("gradient")) {
				if (qName.endsWith("_color1")) {
					if ((argb2 | ARGB_NOT_SET) != ARGB_NOT_SET) {
						color1 = new Color(argb2);
						argb2 = ARGB_NOT_SET;
					}
					else {
						Integer ig = Parser.parseInt(str, 16);
						if (ig != null) {
							argb2 = ig.intValue();
							if ((argb2 | ARGB_NOT_SET) != ARGB_NOT_SET) {
								color1 = new Color(argb2);
								argb2 = ARGB_NOT_SET;
							}
						}
					}
				}
				else if (qName.endsWith("_color2")) {
					if ((argb2 | ARGB_NOT_SET) != ARGB_NOT_SET) {
						color2 = new Color(argb2);
						argb2 = ARGB_NOT_SET;
					}
					else {
						Integer ig = Parser.parseInt(str, 16);
						if (ig != null) {
							argb2 = ig.intValue();
							if ((argb2 | ARGB_NOT_SET) != ARGB_NOT_SET) {
								color2 = new Color(argb2);
								argb2 = ARGB_NOT_SET;
							}
						}
					}
				}
				else if (qName.endsWith("_style")) {
					Integer ig = Parser.parseInt(str);
					if (ig != null)
						gradientStyle = ig.intValue();
				}
				else if (qName.endsWith("_variant")) {
					Integer ig = Parser.parseInt(str);
					if (ig != null)
						gradientVariant = ig.intValue();
				}
			}

			else if (qName.startsWith("pattern")) {
				if (qName.endsWith("_fg")) {
					Integer ig = Parser.parseInt(str, 16);
					if (ig != null)
						color1 = new Color(ig.intValue());
				}
				else if (qName.endsWith("_bg")) {
					Integer ig = Parser.parseInt(str, 16);
					if (ig != null)
						color2 = new Color(ig.intValue());
				}
				else if (qName.endsWith("_style")) {
					Byte ib = Parser.parseByte(str);
					if (ib != null)
						patternStyle = ib.byteValue();
				}
				else if (qName.endsWith("_width")) {
					Integer ig = Parser.parseInt(str);
					if (ig != null)
						patternWidth = ig.intValue();
				}
				else if (qName.endsWith("_height")) {
					Integer ig = Parser.parseInt(str);
					if (ig != null)
						patternHeight = ig.intValue();
				}
			}

			else if (qName == "href") {
				str = XMLCharacterDecoder.decode(str);
				currentStyle.addAttribute(HTML.Attribute.HREF, str);
				StyleConstants.setUnderline(currentStyle, Page.isLinkUnderlined());
				if (FileUtilities.isRelative(str))
					str = page.resolvePath(str);
				if (!FileUtilities.isRemote(str))
					str = FileUtilities.useSystemFileSeparator(str);
				StyleConstants.setForeground(currentStyle,
						HistoryManager.sharedInstance().wasVisited(str) ? Page.getVisitedColor() : Page.getLinkColor());
			}

			else if (qName == "target") {
				currentStyle.addAttribute(HTML.Attribute.TARGET, str);
			}

			else if (qName == HyperlinkParameter.ATTRIBUTE_RESIZABLE) {
				currentStyle.addAttribute(HyperlinkParameter.ATTRIBUTE_RESIZABLE, Boolean.valueOf(str));
			}

			else if (qName == HyperlinkParameter.ATTRIBUTE_FULLSCREEN) {
				currentStyle.addAttribute(HyperlinkParameter.ATTRIBUTE_FULLSCREEN, Boolean.valueOf(str));
			}

			else if (qName == HyperlinkParameter.ATTRIBUTE_TOOLBAR) {
				currentStyle.addAttribute(HyperlinkParameter.ATTRIBUTE_TOOLBAR, Boolean.valueOf(str));
			}

			else if (qName == HyperlinkParameter.ATTRIBUTE_MENUBAR) {
				currentStyle.addAttribute(HyperlinkParameter.ATTRIBUTE_MENUBAR, Boolean.valueOf(str));
			}

			else if (qName == HyperlinkParameter.ATTRIBUTE_STATUSBAR) {
				currentStyle.addAttribute(HyperlinkParameter.ATTRIBUTE_STATUSBAR, Boolean.valueOf(str));
			}

			else if (qName == HyperlinkParameter.ATTRIBUTE_LEFT) {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					currentStyle.addAttribute(HyperlinkParameter.ATTRIBUTE_LEFT, ig);
			}

			else if (qName == HyperlinkParameter.ATTRIBUTE_TOP) {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					currentStyle.addAttribute(HyperlinkParameter.ATTRIBUTE_TOP, ig);
			}

			else if (qName == HyperlinkParameter.ATTRIBUTE_WIDTH) {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					currentStyle.addAttribute(HyperlinkParameter.ATTRIBUTE_WIDTH, ig);
			}

			else if (qName == HyperlinkParameter.ATTRIBUTE_HEIGHT) {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					currentStyle.addAttribute(HyperlinkParameter.ATTRIBUTE_HEIGHT, ig);
			}

			else if (qName == "size") {
				// WARNING: the "size" tag is used here to represent font size only!
				Integer ig = Parser.parseInt(str);
				if (ig != null) {
					int fontSize = ig.intValue() + page.getFontIncrement();
					StyleConstants.setFontSize(currentStyle, fontSize < 8 ? 8 : fontSize);
					sizeSet = true;
				}
			}

			else if (qName == "bold") {
				StyleConstants.setBold(currentStyle, (Boolean.valueOf(str)).booleanValue());
			}

			else if (qName == "italic") {
				StyleConstants.setItalic(currentStyle, (Boolean.valueOf(str)).booleanValue());
			}

			else if (qName == "underline") {
				StyleConstants.setUnderline(currentStyle, (Boolean.valueOf(str)).booleanValue());
			}

			else if (qName == "strikethrough") {
				StyleConstants.setStrikeThrough(currentStyle, (Boolean.valueOf(str)).booleanValue());
			}

			else if (qName == "subscript") {
				StyleConstants.setSubscript(currentStyle, (Boolean.valueOf(str)).booleanValue());
			}

			else if (qName == "superscript") {
				StyleConstants.setSuperscript(currentStyle, (Boolean.valueOf(str)).booleanValue());
			}

			else if (qName == "family") {
				StyleConstants.setFontFamily(currentStyle, str);
			}

			else if (qName == "foreground") {
				StringTokenizer st = new StringTokenizer(str);
				int[] rgb = new int[3];
				int i = 0;
				while (st.hasMoreTokens()) {
					Integer ig = Parser.parseInt(st.nextToken());
					if (ig != null) {
						rgb[i] = ig.intValue();
						i++;
					}
				}
				if (i == 3)
					StyleConstants.setForeground(currentStyle, new Color(rgb[0], rgb[1], rgb[2]));
			}

			else if (qName == "cornerarc") {
				Integer in = Parser.parseInt(str);
				if (in != null)
					cornerArc = in.intValue();
			}

			else if (qName == "arcwidth") {
				Integer in = Parser.parseInt(str);
				if (in != null)
					arcWidth = in.intValue();
			}

			else if (qName == "archeight") {
				Integer in = Parser.parseInt(str);
				if (in != null)
					arcHeight = in.intValue();
			}

			else if (qName == "topmargin") {
				Integer in = Parser.parseInt(str);
				if (in != null)
					topMargin = in.intValue();
			}

			else if (qName == "bottommargin") {
				Integer in = Parser.parseInt(str);
				if (in != null)
					bottomMargin = in.intValue();
			}

			else if (qName == "leftmargin") {
				Integer in = Parser.parseInt(str);
				if (in != null)
					leftMargin = in.intValue();
			}

			else if (qName == "rightmargin") {
				Integer in = Parser.parseInt(str);
				if (in != null)
					rightMargin = in.intValue();
			}

			else if (qName == "Alignment") {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					alignment = ig.intValue();
			}

			else if (qName == "LeftIndent") {
				Float fl = Parser.parseFloat(str);
				if (fl != null)
					leftIndent = fl.floatValue();
			}

			else if (qName == "RightIndent") {
				Float fl = Parser.parseFloat(str);
				if (fl != null)
					rightIndent = fl.floatValue();
			}

			/*
			 * TODO: not implemented yet. else if(qName==StyleConstants.FirstLineIndent.toString()){ Float
			 * fl=Parser.parseFloat(str); if(fl!=null) firstLineIndent=fl.floatValue(); }
			 * 
			 * else if(qName==StyleConstants.LineSpacing.toString()){ System.out.println(qName); Float
			 * fl=Parser.parseFloat(str); if(fl!=null) lineSpacing=fl.floatValue(); }
			 */

			else if (qName == "SpaceAbove") {
				Float fl = Parser.parseFloat(str);
				if (fl != null)
					spaceAbove = fl.floatValue();
			}

			else if (qName == "SpaceBelow") {
				Float fl = Parser.parseFloat(str);
				if (fl != null)
					spaceBelow = fl.floatValue();
			}

			else if (qName == "icon") {
				if (className != null && className.endsWith("LineIcon")) {
					LineIcon lineIcon = new LineIcon(page);
					if ((argb1 | ARGB_NOT_SET) != ARGB_NOT_SET) {
						lineIcon.setColor(new Color(argb1));
						argb1 = ARGB_NOT_SET;
					}
					if (!opaque) {
						lineIcon.setFilled(false);
						opaque = true;
					}
					if (width > 0) {
						lineIcon.setWidth(width);
						width = 0;
					}
					if (height > 0) {
						lineIcon.setHeight((int) height);
						height = 0;
					}
					if (leftMargin > 0) {
						lineIcon.setLeftMargin(leftMargin);
						leftMargin = 0;
					}
					if (rightMargin > 0) {
						lineIcon.setRightMargin(rightMargin);
						rightMargin = 0;
					}
					if (topMargin != 0) {
						lineIcon.setTopMargin(topMargin);
						topMargin = 0;
					}
					if (bottomMargin != 0) {
						lineIcon.setBottomMargin(bottomMargin);
						bottomMargin = 0;
					}
					if (cornerArc != 0) {
						lineIcon.setCornerArc(cornerArc);
						cornerArc = 0;
					}
					if (arcWidth != 0) {
						lineIcon.setArcWidth(arcWidth);
						arcWidth = 0;
					}
					if (arcHeight != 0) {
						lineIcon.setArcHeight(arcHeight);
						arcHeight = 0;
					}
					setWrappedIcon(currentStyle, lineIcon, titleText);
					if (titleText != null) {
						// lineIcon.setText(XMLCharacterDecoder.decode(titleText));
						titleText = null;
					}
					className = null;
				}
				else {
					if (str.endsWith("$SquareBulletIcon")) {
						StyleConstants.setIcon(currentStyle, BulletIcon.SquareBulletIcon.sharedInstance());
					}
					else if (str.endsWith("$SolidSquareBulletIcon")) {
						StyleConstants.setIcon(currentStyle, BulletIcon.SolidSquareBulletIcon.sharedInstance());
					}
					else if (str.endsWith("$OpenCircleBulletIcon")) {
						StyleConstants.setIcon(currentStyle, BulletIcon.OpenCircleBulletIcon.sharedInstance());
					}
					else if (str.endsWith("$SolidCircleBulletIcon")) {
						StyleConstants.setIcon(currentStyle, BulletIcon.SolidCircleBulletIcon.sharedInstance());
					}
					else if (str.endsWith("$PosTickBulletIcon")) {
						StyleConstants.setIcon(currentStyle, BulletIcon.PosTickBulletIcon.sharedInstance());
					}
					else if (str.endsWith("$NegTickBulletIcon")) {
						StyleConstants.setIcon(currentStyle, BulletIcon.NegTickBulletIcon.sharedInstance());
					}
					else if (str.endsWith("$DiamondBulletIcon")) {
						StyleConstants.setIcon(currentStyle, BulletIcon.DiamondBulletIcon.sharedInstance());
					}
					else if (str.endsWith("$NumberIcon")) {
						StyleConstants.setIcon(currentStyle, BulletIcon.SquareBulletIcon.sharedInstance());
					}
					else {
						loadInsertedImage(currentStyle, str);
					}
				}
			}

			else if (qName == "class") {
				className = str;
			}

			else if (qName == "appletclass") {
				mainClass = str;
			}

			else if (qName == "codebase") {
				codeBase = str;
			}

			else if (qName == "cachefile") {
				cacheFiles = str;
			}

			else if (qName == "appletjar") {
				if (jarNames == null)
					jarNames = new ArrayList<String>();
				jarNames.add(str);
			}

			else if (qName == "caching") {
				caching = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "parameter") {
				parameter = str;
			}

			else if (qName == "groupid") {
				Long id = Parser.parseLong(str);
				if (id != null)
					groupID = id.longValue();
			}

			else if (qName == "resource") {
				String codeBase = FileUtilities.getCodeBase(page.getAddress());
				resourceURL = (codeBase != null ? codeBase : "") + FileUtilities.getFileName(str);
			}

			else if (qName == "script") {
				script = str;
			}

			else if (qName == "script2") {
				script2 = str;
			}

			else if (qName == "expression") {
				expression = str;
			}

			else if (qName == "datapoint") {
				Short sh = Parser.parseShort(str);
				if (sh != null)
					dataPoint = sh.shortValue();
			}

			else if (qName == "weight") {
				Float fl = Parser.parseFloat(str);
				if (fl != null)
					weight = fl.floatValue();
			}

			else if (qName == "style") {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					style = ig.intValue();
			}

			else if (qName == "function") {
				if (dataSourceList == null)
					dataSourceList = new ArrayList<DataSource>();
				dataSourceList.add(createDataSource());
			}

			else if (qName == "scheme") {
				scheme = str;
			}

			else if (qName == "rotation") {
				rotation = str;
			}

			else if (qName == "navigation") {
				navigationMode = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "dots") {
				dots = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "atomcolor") {
				Byte b = Parser.parseByte(str);
				if (b != null)
					atomColoring = b.byteValue();
			}

			else if (qName == "spin") {
				spin = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "axes") {
				axes = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "boundbox") {
				boundbox = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "menubar") {
				showMenuBar = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "toolbar") {
				showToolBar = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "statusbar") {
				showStatusBar = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "energizer") {
				energizer = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "layout") {
				layout = str;
			}

			else if (qName == "width") {
				Double db = Parser.parseDouble(str);
				if (db != null)
					width = (float) db.doubleValue();
			}

			else if (qName == "height") {
				Double db = Parser.parseDouble(str);
				if (db != null)
					height = (float) db.doubleValue();
			}

			else if (qName == "type") {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					type = ig.intValue();
			}

			else if (qName == "column") {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					ncol = ig.intValue();
			}

			else if (qName == "row") {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					nrow = ig.intValue();
			}

			else if (qName == "columnmargin") {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					colMargin = ig.intValue();
			}

			else if (qName == "rowmargin") {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					rowMargin = ig.intValue();
			}

			else if (qName == "border") {
				borderType = str;
			}

			else if (qName == "single") {
				singleSelection = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "answer") {
				answer = str;
			}

			else if (qName == "submit") {
				submit = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "clear") {
				clear = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "hasmenu") {
				hasMenu = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "opaque") {
				opaque = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "transparent") {
				transparent = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "continuous_fire") {
				continuousFire = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "disabled_at_run") {
				disabledAtRun = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "disabled_at_script") {
				disabledAtScript = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "level_of_details") {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					levelOfDetails = ig.intValue();
			}

			else if (qName == "loadscan") {
				loadScan = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "scriptscan") {
				scriptScan = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "lockenergylevel") {
				lockEnergyLevel = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "scale") {
				Float fg = Parser.parseFloat(str);
				if (fg != null)
					scale = fg.floatValue();
			}

			else if (qName == "tick") {
				drawTicks = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "label") {
				drawLabels = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "labeltable") {
				labeltable = str;
			}

			else if (qName == "selected") {
				selected = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "selectedIndex") {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					selectedIndex = ig.intValue();
			}

			else if (qName == "minimum") {
				Double d = Parser.parseDouble(str);
				if (d != null)
					minimum = d.doubleValue();
			}

			else if (qName == "maximum") {
				Double d = Parser.parseDouble(str);
				if (d != null)
					maximum = d.doubleValue();
			}

			else if (qName == "nstep") {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					nstep = ig.intValue();
			}

			else if (qName == "major_tick") {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					majorTicks = ig;
			}

			else if (qName == "value") {
				Double d = Parser.parseDouble(str);
				if (d != null)
					value = d;
			}

			else if (qName == "step") {
				Double d = Parser.parseDouble(str);
				if (d != null)
					stepsize = d;
			}

			else if (qName == "uid") {
				uid = str;
			}

			else if (qName == "title") {
				titleText = str;
			}

			else if (qName == "imagefile") {
				imageFileName = str;
			}

			else if (qName == "imagefiledeselected") {
				imageFileDeselected = str;
			}

			else if (qName == "tooltip") {
				toolTip = str;
			}

			else if (qName == "timeseries") {
				timeSeries = str;
			}

			else if (qName == "action") {
				actionName = str;
			}

			else if (qName == "change") {
				changeName = str;
			}

			else if (qName == "orientation") {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					orientation = ig;
			}

			else if (qName == "description") {
				description = str;
			}

			else if (qName == "cellalign") {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					cellAlignment = ig;
			}

			else if (qName == "rowname") {
				rowName = str;
			}

			else if (qName == "columnname") {
				columnName = str;
			}

			else if (qName == "hint_text") {
				hintText = str;
			}

			else if (qName == "gradeuri") {
				gradeURI = str;
			}

			else if (qName == "format") {
				format = str;
			}

			else if (qName == "multiplier") {
				Float fl = Parser.parseFloat(str);
				if (fl != null)
					multiplier = fl;
			}

			else if (qName == "addend") {
				Float fl = Parser.parseFloat(str);
				if (fl != null)
					addend = fl;
			}

			else if (qName == "datatype") {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					dataType = ig;
			}

			else if (qName == "average") {
				average = Boolean.valueOf(str);
			}

			else if (qName == "samplingpoints") {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					samplingPoints = ig;
			}

			else if (qName == "smoothingfactor") {
				Float fl = Parser.parseFloat(str);
				if (fl != null)
					smoothingFactor = fl;
			}

			else if (qName == "max_fraction_digits") {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					maxFractionDigit = ig;
			}

			else if (qName == "max_integer_digits") {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					maxIntegerDigit = ig;
			}

			else if (qName == "fontname") {
				fontName = str;
			}

			else if (qName == "fontsize") {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					fontSize = ig;
			}

			else if (qName == "choice") {
				choices[iChoice] = str;
				iChoice++;
			}

			else if (qName == "modelclass") {
				modelClass = str;
			}

			else if (qName == "model") {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					modelIndex = ig.intValue();
			}

			else if (qName == "recorder") {
				// NOTE: this tag acts against its name. Hence it is changed to recorderless below.
				recorderDisabled = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "recorderless") {
				recorderless = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "dna") {
				dnaString = str;
			}

			else if (qName == "dna_context") {
				dnaContext = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "dna_dt1") {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					dna_dt1 = ig.intValue();
			}

			else if (qName == "dna_dt2") {
				Integer ig = Parser.parseInt(str);
				if (ig != null)
					dna_dt2 = ig.intValue();
			}

			else if (qName == "te") {
				tableValue[tableCellIndex / ncol][tableCellIndex % ncol] = str;
				tableCellIndex++;
			}

			else if (qName == "hline") {
				showHLines = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "vline") {
				showVLines = Boolean.valueOf(str).booleanValue();
			}

			else if (qName.startsWith("legend")) {
				if (qName.endsWith("_x")) {
					Integer ig = Parser.parseInt(str);
					if (ig != null)
						legendX = ig.intValue();
				}
				else if (qName.endsWith("_y")) {
					Integer ig = Parser.parseInt(str);
					if (ig != null)
						legendY = ig.intValue();
				}
			}

			else if (qName == "autofit") {
				autoFit = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "autofitx") {
				autoFitX = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "autofity") {
				autoFitY = Boolean.valueOf(str).booleanValue();
			}

			else if (qName == "autoupdate") {
				autoUpdate = Boolean.valueOf(str).booleanValue();
			}

			else if (qName.startsWith("axis")) {
				if (qName.endsWith("x_title")) {
					xAxisTitle = str;
				}
				else if (qName.endsWith("y_title")) {
					yAxisTitle = str;
				}
				else if (qName.endsWith("x_min")) {
					Double db = Parser.parseDouble(str);
					if (db != null)
						dataWindow_xmin = db.doubleValue();
				}
				else if (qName.endsWith("x_max")) {
					Double db = Parser.parseDouble(str);
					if (db != null)
						dataWindow_xmax = db.doubleValue();
				}
				else if (qName.endsWith("y_min")) {
					Double db = Parser.parseDouble(str);
					if (db != null)
						dataWindow_ymin = db.doubleValue();
				}
				else if (qName.endsWith("y_max")) {
					Double db = Parser.parseDouble(str);
					if (db != null)
						dataWindow_ymax = db.doubleValue();
				}
			}

			else if (qName.startsWith("time_series")) {
				if (qName.endsWith("_x")) {
					timeSeries_x = str;
				}
				else if (qName.indexOf("_y") != -1) {
					Integer ig = Parser.parseInt(qName.substring(qName.lastIndexOf("y") + 1));
					if (ig != null) {
						int its = ig.intValue();
						if (timeSeries_y == null)
							timeSeries_y = new String[PageXYGraph.MAX];
						timeSeries_y[its - 1] = str;
					}
				}
			}

			else if (qName == "button") {
				if (buttonGroup == null)
					buttonGroup = new ArrayList<String>();
				buttonGroup.add(str);
			}

			else if (qName == "group") {
				group = str;
			}

			else if (qName == "component") {
				if (className != null) {
					createComponent(currentStyle, className);
					className = null;
				}
			}

			else if (qName == "content") {
				if (sizeSet) {
					sizeSet = false;
				}
				else {
					int fontSize = 12 + page.getFontIncrement();
					StyleConstants.setFontSize(currentStyle, fontSize < 8 ? 8 : fontSize);
				}
				String subString = null;
				try {
					subString = textBuffer.substring(startOffset, endOffset);
				}
				catch (StringIndexOutOfBoundsException e) {
					e.printStackTrace();
					subString = null;
				}
				if (subString != null) {
					try {
						doc.insertString(startOffset, subString, currentStyle);
					}
					catch (BadLocationException e) {
						e.printStackTrace();
					}
				}
			}

			else if (qName == "paragraph") {
				Element pe = doc.getParagraphElement((startOffset + endOffset) / 2);
				AttributeSet as = pe.getAttributes();
				SimpleAttributeSet sas = new SimpleAttributeSet(as);
				sas.addAttribute(StyleConstants.Alignment, new Integer(alignment));
				sas.addAttribute(StyleConstants.FirstLineIndent, new Float(firstLineIndent));
				sas.addAttribute(StyleConstants.LineSpacing, new Float(lineSpacing));
				float indent;
				if (leftIndent >= 1) {
					indent = leftIndent;
				}
				else {
					indent = leftIndent * page.getWidth();
				}
				sas.addAttribute(StyleConstants.LeftIndent, new Float(indent));
				if (rightIndent >= 1) {
					indent = rightIndent;
				}
				else {
					indent = rightIndent * page.getWidth();
				}
				sas.addAttribute(StyleConstants.RightIndent, new Float(indent));
				sas.addAttribute(StyleConstants.SpaceAbove, new Float(spaceAbove));
				sas.addAttribute(StyleConstants.SpaceBelow, new Float(spaceBelow));
				doc.setParagraphAttributes(startOffset, endOffset - startOffset, sas, false);
				alignment = StyleConstants.ALIGN_LEFT;
				firstLineIndent = 0.0f;
				lineSpacing = 0.0f;
				leftIndent = 0.0f;
				rightIndent = 0.0f;
				spaceAbove = 0.0f;
				spaceBelow = 0.0f;
			}

		}