Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| dbXML API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.dbxml.db.client.xmldb
Interface XSLTransformService

All Superinterfaces:
  org.xmldb.api.base.Configurable, org.xmldb.api.base.Service

All Known Implementing Classes:
  XSLTransformServiceImpl

public interface XSLTransformService
extends org.xmldb.api.base.Service

XSLTransformService is a `Service` that enables the execution of XSL transformations within the context of a `Collection` or against a single XML `Resource` stored in the `Collection`.

Method Summary
`void` | `clearNamespaces()` Removes all namespace mappings stored in the internal namespace map.
`void` | `clearParameters()` Removes or un-binds *all* bound paramters.
`java.lang.String` | `getNamespace(java.lang.String prefix)` Returns the URI string associated with `prefix` from the internal namespace map.
`java.lang.String` | `getParameter(java.lang.String name)` Retrieves the value of a bound parameter, or null if the parameter has not already been bound.
`void` | `removeNamespace(java.lang.String prefix)` Removes the namespace mapping associated with `prefix` from the internal namespace map.
`void` | `removeParameter(java.lang.String name)` Removes or un-binds a bound parameter.
`void` | `setNamespace(java.lang.String prefix, java.lang.String uri)` Sets a namespace mapping in the internal namespace map used to evaluate queries.
`void` | `setParameter(java.lang.String name, java.lang.String value)` Sets a bound parameter.
`void` | `setTemplates(org.xmldb.api.modules.XMLResource templates)` Sets the templates that will be used to transform this document.
`org.xmldb.api.base.Resource` | `transform(java.lang.String xpath)` Uses the defined templates to trasform the results of the XPath query against the `Collection`.
`org.xmldb.api.base.Resource` | `transformResource(java.lang.String id)` Uses the defined templates to transform the XML resource stored in the `Collection` associated with this service.

Methods inherited from interface org.xmldb.api.base.Service
`getName, getVersion, setCollection`

Methods inherited from interface org.xmldb.api.base.Configurable
`getProperty, setProperty`

Method Detail

### setNamespace

    public void setNamespace(java.lang.String prefix,
                             java.lang.String uri)
                      throws org.xmldb.api.base.XMLDBException

  Sets a namespace mapping in the internal namespace map used to evaluate queries. If `prefix` is null or empty the default namespace is associated with the provided URI. A null or empty `uri` results in an exception being thrown.

  Parameters:
    `prefix` - The prefix to set in the map. If `prefix` is empty or null the default namespace will be associated with the provided URI.
    `uri` - The URI for the namespace to be associated with prefix.
  Throws:
    `org.xmldb.api.base.XMLDBException` - with expected error codes.
    `ErrorCodes.VENDOR_ERROR` for any vendor specific errors that occur.

### getNamespace

    public java.lang.String getNamespace(java.lang.String prefix)
                                  throws org.xmldb.api.base.XMLDBException

  Returns the URI string associated with `prefix` from the internal namespace map. If `prefix` is null or empty the URI for the default namespace will be returned. If a mapping for the `prefix` can not be found null is returned.

  Parameters:
    `prefix` - The prefix to retrieve from the namespace map.
  Returns:
    The URI associated with `prefix`
  Throws:
    `org.xmldb.api.base.XMLDBException` - with expected error codes.
    `ErrorCodes.VENDOR_ERROR` for any vendor specific errors that occur.

### removeNamespace

    public void removeNamespace(java.lang.String prefix)
                         throws org.xmldb.api.base.XMLDBException

  Removes the namespace mapping associated with `prefix` from the internal namespace map. If `prefix` is null or empty the mapping for the default namespace will be removed.

  Parameters:
    `prefix` - The prefix to remove from the namespace map. If `prefix` is null or empty the mapping for the default namespace will be removed.
  Throws:
    `org.xmldb.api.base.XMLDBException` - with expected error codes.
    `ErrorCodes.VENDOR_ERROR` for any vendor specific errors that occur.

