Package org.apache.batik.apps.svgbrowser
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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Implements the URIResolver interface so that relative urls used in transformations are resolved properly. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if the input file can be handled by the handlerboolean
Return true if the resource with the given path can be handled.boolean
Returns true if the input URI can be handled by the handlerprotected void
checkAndPatch
(Document doc) This method checks that the generated content is SVG.protected String
Extracts 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.void
handle
(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:
getHandledMimeTypes
in interfaceSquiggleInputHandler
-
getHandledExtensions
Returns the list of file extensions handled by this handler- Specified by:
getHandledExtensions
in interfaceSquiggleInputHandler
-
getDescription
Returns a description for this handler- Specified by:
getDescription
in interfaceSquiggleInputHandler
-
accept
Returns true if the input file can be handled by the handler- Specified by:
accept
in interfaceSquiggleInputHandler
-
accept
Returns true if the input URI can be handled by the handler- Specified by:
accept
in 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:
handle
in 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
Extracts the first XSL processing instruction from the input XML document.
-