Package uk.ac.starlink.ttools.votlint
Class DoctypeInterpolator
java.lang.Object
uk.ac.starlink.ttools.votlint.DoctypeInterpolator
Attempts to check that a DOCTYPE declaration is present in an
input stream representing XML. If it is not, one is inserted.
The algorithm used here isn't bulletproof, but should work in most
sensible cases, and fail noisily if it can't do it.
It copes with a number of not-too-weird XML encodings.
- Author:
- Mark Taylor (Starlink)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns an input stream which is a copy of a given one, except that if the given one doesn't include a DOCTYPE declaration, one is inserted.Returns the value of the version attribute of the top-level VOTABLE element, if there was one and it was encountered.static void
Filter program which takes a stream on standard output and writes to standard output including the DOCTYPE.void
Presents a processing message.
-
Constructor Details
-
DoctypeInterpolator
public DoctypeInterpolator()
-
-
Method Details
-
getStreamWithDoctype
Returns an input stream which is a copy of a given one, except that if the given one doesn't include a DOCTYPE declaration, one is inserted. This method can only be called once for each instance of this class.- Parameters:
in
- original input stream- Returns:
- input stream like in but with a DOCTYPE
- Throws:
IllegalStateException
- if this method has already been called on this objectIOException
-
getVotableVersion
Returns the value of the version attribute of the top-level VOTABLE element, if there was one and it was encountered.- Returns:
- declared VOTable version string, or null
-
message
Presents a processing message.- Parameters:
msg
- message text
-
main
Filter program which takes a stream on standard output and writes to standard output including the DOCTYPE.- Throws:
IOException
-