### clearNamespaces

    public void clearNamespaces()
                         throws org.xmldb.api.base.XMLDBException

  Removes all namespace mappings stored in the internal namespace map.

  Throws:
    `org.xmldb.api.base.XMLDBException` - with expected error codes.
    `ErrorCodes.VENDOR_ERROR` for any vendor specific errors that occur.

### setTemplates

    public void setTemplates(org.xmldb.api.modules.XMLResource templates)
                      throws org.xmldb.api.base.XMLDBException

  Sets the templates that will be used to transform this document. The templates are retrieved from the XSL stylesheet document that the templates XMLResource represents.

  Parameters:
    `templates` - The XSL stylesheet that will be used for the transformation.
  Throws:
    `org.xmldb.api.base.XMLDBException` - with expected error codes.
    `ErrorCodes.VENDOR_ERROR` for any vendor specific errors that occur.

### setParameter

    public void setParameter(java.lang.String name,
                             java.lang.String value)
                      throws org.xmldb.api.base.XMLDBException

  Sets a bound parameter. The value of this parameter will be passed into the XSL processor and bound to the variable name for processing. XSL parameters are declared with the param element.

  Parameters:
    `name` - The bound parameter name
    `value` - The bound parameter value
  Throws:
    `org.xmldb.api.base.XMLDBException` - with expected error codes.
    `ErrorCodes.VENDOR_ERROR` for any vendor specific errors that occur.

### getParameter

    public java.lang.String getParameter(java.lang.String name)
                                  throws org.xmldb.api.base.XMLDBException

  Retrieves the value of a bound parameter, or null if the parameter has not already been bound.

  Parameters:
    `name` - The bound parameter value to retrieve
  Throws:
    `org.xmldb.api.base.XMLDBException` - with expected error codes.
    `ErrorCodes.VENDOR_ERROR` for any vendor specific errors that occur.

### removeParameter

    public void removeParameter(java.lang.String name)
                         throws org.xmldb.api.base.XMLDBException

  Removes or un-binds a bound parameter.

  Parameters:
    `name` - The bound paramter name to remove.
  Throws:
    `org.xmldb.api.base.XMLDBException` - with expected error codes.
    `ErrorCodes.VENDOR_ERROR` for any vendor specific errors that occur.

### clearParameters

    public void clearParameters()
                         throws org.xmldb.api.base.XMLDBException

  Removes or un-binds *all* bound paramters.

  Throws:
    `org.xmldb.api.base.XMLDBException` - with expected error codes.
    `ErrorCodes.VENDOR_ERROR` for any vendor specific errors that occur.

### transform

    public org.xmldb.api.base.Resource transform(java.lang.String xpath)
                                          throws org.xmldb.api.base.XMLDBException

  Uses the defined templates to trasform the results of the XPath query against the `Collection`. The XPath will be applied to all XML resources stored in the `Collection`. The result is a `ResourceSet` containing the results of the query. Any namespaces used in the `query` string will be evaluated using the mappings setup using `setNamespace`.

  Returns:
    A `ResourceSet` containing the results of the query.
  Throws:
    `org.xmldb.api.base.XMLDBException` - with expected error codes.
    `ErrorCodes.VENDOR_ERROR` for any vendor specific errors that occur.

### transformResource

    public org.xmldb.api.base.Resource transformResource(java.lang.String id)
                                                  throws org.xmldb.api.base.XMLDBException

  Uses the defined templates to transform the XML resource stored in the `Collection` associated with this service. The result is a `ResourceSet` containing the results of the query. Any namespaces used in the `query` string will be evaluated using the mappings setup using `setNamespace`.

  Parameters:
    `id` - The id of the document to run the query against.
  Returns:
    A `ResourceSet` containing the results of the query.
  Throws:
    `org.xmldb.api.base.XMLDBException` - with expected error codes.
    `ErrorCodes.VENDOR_ERROR` for any vendor specific errors that occur.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| dbXML API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 2004 The dbXML Group