public class XSLTProcessor extends Object
XSLTProcessor
applies XSLT on the XML content of an XML
Component Presentation.Constructor and Description |
---|
XSLTProcessor()
Creates a new
XSLTProcessor . |
Modifier and Type | Method and Description |
---|---|
String |
getString(int publicationId,
int componentId,
int componentTemplateId)
Applies the Dynamic Component Template, which is an XSLT, to the contents
of an XML Component Presentation.
|
String |
getString(String componentURIString,
String templateURIString)
Applies the Dynamic Component Template, which is an XSLT, to the contents
of an XML Component Presentation.
|
String |
getString(XMLComponentPresentation cp,
int thePageId)
Applies the Dynamic Component Template, which is an XSLT, to the contents
of an XML Component Presentation.
|
String |
getString(XMLComponentPresentation componentPresentation,
URL url)
Applies the Dynamic Component Template, which is an XSLT, to the contents
of an XML Component Presentation.
|
String |
getString(XMLQueryResult input,
int publicationId,
int componentTemplateId)
Applies a Dynamic Template (XSLT) on an
XMLQueryResult and
returns the result as a String. |
String |
getString(XMLQueryResult input,
String publicationURIString,
String templateURIString)
Applies a Dynamic Template (XSLT) on an
XMLQueryResult and
returns the result as a String. |
Transformer |
getTransformer(int publicationId,
int componentTemplateId)
Creates a
Transformer from a Dynamic Template. |
void |
initPageURI(String pageURI)
Set the page URI to use to pass to the XSL transformation as a parameter,
in case a page identifier is not specified in the API call (the
default that can be overruled).
|
protected void |
setParameters(Transformer transformer,
int publicationId,
int thePageId,
int componentId,
int componentTemplateId)
Sets the parameters for the stylesheet, which are
publicationId ,
pageId ,
componentId ,
componentTemplateId ,
publicationURI ,
pageURI ,
componentURI ,
componentTemplateURI . |
public void initPageURI(String pageURI)
pageURI
- The page URI to pass to the XSLT processor as a
parameter. Incorrect URIs are simply ignored.public String getString(XMLComponentPresentation cp, int thePageId)
thePageId
- The id of the page on which the dynamic assembly occurs.public String getString(XMLComponentPresentation componentPresentation, URL url)
url
- This parameter isn't used.public String getString(String componentURIString, String templateURIString)
If no XSLT for the XML Component Presentation or the XML Component Presentation itself can be found, or another error occurs, an empty string will be returned.
componentURIString
- The tcm:uri of the Component.templateURIString
- The tcm:uri of the Component Template.public String getString(int publicationId, int componentId, int componentTemplateId)
If no XSLT for the XML Component Presentation or the XML Component Presentation itself can be found, or another error occurs, an empty string will be returned.
publicationId
- The id of the Publication in which the Component Presentation
is located.componentId
- The id of the Component.componentTemplateId
- The id of the Component Template.public String getString(XMLQueryResult input, int publicationId, int componentTemplateId)
XMLQueryResult
and
returns the result as a String.
If no XSLT for the XML Component Presentation or the XML Component Presentation itself
can be found, or another error occurs, an empty string will be returned.input
- The XMLQueryResult
that should be transformed.publicationId
- The id of the Publication in which the Component Template
is located.componentTemplateId
- The id of the Component Template.public String getString(XMLQueryResult input, String publicationURIString, String templateURIString)
XMLQueryResult
and
returns the result as a String.
If no XSLT for the XML Component Presentation or the XML Component Presentation itself
can be found, or another error occurs, an empty string will be returned.input
- The XMLQueryResult
that should be transformed.publicationURIString
- The tcm:uri of the Publication in which the Component Template is located.templateURIString
- The tcm:uri of the Component Template.public Transformer getTransformer(int publicationId, int componentTemplateId) throws TransformerException, StorageException
Transformer
from a Dynamic Template. If the Object Cache is enabled then the
transfomerms are cached instead of of being created from scratch every time.publicationId
- The id of the Publication in which the Component Template is located.componentTemplateId
- The id of the Component Template.TransformerException
- When a Transformer could not be created for the XSLT.StorageException
protected void setParameters(Transformer transformer, int publicationId, int thePageId, int componentId, int componentTemplateId)
publicationId
,
pageId
,
componentId
,
componentTemplateId
,
publicationURI
,
pageURI
,
componentURI
,
componentTemplateURI
.transformer
- the transformer for which the parameters should be setpublicationId
- the id of the PublicationcomponentId
- the id of the ComponentcomponentTemplateId
- the id of the Component TemplateCopyright (c) 2014-2021 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries