Class pmr.sgml.SGMLStream
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class pmr.sgml.SGMLStream

java.lang.Object
   |
   +----pmr.sgml.SGMLStream

public class SGMLStream
extends Object
reads SGML stream and bundles it into a Vector of tags and content

Warning - the bit below may not be implemented; I am moving towards supporting XML (the W3 approach);

Author:
(C) P. Murray-Rust, 1996

Constructor Index

 o SGMLStream()
 o SGMLStream(String)
make SGMLStream from a file(name)
 o SGMLStream(String, String)
used when the input is a fragment without a DOCTYPE statement
 o SGMLStream(StringList)
the best way to create it from an unknown input type (e.g.
 o SGMLStream(StringList, String)
the preferred constructor

Method Index

 o getDTDName()
 o getStreamVector()
this is where the parsed stream is obtained.
 o substituteEntities(String)
resolve entities in a string.
 o toString()
 o unSubstituteEntities(String)
unresolve entities in a string.

Constructors

 o SGMLStream
  public SGMLStream()
 o SGMLStream
  public SGMLStream(String filename) throws BadSGMLFileException
make SGMLStream from a file(name)
Throws: BadSGMLFileException
file is not an SGML file (or doesn't exist)
 o SGMLStream
  public SGMLStream(String filename,
                    String dtdName) throws BadSGMLFileException
used when the input is a fragment without a DOCTYPE statement
Throws: BadSGMLFileException
file is not an SGML file (or doesn't exist)
 o SGMLStream
  public SGMLStream(StringList lines) throws BadSGMLFileException
the best way to create it from an unknown input type (e.g. file or URL
Throws: BadSGMLFileException
input did not exist or was not SGML
 o SGMLStream
  public SGMLStream(StringList lines,
                    String dtdName) throws BadSGMLFileException
the preferred constructor
Throws: BadSGMLFileException
input did not exist or was not SGML

Methods

 o getStreamVector
  public Vector getStreamVector()
this is where the parsed stream is obtained. The contents consist of nested
_STARTTAG gi attributeList
_PEL stringContent
_ENDTAG gi
where _PEL indicates #PCDATA
 o substituteEntities
  public static String substituteEntities(String s)
resolve entities in a string. take these from EntitySet which includes < and > since they affect the SGML parsing
 o unSubstituteEntities
  public static String unSubstituteEntities(String s)
unresolve entities in a string. At present the only entities are > and < since they affect the SGML parsing
 o getDTDName
  public String getDTDName()
 o toString
  public String toString()
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index