A XML Provider is used to convert and display the XML file according to
the specified style sheet.
XMLProvider is an extension of the existing URLScraperProvider. It uses
the URLScraperProvider to fetch the XML contents when the url is of type
http://url or https://url and if the url is of type file:////
, the XMLProvider manually reads the contents of the specified file .
The XMLProvider can transform generic XML content to specific markups
using an XSLT engine. It allows creating multiple markup channels from a
single XML source (local or over http/https)
XML Provider requires two arguments to do the transformation.
- The XML file that needs to the transformed
- The stylesheet to be used to do the transformation.
The XMLProvider-based channel has the following configurable attributes:
- url - the XML attribute used to store the path to the XML source
- xslFileName - the XML attribute used to store the path to the XSL
style sheet.
The path to the XML content can be specified as HTTP,HTTPs or file URL.
If the path is HTTP or HTTPs the provider uses URLScraper provider to fetch
the contents. If the path is a file URL, the provider reads the file into a
StringBuffer.
The value for the XSL filename to use for transformation is stored as
a value of the string attribute as indicated above. The user can either
specify the complete path (including the file name) or can specify just the
file name in which case it will be picked from the default directory. While
specifying a value for this property there should not be any use of the
protocols like "file://" or "http://" or "https://"
If both the XML file and the XSL file are present, the XMLProvider does
the transformation using the XSLT engine. The generated contents are
displayed in the channel. In order to do the conversion the XMLProvider uses
the JAXP1.1 jar files.
NOTE: getEdit() and processEdit() methods
are not implemented in the XMLProvider.
|