CTK 0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkCmdLineModuleXslTransform.h
Go to the documentation of this file.
1/*=============================================================================
2
3 Library: CTK
4
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics
7
8 Licensed under the Apache License, Version 2.0 (the "License");
9 you may not use this file except in compliance with the License.
10 You may obtain a copy of the License at
11
12 http://www.apache.org/licenses/LICENSE-2.0
13
14 Unless required by applicable law or agreed to in writing, software
15 distributed under the License is distributed on an "AS IS" BASIS,
16 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 See the License for the specific language governing permissions and
18 limitations under the License.
19
20=============================================================================*/
21
22#ifndef __ctkCmdLineModuleXslTransform_h
23#define __ctkCmdLineModuleXslTransform_h
24
25// CTK includes
26#include "ctkCommandLineModulesCoreExport.h"
28class ctkCmdLineModuleXslTransformPrivate;
29
30// Qt includes
31class QIODevice;
32
43class CTK_CMDLINEMODULECORE_EXPORT ctkCmdLineModuleXslTransform
45{
46
47public:
48
49 ctkCmdLineModuleXslTransform(QIODevice* input = 0, QIODevice* output = 0);
51
58 void setOutput(QIODevice* output);
59
64 QIODevice* output() const;
65
72 void setOutputSchema(QIODevice* output);
73
78 bool formatXmlOutput() const;
79
88 void setFormatXmlOutput(bool format);
89
99 bool transform();
100
110 void setXslTransformation(QIODevice* transformation);
111
120 void setXslExtraTransformation(QIODevice* transformation);
121 void setXslExtraTransformations(const QList<QIODevice*>& transformations);
122
130 void bindVariable(const QString& name, const QVariant& value);
131
138 void setValidateOutput(bool validate);
139
144 bool validateOutput() const;
145
154 virtual bool error() const;
155
164 virtual QString errorString() const;
165
166private:
167
168 QScopedPointer<ctkCmdLineModuleXslTransformPrivate> d;
169
170};
171
172
173#endif // CTKCMDLINEMODULEXSLTRANSFORM_H
Provides validation of an XML document against an XML schema.
Transforms a given XML input using an XML stylesheet.
void bindVariable(const QString &name, const QVariant &value)
Binds the variable name to the value so that $name can be used from within the query to refer to the ...
bool formatXmlOutput() const
Returns true if the XSL output will be formatted.
virtual QString errorString() const
Returns the error message if any.
void setOutputSchema(QIODevice *output)
Set an XML schema for output validation.
bool transform()
Transforms an XML input via a XSL transformation.
virtual bool error() const
Returns true if an error occured.
ctkCmdLineModuleXslTransform(QIODevice *input=0, QIODevice *output=0)
void setOutput(QIODevice *output)
Set the output device to which the transformation will be written.
void setXslTransformation(QIODevice *transformation)
Sets the XSL transformation.
void setFormatXmlOutput(bool format)
Formats the XSL output to be human-readable.
void setXslExtraTransformations(const QList< QIODevice * > &transformations)
void setXslExtraTransformation(QIODevice *transformation)
XSL to be injected in the main XSL.
void setValidateOutput(bool validate)
Sets the output validation mode.
QIODevice * output() const
Get the output device to which the transformation will be written.
bool validateOutput() const
Get the output validation mode.