Package eu.bandm.tools.xslt.base
Class Templates
java.lang.Object
eu.bandm.tools.xslt.base.MessageSender
eu.bandm.tools.xslt.base.Templates
- All Implemented Interfaces:
ContentHandler
Represents one single xslt source file, w/o further context info.
Internally PURE subtrees are realized by xslt and target tdom trees;
BI-COLOURED tree nodes are realized by
The SAX receiver switches between xslt mode and target mode and delegates parsing to the TDOM sax receiver method. Whenever a tdom element is completed successfully, a "parseListener" can take this element and insert it into a MultiTypeNodeList. If the parsing process fails under the way, because of an xslt element embedded in a target structure (which can happen ubiquituously), then tdom parsing is cancelled. For this case a MultiTypeNodeList is constructed as a "plan b" in parallel to the SAX event forwarding, and completed instead. A missing attribute or an attribute with "value template" also leads to an incomplete target element, ie a MultiTypeNodeList.
No context check is done, this is done by the user, which is a
MultiTypeNodeList objects.
Each instance of this class is
a SAX receiver, ie. provides the parsing method for these bi-coloured trees.
The SAX receiver switches between xslt mode and target mode and delegates parsing to the TDOM sax receiver method. Whenever a tdom element is completed successfully, a "parseListener" can take this element and insert it into a MultiTypeNodeList. If the parsing process fails under the way, because of an xslt element embedded in a target structure (which can happen ubiquituously), then tdom parsing is cancelled. For this case a MultiTypeNodeList is constructed as a "plan b" in parallel to the SAX event forwarding, and completed instead. A missing attribute or an attribute with "value template" also leads to an incomplete target element, ie a MultiTypeNodeList.
No context check is done, this is done by the user, which is a
Transformation.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Attributesfinal Map<TypedSubstantial, Binding<String, String>> Map from every xslt code node or target language element (completeElementor incompleteMultiTypeNodeList) to the valid namspace prefix mapping.final Map<eu.bandm.tools.xslt.tdom.Element, MultiTypeNodeList> Links from xslt elements at LEAF position to their raw/MultiType contents.static final TPathCacheCache for all parsed tpath expressions.static final DTD.Dtdstatic final DTM.Dtd -
Constructor Summary
ConstructorsConstructorDescriptionTemplates(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, Trace trace, URI ownUri, ResultContext resultContext) -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] ch, int start, int length) voidvoidvoidendElement(String namespaceURI, String localName, String qName) voidendPrefixMapping(String pref) voidignorableWhitespace(char[] ch, int start, int length) voidprocessingInstruction(String name, String v) voidsetDocumentLocator(Locator locator) voidskippedEntity(String name) voidvoidstartElement(String namespaceURI, String localName, String qName, Attributes atts) voidstartPrefixMapping(String pref, String uri) Methods inherited from class eu.bandm.tools.xslt.base.MessageSender
getLocation, setMsg, setTraceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.xml.sax.ContentHandler
declaration
-
Field Details
-
xsltDtd
-
xsltDtm
-
EMPTY_ATTRIBUTES
-
tpathCache
Cache for all parsed tpath expressions. Syntax only, therefore shared by all xslt code. FIXME how serialized !?!?! -
result_subtrees
Links from xslt elements at LEAF position to their raw/MultiType contents. These also contain the parsed tpath expressions of those attribute values (of the later result element) which are AVTs. -
ns_contexts
Map from every xslt code node or target language element (completeElementor incompleteMultiTypeNodeList) to the valid namspace prefix mapping. It simply "freezes" a point in the dynamic state ofns_prefixMap.
This is necessary because namespace prefices must be resolved not only in sax events (which are already resolved consistently, when arriving here!-) BUT ALSO LATER when evaluating xpath expressions and some object names stored in attributes (parameters, variables, attribute sets).
Is easy to produce because it is TOTALLY STATIC info.
-
-
Constructor Details
-
Templates
public Templates(MessageReceiver<SimpleMessage<XMLDocumentIdentifier>> msg, Trace trace, URI ownUri, ResultContext resultContext) - Parameters:
trace- set of flags for trace on/offownUri- position of the file to parseresultContext- wraps all info from result tdom and dtd
-
-
Method Details
-
dump
-
startPrefixMapping
- Specified by:
startPrefixMappingin interfaceContentHandler
-
endPrefixMapping
- Specified by:
endPrefixMappingin interfaceContentHandler
-
startElement
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException - Specified by:
startElementin interfaceContentHandler- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceContentHandler- Throws:
SAXException
-
skippedEntity
- Specified by:
skippedEntityin interfaceContentHandler- Throws:
SAXException
-
processingInstruction
- Specified by:
processingInstructionin interfaceContentHandler
-
startDocument
public void startDocument()- Specified by:
startDocumentin interfaceContentHandler
-
endDocument
public void endDocument()- Specified by:
endDocumentin interfaceContentHandler
-
ignorableWhitespace
- Specified by:
ignorableWhitespacein interfaceContentHandler- Throws:
SAXException
-
characters
- Specified by:
charactersin interfaceContentHandler- Throws:
SAXException
-
setDocumentLocator
- Specified by:
setDocumentLocatorin interfaceContentHandler
-