Package com.nwalsh.saxon
Class UnwrapLinksEmitter
- java.lang.Object
-
- com.icl.saxon.output.Emitter
-
- com.nwalsh.saxon.CopyEmitter
-
- com.nwalsh.saxon.UnwrapLinksEmitter
-
- All Implemented Interfaces:
javax.xml.transform.Result
public class UnwrapLinksEmitter extends CopyEmitter
Saxon extension to unwrap links in a result tree fragment.
$Id: UnwrapLinksEmitter.java 1731 2002-06-26 11:03:05Z nwalsh $
Copyright (C) 2000, 2002 Norman Walsh.
This class provides the guts of a Saxon 6.* implementation of a link unwrapper.
The general design is this: the stylesheets construct a result tree fragment for some environment. Then the result tree fragment is "replayed" through the UnwrapLinksEmitter; the UnwrapLinksEmitter builds a new result tree fragment from this event stream with top-level links unwrapped. That RTF is returned. Note that only a single level of unwrapping is performed. This is clearly a crude implementation.
Change Log:
- 1.0
Initial release.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.StackelementStackA stack for the preserving information about open elements.protected booleanfoStylesheetIs the stylesheet currently running an FO stylesheet?protected static java.lang.StringfoURIThe FO namespace name.protected inthtmlAFingerprintprotected booleaninSkipprotected intlinkDepthAre we currently in a link? How deep?protected java.util.StacksaveStackprotected intskipDepthprotected booleantryAgainprotected intxhtmlAFingerprintprotected static java.lang.StringxhURIThe XHTML namespace name.-
Fields inherited from class com.nwalsh.saxon.CopyEmitter
namePool, rtf, rtfEmitter
-
-
Constructor Summary
Constructors Constructor Description UnwrapLinksEmitter(com.icl.saxon.Controller controller, com.icl.saxon.om.NamePool namePool, boolean foStylesheet)Constructor for the UnwrapLinksEmitter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidendElement(int nameCode)Process end element events.voidstartElement(int nameCode, org.xml.sax.Attributes attributes, int[] namespaces, int nscount)Process start element events.booleantryAgain()-
Methods inherited from class com.nwalsh.saxon.CopyEmitter
characters, comment, endDocument, getResultTreeFragment, processingInstruction, setDocumentLocator, setEscaping, setNamePool, setUnparsedEntity, setWriter, startDocument
-
-
-
-
Field Detail
-
elementStack
protected java.util.Stack elementStack
A stack for the preserving information about open elements.
-
saveStack
protected java.util.Stack saveStack
-
foURI
protected static java.lang.String foURI
The FO namespace name.
-
xhURI
protected static java.lang.String xhURI
The XHTML namespace name.
-
foStylesheet
protected boolean foStylesheet
Is the stylesheet currently running an FO stylesheet?
-
linkDepth
protected int linkDepth
Are we currently in a link? How deep?
-
skipDepth
protected int skipDepth
-
htmlAFingerprint
protected int htmlAFingerprint
-
xhtmlAFingerprint
protected int xhtmlAFingerprint
-
inSkip
protected boolean inSkip
-
tryAgain
protected boolean tryAgain
-
-
Constructor Detail
-
UnwrapLinksEmitter
public UnwrapLinksEmitter(com.icl.saxon.Controller controller, com.icl.saxon.om.NamePool namePool, boolean foStylesheet)Constructor for the UnwrapLinksEmitter.
- Parameters:
namePool- The name pool to use for constructing elements and attributes.foStylesheet- Is this an FO stylesheet?
-
-
Method Detail
-
startElement
public void startElement(int nameCode, org.xml.sax.Attributes attributes, int[] namespaces, int nscount) throws javax.xml.transform.TransformerExceptionProcess start element events.- Overrides:
startElementin classCopyEmitter- Throws:
javax.xml.transform.TransformerException
-
endElement
public void endElement(int nameCode) throws javax.xml.transform.TransformerExceptionProcess end element events.- Overrides:
endElementin classCopyEmitter- Throws:
javax.xml.transform.TransformerException
-
tryAgain
public boolean tryAgain() throws javax.xml.transform.TransformerException- Throws:
javax.xml.transform.TransformerException
-
-