Package eu.bandm.tools.d2d2.base
Class TextFileHeader
java.lang.Object
eu.bandm.tools.d2d2.base.TextFileHeader
Parser for the header of a d2d text input file.
Sets modname==null and toplevelelementname==null => xsltMode=true
Generates warnings/errors.
-
Constructor Summary
ConstructorDescriptionTextFileHeader
(MessageReceiver<SimpleMessage<String>> msg, boolean sloppyHeaderSyntax, int traceLevel) Only constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
Send error message.protected void
boolean
Whether a tdom has been sepecified as source.The recognized top-most module name.The recognized top-most element name.All explicitly specified namespaces on the xslt input side.boolean
Whether xslt mode has been specified.protected void
Evident.protected void
Evident.protected boolean
parse
(MemScanner<String> scanner, String toplevel_fileLocation, ModuleRegistry moduleRegistry) Parse the head of an input file.protected void
Evident.protected void
warnOrError_incompleteHeader
(Location<String> loc, String missing) Emits an error or a warning, depending onsloppyHeaderSyntax
.
-
Constructor Details
-
TextFileHeader
TextFileHeader(MessageReceiver<SimpleMessage<String>> msg, boolean sloppyHeaderSyntax, int traceLevel) Only constructor.
-
-
Method Details
-
getModuleName
The recognized top-most module name. Null only for xslt code for unstructured target. -
getToplevelElementName
The recognized top-most element name. Null only for xslt code for unstructured target. -
getXsltMode
public boolean getXsltMode()Whether xslt mode has been specified. -
getFromTdom
public boolean getFromTdom()Whether a tdom has been sepecified as source. -
getXsltInputNamespaces
All explicitly specified namespaces on the xslt input side. -
logStart
Evident. -
logEnd
Evident. -
warning
Evident. -
error
Send error message. Makes result ofparse(eu.bandm.tools.d2d2.base.MemScanner<java.lang.String>, java.lang.String, eu.bandm.tools.d2d2.base.ModuleRegistry)
to be false. -
errorX
-
warnOrError_incompleteHeader
Emits an error or a warning, depending onsloppyHeaderSyntax
. If error, an IllegalArgumentException it thrown. -
parse
protected boolean parse(MemScanner<String> scanner, String toplevel_fileLocation, ModuleRegistry moduleRegistry) Parse the head of an input file. Accepts a (possibly empty) sequence of local module delcarations followed by the doc type declaration. Example:foo bar #d2d 2.0 text using mod.submod : element <-- parsing stops here, rest returned to the main parser in "Text2Udom"a
Or if there are local modules:foo bar #d2d module localmodule ...... end // module #d2d 2.0 text using localmodule.submod : element <--- parsing stops here, rest returned to the main parser in "Text2Udom"a
or, in case of an xslt source text:foo bar #d2d 2.0 xslt text producing xhtml_1_0 : html <-- parsing stops here, rest returned to the main parser in "Text2Udom"a
- Returns:
- false in case of errors. All parsing results are stored internally and accessible by getter methods.
-