Project

Profile

Help

Revision 6304fb8b

Added by O'Neil Delpratt 5 months ago

Saxon/C bug fixes and development work

View differences:

latest10/hec/Saxon.C.API/XsltExecutable.h
5 5
// This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
6 6
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
7 7

  
8
#ifndef SAXON_XSLTEXEC_H
9
#define SAXON_XSLTEXEC_H
8
#ifndef SAXON_XSLT_EXEC_H
9
#define SAXON_XSLT_EXEC_H
10 10

  
11 11

  
12 12
#include "SaxonProcessor.h"
......
19 19
class XdmValue;
20 20
class XdmItem;
21 21
class XdmNode;
22
class XdmFunctionItem;
23
class XdmMap;
24
class XdmArray;
22 25

  
23 26
/*! An <code>XsltExecutable</code> represents the compiled form of a stylesheet.
24 27
 * <p>An XsltExecutable is created by using one of the <code>compile</code> methods on the
......
73 76
    void setGlobalContextFromFile(const char * filename);
74 77

  
75 78

  
79
    //! Create a clone object of this Xslt30Processor object
80
    /**
81
     *
82
     * @return
83
     */
84
    XsltExecutable *clone();
85

  
86

  
76 87
    //!The initial value to which templates are to be applied (equivalent to the <code>select</code> attribute of <code>xsl:apply-templates</code>)
77 88
    /**
78 89
    *  @param selection - The value to which the templates are to be applied
......
106 117
     * Set the value of a stylesheet parameter
107 118
     *
108 119
     * @param name  the name of the stylesheet parameter, as a string. For namespaced parameter use the JAXP solution i.e. "{uri}name"
109
     * @param value the value of the stylesheet parameter, or null to clear a previously set value
110
     * @param _static For static (compile-time) parameters we set this flag to true, which means the parameter is
111
     * must be set on the XsltCompiler object, prior to stylesheet compilation. The default is false. Non-static parameters
112
     * may also be provided.
120
     * @param value the value of the stylesheet parameter, or nullptr to clear a previously set value
113 121
     */
114
    void setParameter(const char* name, XdmValue*value);
122
    void setParameter(const char* name, XdmValue * value);
115 123

  
116 124

  
117 125

  
......
233 241
     * @param  filename - If the filename argument is present then the xsl:message output is appended to the given
234 242
     *                    filename with location cwd+filename
235 243
     */
236
    void setupXslMessage(bool show, const char* filename=NULL);
244
    void setupXslMessage(bool show, const char* filename=nullptr);
237 245

  
238 246

  
239 247
    /**
......
246 254
     * @param outputFilename the destination for the XML document containing the diagnostic representation
247 255
     *                    of the compiled stylesheet. The stream will be closed when writing has finished.
248 256
     */
249
    void export(const char * filename);
257
    void exportStylesheet(const char * filename);
250 258

  
251 259

  
252 260
      //!Perform a one shot transformation.
......
305 313
    * file destination. If setInitialTemplateParameters(std::Map, boolean) has been
306 314
    * called, then the parameters supplied are made available to the called template (no error
307 315
    * occurs if parameters are supplied that are not used).
308
    * @param templateName - The name of the initial template. This must match the name of a public named template in the stylesheet. If the value is null, the clark name for xsl:initial-template is used.
316
    * @param templateName - The name of the initial template. This must match the name of a public named template in the stylesheet. If the value is nullptr, the clark name for xsl:initial-template is used.
309 317
    * @param outputfile - The file name where results will be stored,
310 318
    */
311 319
    void callTemplateReturningFile(const char* templateName, const char* outfile);
......
315 323
    * If setInitialTemplateParameters(std::Map, boolean) has been
316 324
    * called, then the parameters supplied are made available to the called template (no error
317 325
    * occurs if parameters are supplied that are not used).
318
    * @param templateName - the name of the initial template. This must match the name of a public named template in the stylesheet. If the value is null, the clark name for xsl:initial-template is used.
326
    * @param templateName - the name of the initial template. This must match the name of a public named template in the stylesheet. If the value is nullptr, the clark name for xsl:initial-template is used.
319 327
    * @param outputfile - The file name where results will be stored,
320 328
    */
321 329
    const char* callTemplateReturningString(const char* templateName);
......
325 333
    * If setInitialTemplateParameters(std::Map, boolean) has been
326 334
    * called, then the parameters supplied are made available to the called template (no error
327 335
    * occurs if parameters are supplied that are not used).
328
    * @param templateName - the name of the initial template. This must match the name of a public named template in the stylesheet. If the value is null, the clark name for xsl:initial-template is used.
336
    * @param templateName - the name of the initial template. This must match the name of a public named template in the stylesheet. If the value is nullptr, the clark name for xsl:initial-template is used.
329 337
    * @param outputfile - The file name where results will be stored,
330 338
    */
331 339
    XdmValue* callTemplateReturningValue(const char* templateName);
......
405 413
    bool exceptionOccurred();
406 414

  
407 415

  
408
     //! Check for exception thrown.
409
	/**
410
	* @return cha*. Returns the exception message if thrown otherwise return NULL
411
	*/
412
    const char* checkException();
416

  
417

  
418
    //! Check for exception thrown.
419
    /**
420
    * @return cha*. Returns the exception message if thrown otherwise return nullptr
421
    */
422
    SaxonApiException* getException();
413 423

  
414 424

  
415 425
     //! Clear any exception thrown
......
427 437
     * A transformation may have a number of errors reported against it.
428 438
     * @return char* - The message of the i'th exception
429 439
    */
430
    const char * getErrorMessage(int i);
440
    const char * getErrorMessage();
431 441

  
432 442
     //! Get the ith error code if there are any error
433 443
    /**
434 444
     * A transformation may have a number of errors reported against it.
435 445
     * @return char* - The error code of the i'th exception. The error code are related to the specific specification
436 446
    */
437
    const char * getErrorCode(int i);
447
    const char * getErrorCode();
438 448

  
439 449

  
440 450

  
......
450 460
      @param proc - Supplied pointer to the SaxonProcessor object
451 461
      cwd - The current working directory
452 462
    */
453
    XsltExecutable(std::string cwd="", jobject executableObject);
463
    XsltExecutable(jobject exObject, std::string cwd="");
454 464

  
455 465
	/**
456 466
	 * Xslt30Processor copy constructor.
......
467 477
	std::map<std::string,XdmValue*> parameters; /*!< map of parameters used for the transformation as (string, value) pairs */
468 478

  
469 479
	std::map<std::string,std::string> properties; /*!< map of properties used for the transformation as (string, string) pairs */
470
    SaxonApiException * exception;
480

  
471 481
};
472 482

  
473 483

  
474
#endif /* SAXON_XSLT30_H */
484
#endif /* SAXON_XSLT_EXEC_H */

Also available in: Unified diff