home *** CD-ROM | disk | FTP | other *** search
- package com.ms.xml.parser;
-
- import com.ms.xml.om.Element;
- import com.ms.xml.om.ElementImpl;
- import com.ms.xml.util.Atom;
- import com.ms.xml.util.Name;
- import com.ms.xml.util.XMLOutputStream;
- import java.io.IOException;
-
- public class Notation extends ElementImpl {
- Name name;
- String url;
- String pubid;
- int type;
- Element schema = null;
- static Name nameNAME = Name.create("NAME");
- static Name nameSYSTEMID = Name.create("SYSTEMID");
- static Name namePUBLICID = Name.create("PUBLICID");
- static Name nameNOTATION = Name.create("NOTATION");
-
- Notation(Name var1) {
- super(var1, 8);
- this.name = var1;
- }
-
- public Element toSchema() {
- if (this.schema == null) {
- ElementImpl var1 = new ElementImpl(nameNOTATION, 0);
- var1.setAttribute(nameNAME, this.name.toString());
- if (this.url != null) {
- var1.setAttribute(nameSYSTEMID, this.url);
- }
-
- if (this.pubid != null) {
- var1.setAttribute(namePUBLICID, this.pubid);
- }
-
- this.schema = var1;
- }
-
- return this.schema;
- }
-
- public void save(XMLOutputStream var1) throws IOException {
- var1.writeIndent();
- var1.writeChars("<!NOTATION ");
- var1.writeQualifiedName(this.name, (Atom)null);
- var1.writeChars(" ");
- if (this.type == -100) {
- var1.writeChars("PUBLIC ");
- var1.writeQuotedString(this.pubid);
- var1.write(32);
- var1.writeQuotedString(this.url);
- } else {
- var1.writeChars("SYSTEM ");
- var1.writeQuotedString(this.url);
- }
-
- var1.write(62);
- var1.writeNewLine();
- }
-
- void setURL(String var1) {
- this.url = var1;
- }
- }
-