Class XMLInputHandler
java.lang.Object
org.apache.batik.apps.svgbrowser.XMLInputHandler
- All Implemented Interfaces:
SquiggleInputHandler
A
SquiggleInputHandler that handles XSLT transformable
XML documents.
This implementation of the SquiggleInputHandler class
handles XML files by looking for the first
<?xml-stylesheet ... ?> processing instruction referencing
an xsl document. In case there is one, the transform is applied to the
input XML file and the handler checks that the result is an
SVG document with an SVG root.- Version:
- $Id$
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classImplements the URIResolver interface so that relative urls used in transformations are resolved properly. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if the input file can be handled by the handlerbooleanReturn true if the resource with the given path can be handled.booleanReturns true if the input URI can be handled by the handlerprotected voidcheckAndPatch(Document doc) This method checks that the generated content is SVG.protected StringExtracts the first XSL processing instruction from the input XML document.Returns a description for this handlerString[]Returns the list of file extensions handled by this handlerString[]Returns the list of mime types handled by this handler.voidhandle(ParsedURL purl, JSVGViewerFrame svgViewerFrame) Handles the given input for the given JSVGViewerFrame
-
Field Details
-
XVG_MIME_TYPES
-
XVG_FILE_EXTENSIONS
-
ERROR_NO_XML_STYLESHEET_PROCESSING_INSTRUCTION
- See Also:
-
ERROR_TRANSFORM_OUTPUT_NOT_SVG
- See Also:
-
ERROR_TRANSFORM_PRODUCED_NO_CONTENT
- See Also:
-
ERROR_TRANSFORM_OUTPUT_WRONG_NS
- See Also:
-
ERROR_RESULT_GENERATED_EXCEPTION
- See Also:
-
XSL_PROCESSING_INSTRUCTION_TYPE
- See Also:
-
PSEUDO_ATTRIBUTE_TYPE
- See Also:
-
PSEUDO_ATTRIBUTE_HREF
- See Also:
-
-
Constructor Details
-
XMLInputHandler
public XMLInputHandler()
-
-
Method Details
-
getHandledMimeTypes
Returns the list of mime types handled by this handler.- Specified by:
getHandledMimeTypesin interfaceSquiggleInputHandler
-
getHandledExtensions
Returns the list of file extensions handled by this handler- Specified by:
getHandledExtensionsin interfaceSquiggleInputHandler
-
getDescription
Returns a description for this handler- Specified by:
getDescriptionin interfaceSquiggleInputHandler
-
accept
Returns true if the input file can be handled by the handler- Specified by:
acceptin interfaceSquiggleInputHandler
-
accept
Returns true if the input URI can be handled by the handler- Specified by:
acceptin interfaceSquiggleInputHandler- Parameters:
purl- URL describing the candidate input
-
accept
Return true if the resource with the given path can be handled. -
handle
Handles the given input for the given JSVGViewerFrame- Specified by:
handlein interfaceSquiggleInputHandler- Throws:
Exception
-
checkAndPatch
This method checks that the generated content is SVG. This method accounts for the fact that the root svg's first child is the result of the transform. It moves all its children under the root and sets the attributes -
extractXSLProcessingInstruction
-