+Sun Dec 21 13:17:05 CET 2003 Daniel Veillard <daniel@veillard.com>
+
+ * xsltproc.c: fixed #129327 make sure parser flags get transmitted to
+ the transformation context
+ * libxslt/documents.c libxslt/transform.c libxslt/xsltInternals.h
+ libxslt/xsltutils.c libxslt/xsltutils.h: add a new call
+ xsltSetCtxtParseOptions() to update parsing options in document()
+
Sun Dec 21 12:51:12 CET 2003 Daniel Veillard <daniel@veillard.com>
* libxslt/keys.c: fixed second problem on #122483, namespace
<a href="html/libxslt-transform.html#xsltRunStylesheetUser">xsltRunStylesheetUser</a><br />
</dd><dt>Attribute</dt><dd><a href="html/libxslt-xsltInternals.html#_xsltStylesheet">_xsltStylesheet</a><br />
</dd></dl><h2>Letter C:</h2><dl><dt>CDTATA</dt><dd><a href="html/libxslt-imports.html#xsltFindElemSpaceHandling">xsltFindElemSpaceHandling</a><br />
+</dd><dt>Change</dt><dd><a href="html/libxslt-xsltutils.html#xsltSetCtxtParseOptions">xsltSetCtxtParseOptions</a><br />
</dd><dt>Char</dt><dd><a href="html/libxslt-xsltutils.html#xsltGetUTF8Char">xsltGetUTF8Char</a><br />
</dd><dt>Characters:</dt><dd><a href="html/libxslt-xsltInternals.html#xsltFormatNumberConversion">xsltFormatNumberConversion</a><br />
</dd><dt>Check</dt><dd><a href="html/libxslt-xsltutils.html#IS_XSLT_REAL_NODE">IS_XSLT_REAL_NODE</a><br />
<a href="html/libxslt-xsltutils.html#xsltSaveResultToFile">xsltSaveResultToFile</a><br />
</dd><dt>coalescing</dt><dd><a href="html/libxslt-xsltInternals.html#_xsltTransformContext">_xsltTransformContext</a><br />
</dd><dt>com</dt><dd><a href="html/libxslt-xsltInternals.html#xsltFormatNumberConversion">xsltFormatNumberConversion</a><br />
+</dd><dt>combination</dt><dd><a href="html/libxslt-xsltutils.html#xsltSetCtxtParseOptions">xsltSetCtxtParseOptions</a><br />
</dd><dt>comment</dt><dd><a href="html/libxslt-transform.html#xsltComment">xsltComment</a><br />
</dd><dt>common</dt><dd><a href="html/libxslt-xsltInternals.html#_xsltElemPreComp">_xsltElemPreComp</a><br />
</dd><dt>comp</dt><dd><a href="html/libxslt-pattern.html#xsltFreeCompMatchList">xsltFreeCompMatchList</a><br />
<a href="html/libxslt-transform.html#xsltGetXIncludeDefault">xsltGetXIncludeDefault</a><br />
<a href="html/libxslt-transform.html#xsltRegisterAllElement">xsltRegisterAllElement</a><br />
<a href="html/libxslt-functions.html#xsltRegisterAllFunctions">xsltRegisterAllFunctions</a><br />
+<a href="html/libxslt-xsltutils.html#xsltSetCtxtParseOptions">xsltSetCtxtParseOptions</a><br />
<a href="html/libxslt-security.html#xsltSetDefaultSecurityPrefs">xsltSetDefaultSecurityPrefs</a><br />
<a href="html/libxslt-xsltutils.html#xsltSetSortFunc">xsltSetSortFunc</a><br />
<a href="html/libxslt-transform.html#xsltSetXIncludeDefault">xsltSetXIncludeDefault</a><br />
</dd><dt>end</dt><dd><a href="html/libxslt-xsltInternals.html#_xsltElemPreComp">_xsltElemPreComp</a><br />
<a href="html/libxslt-xsltInternals.html#xsltRegisterPersistRVT">xsltRegisterPersistRVT</a><br />
<a href="html/libxslt-xsltInternals.html#xsltRegisterTmpRVT">xsltRegisterTmpRVT</a><br />
+</dd><dt>engine</dt><dd><a href="html/libxslt-xsltutils.html#xsltSetCtxtParseOptions">xsltSetCtxtParseOptions</a><br />
</dd><dt>entity</dt><dd><a href="html/libxslt-xsltutils.html#xsltGetNsProp">xsltGetNsProp</a><br />
</dd><dt>entry</dt><dd><a href="html/libxslt-pattern.html#xsltNormalizeCompSteps">xsltNormalizeCompSteps</a><br />
<a href="html/libxslt-functions.html#xsltXPathFunctionLookup">xsltXPathFunctionLookup</a><br />
<a href="html/libxslt-xsltutils.html#xsltSetDebuggerCallbacks">xsltSetDebuggerCallbacks</a><br />
<a href="html/libxslt-extensions.html#xsltUnregisterExtModule">xsltUnregisterExtModule</a><br />
</dd><dt>libxml2</dt><dd><a href="html/libxslt-xsltutils.html#xsltGetUTF8Char">xsltGetUTF8Char</a><br />
+<a href="html/libxslt-xsltutils.html#xsltSetCtxtParseOptions">xsltSetCtxtParseOptions</a><br />
</dd><dt>libxslt</dt><dd><a href="html/libxslt-extra.html#XSLT_LIBXSLT_NAMESPACE">XSLT_LIBXSLT_NAMESPACE</a><br />
<a href="html/libxslt-extra.html#xsltFunctionNodeSet">xsltFunctionNodeSet</a><br />
</dd><dt>lifespan</dt><dd><a href="html/libxslt-xsltutils.html#xsltGetQNameURI">xsltGetQNameURI</a><br />
<a href="html/libxslt-extensions.html#xsltShutdownCtxtExts">xsltShutdownCtxtExts</a><br />
<a href="html/libxslt-extensions.html#xsltShutdownExts">xsltShutdownExts</a><br />
</dd><dt>loading</dt><dd><a href="html/libxslt-xslt.html#XSLT_PARSE_OPTIONS">XSLT_PARSE_OPTIONS</a><br />
+<a href="html/libxslt-xsltutils.html#xsltSetCtxtParseOptions">xsltSetCtxtParseOptions</a><br />
</dd><dt>local</dt><dd><a href="html/libxslt-xsltInternals.html#_xsltStackElem">_xsltStackElem</a><br />
<a href="html/libxslt-xsltInternals.html#_xsltTemplate">_xsltTemplate</a><br />
</dd><dt>locate</dt><dd><a href="html/libxslt-xsltInternals.html#xsltLoadStylesheetPI">xsltLoadStylesheetPI</a><br />
<a href="html/libxslt-security.html#xsltSecurityForbid">xsltSecurityForbid</a><br />
</dd><dt>optimization</dt><dd><a href="html/libxslt-xsltInternals.html#_xsltTransformContext">_xsltTransformContext</a><br />
</dd><dt>option</dt><dd><a href="html/libxslt-security.html#xsltGetSecurityPrefs">xsltGetSecurityPrefs</a><br />
+<a href="html/libxslt-xsltutils.html#xsltSetCtxtParseOptions">xsltSetCtxtParseOptions</a><br />
<a href="html/libxslt-security.html#xsltSetSecurityPrefs">xsltSetSecurityPrefs</a><br />
</dd><dt>options</dt><dd><a href="html/libxslt-xslt.html#XSLT_PARSE_OPTIONS">XSLT_PARSE_OPTIONS</a><br />
+<a href="html/libxslt-xsltInternals.html#_xsltTransformContext">_xsltTransformContext</a><br />
<a href="html/libxslt-security.html#xsltCheckRead">xsltCheckRead</a><br />
<a href="html/libxslt-security.html#xsltCheckWrite">xsltCheckWrite</a><br />
+<a href="html/libxslt-xsltutils.html#xsltSetCtxtParseOptions">xsltSetCtxtParseOptions</a><br />
</dd><dt>order</dt><dd><a href="html/libxslt-imports.html#XSLT_GET_IMPORT_INT">XSLT_GET_IMPORT_INT</a><br />
<a href="html/libxslt-imports.html#XSLT_GET_IMPORT_PTR">XSLT_GET_IMPORT_PTR</a><br />
<a href="html/libxslt-xsltutils.html#xsltDocumentSortFunction">xsltDocumentSortFunction</a><br />
<a href="html/libxslt-variables.html#xsltQuoteUserParams">xsltQuoteUserParams</a><br />
<a href="html/libxslt-transform.html#xsltRunStylesheet">xsltRunStylesheet</a><br />
<a href="html/libxslt-transform.html#xsltRunStylesheetUser">xsltRunStylesheetUser</a><br />
-</dd><dt>parser</dt><dd><a href="html/libxslt-transform.html#xsltFreeTransformContext">xsltFreeTransformContext</a><br />
+</dd><dt>parser</dt><dd><a href="html/libxslt-xsltInternals.html#_xsltTransformContext">_xsltTransformContext</a><br />
+<a href="html/libxslt-transform.html#xsltFreeTransformContext">xsltFreeTransformContext</a><br />
+<a href="html/libxslt-xsltutils.html#xsltSetCtxtParseOptions">xsltSetCtxtParseOptions</a><br />
</dd><dt>parsing</dt><dd><a href="html/libxslt-xsltutils.html#xsltSetGenericDebugFunc">xsltSetGenericDebugFunc</a><br />
<a href="html/libxslt-xsltutils.html#xsltSetGenericErrorFunc">xsltSetGenericErrorFunc</a><br />
</dd><dt>part</dt><dd><a href="html/libxslt-xsltInternals.html#_xsltElemPreComp">_xsltElemPreComp</a><br />
<a href="html/libxslt-templates.html#xsltAttrTemplateValueProcessNode">xsltAttrTemplateValueProcessNode</a><br />
<a href="html/libxslt-templates.html#xsltEvalXPathStringNs">xsltEvalXPathStringNs</a><br />
</dd><dt>passed</dt><dd><a href="html/libxslt-transform.html#xsltApplyOneTemplate">xsltApplyOneTemplate</a><br />
+<a href="html/libxslt-xsltutils.html#xsltSetCtxtParseOptions">xsltSetCtxtParseOptions</a><br />
<a href="html/libxslt-xsltutils.html#xsltSetGenericDebugFunc">xsltSetGenericDebugFunc</a><br />
<a href="html/libxslt-xsltutils.html#xsltSetGenericErrorFunc">xsltSetGenericErrorFunc</a><br />
</dd><dt>path</dt><dd><a href="html/libxslt-security.html#xsltSecurityCheck">xsltSecurityCheck</a><br />
</dd><dt>preserve</dt><dd><a href="html/libxslt-xsltInternals.html#_xsltStylesheet">_xsltStylesheet</a><br />
</dd><dt>preserve-space</dt><dd><a href="html/libxslt-xsltInternals.html#_xsltStylesheet">_xsltStylesheet</a><br />
<a href="html/libxslt-imports.html#xsltFindElemSpaceHandling">xsltFindElemSpaceHandling</a><br />
+</dd><dt>previous</dt><dd><a href="html/libxslt-xsltutils.html#xsltSetCtxtParseOptions">xsltSetCtxtParseOptions</a><br />
</dd><dt>printed</dt><dd><a href="html/libxslt-xsltutils.html#xslAddCall">xslAddCall</a><br />
</dd><dt>priority</dt><dd><a href="html/libxslt-xsltInternals.html#XSLT_PAT_NO_PRIORITY">XSLT_PAT_NO_PRIORITY</a><br />
<a href="html/libxslt-xsltInternals.html#_xsltTemplate">_xsltTemplate</a><br />
<a href="html/libxslt-templates.html#xsltEvalXPathStringNs">xsltEvalXPathStringNs</a><br />
<a href="html/libxslt-transform.html#xsltRunStylesheet">xsltRunStylesheet</a><br />
<a href="html/libxslt-transform.html#xsltRunStylesheetUser">xsltRunStylesheetUser</a><br />
+<a href="html/libxslt-xsltutils.html#xsltSetCtxtParseOptions">xsltSetCtxtParseOptions</a><br />
</dd></dl><h2 align="center"><a href="APIchunk0.html">A-P</a>
<a href="APIchunk1.html">Q-a</a>
<a href="APIchunk2.html">b-c</a>
</dd><dt>when</dt><dd><a href="html/libxslt-xslt.html#XSLT_PARSE_OPTIONS">XSLT_PARSE_OPTIONS</a><br />
<a href="html/libxslt-xsltInternals.html#_xsltTransformContext">_xsltTransformContext</a><br />
<a href="html/libxslt-extensions.html#xsltInitElemPreComp">xsltInitElemPreComp</a><br />
+<a href="html/libxslt-xsltutils.html#xsltSetCtxtParseOptions">xsltSetCtxtParseOptions</a><br />
<a href="html/libxslt-functions.html#xsltXPathFunctionLookup">xsltXPathFunctionLookup</a><br />
<a href="html/libxslt-extensions.html#xsltXPathGetTransformContext">xsltXPathGetTransformContext</a><br />
<a href="html/libxslt-variables.html#xsltXPathVariableLookup">xsltXPathVariableLookup</a><br />
<a href="html/libxslt-transform.html#xsltCopyTextString">xsltCopyTextString</a><br />
</dd><dt>xmlNsPtr</dt><dd><a href="html/libxslt-namespaces.html#xsltCopyNamespace">xsltCopyNamespace</a><br />
<a href="html/libxslt-namespaces.html#xsltCopyNamespaceList">xsltCopyNamespaceList</a><br />
+</dd><dt>xmlParserOption</dt><dd><a href="html/libxslt-xsltInternals.html#_xsltTransformContext">_xsltTransformContext</a><br />
+<a href="html/libxslt-xsltutils.html#xsltSetCtxtParseOptions">xsltSetCtxtParseOptions</a><br />
</dd><dt>xmlReadxxx</dt><dd><a href="html/libxslt-xslt.html#XSLT_PARSE_OPTIONS">XSLT_PARSE_OPTIONS</a><br />
</dd><dt>xsl</dt><dd><a href="html/libxslt-xsltutils.html#XSLT_TRACE">XSLT_TRACE</a><br />
</dd><dt>xsl:apply-templates</dt><dd><a href="html/libxslt-xsltInternals.html#xsltTransformFunction">xsltTransformFunction</a><br />
<a href="html/libxslt-extensions.html#xsltStyleGetExtData">xsltStyleGetExtData</a><br />
<a href="html/libxslt-extensions.html#xsltGetExtData">xsltGetExtData</a><br />
<a href="html/libxslt-extensions.html#xsltStyleExtInitFunction">xsltStyleExtInitFunction</a><br />
-</p><h2>Type xmlAttrPtr:</h2><p><a href="html/libxslt-templates.html#xsltAttrTemplateProcess">xsltAttrTemplateProcess</a><br />
-<a href="html/libxslt-templates.html#xsltAttrListTemplateProcess">xsltAttrListTemplateProcess</a><br />
+</p><h2>Type xmlAttrPtr:</h2><p><a href="html/libxslt-templates.html#xsltAttrListTemplateProcess">xsltAttrListTemplateProcess</a><br />
+<a href="html/libxslt-templates.html#xsltAttrTemplateProcess">xsltAttrTemplateProcess</a><br />
</p><h2>Type xmlChar *:</h2><p><a href="html/libxslt-templates.html#xsltAttrTemplateValueProcess">xsltAttrTemplateValueProcess</a><br />
<a href="html/libxslt-templates.html#xsltEvalAttrValueTemplate">xsltEvalAttrValueTemplate</a><br />
<a href="html/libxslt-templates.html#xsltEvalTemplateString">xsltEvalTemplateString</a><br />
+<a href="html/libxslt-xsltutils.html#xsltGetNsProp">xsltGetNsProp</a><br />
<a href="html/libxslt-templates.html#xsltAttrTemplateValueProcessNode">xsltAttrTemplateValueProcessNode</a><br />
<a href="html/libxslt-templates.html#xsltEvalXPathString">xsltEvalXPathString</a><br />
<a href="html/libxslt-templates.html#xsltEvalXPathStringNs">xsltEvalXPathStringNs</a><br />
-<a href="html/libxslt-xsltutils.html#xsltGetNsProp">xsltGetNsProp</a><br />
<a href="html/libxslt-templates.html#xsltEvalStaticAttrValueTemplate">xsltEvalStaticAttrValueTemplate</a><br />
</p><h2>Type xmlDocPtr:</h2><p><a href="html/libxslt-xsltInternals.html#xsltCreateRVT">xsltCreateRVT</a><br />
-<a href="html/libxslt-transform.html#xsltApplyStylesheet">xsltApplyStylesheet</a><br />
<a href="html/libxslt-transform.html#xsltProfileStylesheet">xsltProfileStylesheet</a><br />
<a href="html/libxslt-transform.html#xsltApplyStylesheetUser">xsltApplyStylesheetUser</a><br />
+<a href="html/libxslt-transform.html#xsltApplyStylesheet">xsltApplyStylesheet</a><br />
<a href="html/libxslt-xsltutils.html#xsltGetProfileInformation">xsltGetProfileInformation</a><br />
</p><h2>Type xmlHashTablePtr:</h2><p><a href="html/libxslt-extensions.html#xsltGetExtInfo">xsltGetExtInfo</a><br />
</p><h2>Type xmlNodePtr:</h2><p><a href="html/libxslt-transform.html#xsltCopyTextString">xsltCopyTextString</a><br />
</p><h2>Type xmlNodePtr *:</h2><p><a href="html/libxslt-templates.html#xsltTemplateProcess">xsltTemplateProcess</a><br />
</p><h2>Type xmlNodeSetPtr:</h2><p><a href="html/libxslt-keys.html#xsltGetKey">xsltGetKey</a><br />
</p><h2>Type xmlNsPtr:</h2><p><a href="html/libxslt-namespaces.html#xsltCopyNamespace">xsltCopyNamespace</a><br />
+<a href="html/libxslt-namespaces.html#xsltGetSpecialNamespace">xsltGetSpecialNamespace</a><br />
<a href="html/libxslt-namespaces.html#xsltGetNamespace">xsltGetNamespace</a><br />
<a href="html/libxslt-namespaces.html#xsltCopyNamespaceList">xsltCopyNamespaceList</a><br />
-<a href="html/libxslt-namespaces.html#xsltGetSpecialNamespace">xsltGetSpecialNamespace</a><br />
</p><h2>Type xmlXPathError:</h2><p><a href="html/libxslt-xsltInternals.html#xsltFormatNumberConversion">xsltFormatNumberConversion</a><br />
</p><h2>Type xmlXPathFunction:</h2><p><a href="html/libxslt-extensions.html#xsltExtFunctionLookup">xsltExtFunctionLookup</a><br />
-<a href="html/libxslt-extensions.html#xsltExtModuleFunctionLookup">xsltExtModuleFunctionLookup</a><br />
<a href="html/libxslt-functions.html#xsltXPathFunctionLookup">xsltXPathFunctionLookup</a><br />
+<a href="html/libxslt-extensions.html#xsltExtModuleFunctionLookup">xsltExtModuleFunctionLookup</a><br />
</p><h2>Type xmlXPathObjectPtr:</h2><p><a href="html/libxslt-variables.html#xsltXPathVariableLookup">xsltXPathVariableLookup</a><br />
<a href="html/libxslt-variables.html#xsltVariableLookup">xsltVariableLookup</a><br />
</p><h2>Type xmlXPathObjectPtr *:</h2><p><a href="html/libxslt-xsltutils.html#xsltComputeSortResult">xsltComputeSortResult</a><br />
<a href="html/libxslt-preproc.html#xsltDocumentComp">xsltDocumentComp</a><br />
</p><h2>Type xsltPreComputeFunction:</h2><p><a href="html/libxslt-extensions.html#xsltExtModuleElementPreComputeLookup">xsltExtModuleElementPreComputeLookup</a><br />
</p><h2>Type xsltSecurityCheck:</h2><p><a href="html/libxslt-security.html#xsltGetSecurityPrefs">xsltGetSecurityPrefs</a><br />
-</p><h2>Type xsltSecurityPrefsPtr:</h2><p><a href="html/libxslt-security.html#xsltNewSecurityPrefs">xsltNewSecurityPrefs</a><br />
-<a href="html/libxslt-security.html#xsltGetDefaultSecurityPrefs">xsltGetDefaultSecurityPrefs</a><br />
+</p><h2>Type xsltSecurityPrefsPtr:</h2><p><a href="html/libxslt-security.html#xsltGetDefaultSecurityPrefs">xsltGetDefaultSecurityPrefs</a><br />
+<a href="html/libxslt-security.html#xsltNewSecurityPrefs">xsltNewSecurityPrefs</a><br />
</p><h2>Type xsltStackElemPtr:</h2><p><a href="html/libxslt-variables.html#xsltParseStylesheetCallerParam">xsltParseStylesheetCallerParam</a><br />
</p><h2>Type xsltStylesheetPtr:</h2><p><a href="html/libxslt-xsltInternals.html#xsltParseStylesheetImportedDoc">xsltParseStylesheetImportedDoc</a><br />
<a href="html/libxslt-xsltInternals.html#xsltParseStylesheetProcess">xsltParseStylesheetProcess</a><br />
<a href="html/libxslt-xsltutils.html#xsltGetProfileInformation">xsltGetProfileInformation</a><br />
<a href="html/libxslt-xsltutils.html#XSLT_TRACE_IF">XSLT_TRACE_IF</a><br />
<a href="html/libxslt-xsltutils.html#XSLT_TRACE_NONE">XSLT_TRACE_NONE</a><br />
+<a href="html/libxslt-xsltutils.html#xsltSetCtxtParseOptions">xsltSetCtxtParseOptions</a><br />
<a href="html/libxslt-xsltutils.html#xsltSetDebuggerStatus">xsltSetDebuggerStatus</a><br />
<a href="html/libxslt-xsltutils.html#XSLT_TRACE_TEMPLATES">XSLT_TRACE_TEMPLATES</a><br />
<a href="html/libxslt-xsltutils.html#xsltSetSortFunc">xsltSetSortFunc</a><br />
<a href="html/libxslt-security.html#xsltSecurityAllow">xsltSecurityAllow</a><br />
<a href="html/libxslt-security.html#xsltSecurityCheck">xsltSecurityCheck</a><br />
<a href="html/libxslt-security.html#xsltSecurityForbid">xsltSecurityForbid</a><br />
+<a href="html/libxslt-xsltutils.html#xsltSetCtxtParseOptions">xsltSetCtxtParseOptions</a><br />
<a href="html/libxslt-security.html#xsltSetCtxtSecurityPrefs">xsltSetCtxtSecurityPrefs</a><br />
<a href="html/libxslt-xsltutils.html#xsltSetCtxtSortFunc">xsltSetCtxtSortFunc</a><br />
<a href="html/libxslt-xsltutils.html#xsltSetTransformErrorFunc">xsltSetTransformErrorFunc</a><br />
<a href="html/libxslt-security.html#xsltSecurityOption">xsltSecurityOption</a><br />
<a href="html/libxslt-security.html#xsltSecurityPrefs">xsltSecurityPrefs</a><br />
<a href="html/libxslt-security.html#xsltSecurityPrefsPtr">xsltSecurityPrefsPtr</a><br />
+<a href="html/libxslt-xsltutils.html#xsltSetCtxtParseOptions">xsltSetCtxtParseOptions</a><br />
<a href="html/libxslt-security.html#xsltSetCtxtSecurityPrefs">xsltSetCtxtSecurityPrefs</a><br />
<a href="html/libxslt-xsltutils.html#xsltSetCtxtSortFunc">xsltSetCtxtSortFunc</a><br />
<a href="html/libxslt-xsltutils.html#xsltSetDebuggerCallbacks">xsltSetDebuggerCallbacks</a><br />
</li>
<li><em>passing parameters on the xsltproc command line doesn't work</em>
<p><em>xsltproc --param test alpha foo.xsl foo.xml</em></p>
- <p><em>the param does not get passed and ends up as ""</em></p>
+ <p><em>the param does not get passed and ends up as ""</em></p>
<p>In a nutshell do a double escaping at the shell prompt:</p>
- <p>xsltproc --param test "'alpha'" foo.xsl foo.xml</p>
- <p>i.e. the string value is surrounded by " and ' then terminated by '
- and ". Libxslt interpret the parameter values as XPath expressions, so
+ <p>xsltproc --param test "'alpha'" foo.xsl foo.xml</p>
+ <p>i.e. the string value is surrounded by " and ' then terminated by '
+ and ". Libxslt interpret the parameter values as XPath expressions, so
the string -><code>alpha</code><- is intepreted as the node set
matching this string. You really want -><code>'alpha'</code><- to
be passed to the processor. And to allow this you need to escape the
- quotes at the shell level using -><code>"'alpha'"</code><- .</p>
+ quotes at the shell level using -><code>"'alpha'"</code><- .</p>
<p>or use</p>
<p>xsltproc --stringparam test alpha foo.xsl foo.xml</p>
</li>
XSLT</a> pages provide links to a lot of answers</li>
<li>the <a href="http://incrementaldevelopment.com/xsltrick/">Gallery of
XSLT Tricks</a> provides non-standard use case of XSLT</li>
- <li>And I suggest to buy Michael Kay "XSLT Programmer's Reference" book
+ <li>And I suggest to buy Michael Kay "XSLT Programmer's Reference" book
published by <a href="http://www.wrox.com/">Wrox</a> if you plan to work
seriously with XSLT in the future.</li>
</ul><p>Well, bugs or missing features are always possible, and I will make a
point of fixing them in a timely fashion. The best way to report a bug is to
use the <a href="http://bugzilla.gnome.org/buglist.cgi?product=libxslt">Gnome
-bug tracking database</a> (make sure to use the "libxslt" module name). I
+bug tracking database</a> (make sure to use the "libxslt" module name). I
look at reports there regularly and it's good to have a reminder when a bug
is still open. Be sure to specify that the bug is for the package libxslt.</p><p>For small problems you can try to get help on IRC, the #xml channel on
irc.gnome.org (port 6667) usually have a few person subscribed which may help
answer a given question, ask on the list.</p><p>To <span style="color: #E50000">be really clear about support</span>:</p><ul><li>Support or help <span style="color: #E50000">request MUST be sent to
the list or on bugzilla</span> in case of problems, so that the Question
and Answers can be shared publicly. Failing to do so carries the implicit
- message "I want free support but I don't want to share the benefits with
- others" and is not welcome. I will automatically Carbon-Copy the
+ message "I want free support but I don't want to share the benefits with
+ others" and is not welcome. I will automatically Carbon-Copy the
xslt@gnome.org mailing list for any technical reply made about libxml2 or
libxslt.</li>
<li>There is <span style="color: #E50000">no garantee for support</span>,
if your question remains unanswered after a week, repost it, making sure
you gave all the detail needed and the informations requested.</li>
<li>Failing to provide informations as requested or double checking first
- for prior feedback also carries the implicit message "the time of the
- library maintainers is less valuable than my time" and might not be
+ for prior feedback also carries the implicit message "the time of the
+ library maintainers is less valuable than my time" and might not be
welcome.</li>
</ul><p>Of course, bugs reports with a suggested patch for fixing them will
probably be processed faster.</p><p>If you're looking for help, a quick look at <a href="http://mail.gnome.org/archives/xslt/">the list archive</a> may actually
</ul><p>In both cases the extensions need to be associated to a new namespace,
i.e. an URI used as the name for the extension's namespace (there is no need
to have a resource there for this to work).</p><p>libxslt provides a few extensions itself, either in libxslt namespace
-"http://xmlsoft.org/XSLT/" or in other namespace for well known extensions
+"http://xmlsoft.org/XSLT/" or in other namespace for well known extensions
provided by other XSLT processors like Saxon, Xalan or XT.</p><h3><a name="Keep" id="Keep">Extension modules</a></h3><p>Since extensions are bound to a namespace name, usually sets of extensions
coming from a given source are using the same namespace name defining in
practice a group of extensions providing elements, functions or both. From
-libxslt point of view those are considered as an "extension module", and most
+libxslt point of view those are considered as an "extension module", and most
of the APIs work at a module point of view.</p><p>Registration of new functions or elements are bound to the activation of
the module, this is currently done by declaring the namespace as an extension
by using the attribute <code>extension-element-prefixes</code> on the
tctxt = xsltXPathGetTransformContext(ctxt);
if (tctxt == NULL) {
xsltGenericError(xsltGenericErrorContext,
- "xsltExtFunctionTest: failed to get the transformation context\n");
+ "xsltExtFunctionTest: failed to get the transformation context\n");
return;
}
data = xsltGetExtData(tctxt, (const xmlChar *) XSLT_DEFAULT_URL);
if (data == NULL) {
xsltGenericError(xsltGenericErrorContext,
- "xsltExtFunctionTest: failed to get module data\n");
+ "xsltExtFunctionTest: failed to get module data\n");
return;
}
#ifdef WITH_XSLT_DEBUG_FUNCTION
xsltGenericDebug(xsltGenericDebugContext,
- "libxslt:test() called with %d args\n", nargs);
+ "libxslt:test() called with %d args\n", nargs);
#endif
}</pre><h3><a name="Registerin2" id="Registerin2">Registering an extension element</a></h3><p>There is a single call to do this registration:</p><pre>int xsltRegisterExtElement(xsltTransformContextPtr ctxt,
const xmlChar *name,
if (ctxt == NULL) {
xsltGenericError(xsltGenericErrorContext,
- "xsltExtElementTest: no transformation context\n");
+ "xsltExtElementTest: no transformation context\n");
return;
}
if (node == NULL) {
xsltGenericError(xsltGenericErrorContext,
- "xsltExtElementTest: no current node\n");
+ "xsltExtElementTest: no current node\n");
return;
}
if (inst == NULL) {
xsltGenericError(xsltGenericErrorContext,
- "xsltExtElementTest: no instruction\n");
+ "xsltExtElementTest: no instruction\n");
return;
}
if (ctxt->insert == NULL) {
xsltGenericError(xsltGenericErrorContext,
- "xsltExtElementTest: no insertion point\n");
+ "xsltExtElementTest: no insertion point\n");
return;
}
comment =
xmlNewComment((const xmlChar *)
- "libxslt:test element test worked");
+ "libxslt:test element test worked");
xmlAddChild(ctxt->insert, comment);
}</pre><h3><a name="shutdown" id="shutdown">The shutdown of a module</a></h3><p>When the XSLT processor ends a transformation, the shutdown function (if
it exists) of all the modules initialized are called.The
</pre><p>Free up the memory used by attribute sets</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>style</tt></i>:</span></td><td>an XSLT stylesheet</td></tr></tbody></table></div><h3><a name="xsltParseStylesheetAttributeSet" id="xsltParseStylesheetAttributeSet"></a>Function: xsltParseStylesheetAttributeSet</h3><pre class="programlisting">void xsltParseStylesheetAttributeSet (<a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style, <br /> xmlNodePtr cur)<br />
</pre><p>parse an XSLT stylesheet attribute-set element</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>style</tt></i>:</span></td><td>the XSLT stylesheet</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the "attribute-set" element</td></tr></tbody></table></div><h3><a name="xsltResolveStylesheetAttributeSet" id="xsltResolveStylesheetAttributeSet"></a>Function: xsltResolveStylesheetAttributeSet</h3><pre class="programlisting">void xsltResolveStylesheetAttributeSet (<a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>style</tt></i>:</span></td><td>the XSLT stylesheet</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the "attribute-set" element</td></tr></tbody></table></div><h3><a name="xsltResolveStylesheetAttributeSet" id="xsltResolveStylesheetAttributeSet"></a>Function: xsltResolveStylesheetAttributeSet</h3><pre class="programlisting">void xsltResolveStylesheetAttributeSet (<a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style)<br />
</pre><p>resolve the references between attribute sets.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>style</tt></i>:</span></td><td>the XSLT stylesheet</td></tr></tbody></table></div><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
</style><style type="text/css">
div.deprecated pre.programlisting {border-style: double;border-color:red}
pre.programlisting {border-style: double}
- </style><title>Module preproc from libxslt</title></head><body bgcolor="#8b7765" text="#000000" link="#000000" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="../epatents.png" alt="Action against software patents" /></a></td><td width="100"><a href="http://www.gnome.org/"><img src="../gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.redhat.com"><img src="../redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/XSLT/"><img src="../Libxslt-Logo-180x168.gif" alt="Made with Libxslt Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1></h1><h2>Module preproc from libxslt</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a style="font-weight:bold" href="../index.html">Main Menu</a></li><li><a style="font-weight:bold" href="../docs.html">Developer Menu</a></li><li><a style="font-weight:bold" href="index.html">API Menu</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Indexes</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="../APIchunk0.html">Alphabetic</a></li><li><a href="../APIconstructors.html">Constructors</a></li><li><a href="../APIfunctions.html">Functions/Types</a></li><li><a href="../APIfiles.html">Modules</a></li><li><a href="../APIsymbols.html">Symbols</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xslt/">Mail archive</a></li><li><a href="http://xmlsoft.org/">XML libxml</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://garypennington.net/libxml2/">Solaris binaries</a></li><li><a href="http://www.zveno.com/open_source/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://bugzilla.gnome.org/buglist.cgi?product=libxslt">Bug Tracker</a></li><li><a href="http://xsldbg.sourceforge.net/">Xsldbg Debugger</a></li><li><a href="http://www.mod-xslt.com/mod-xslt/">Apache module</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libxslt-pattern.html"><img src="left.png" width="24" height="24" border="0" alt="Prev" /></a></td><th align="left"><a href="libxslt-pattern.html">pattern</a></th><td><a accesskey="u" href="index.html"><img src="up.png" width="24" height="24" border="0" alt="Up" /></a></td><th align="left"><a href="index.html">API documentation</a></th><td><a accesskey="h" href="../index.html"><img src="home.png" width="24" height="24" border="0" alt="Home" /></a></td><th align="center"><a href="../index.html">Home</a></th><th align="right"><a href="libxslt-security.html">security</a></th><td><a accesskey="n" href="libxslt-security.html"><img src="right.png" width="24" height="24" border="0" alt="Next" /></a></td></tr></table><p>this is the compilation phase, where most of the stylesheet is "compiled" into faster to use data. </p><h2>Table of Contents</h2><pre class="programlisting"><a href="libxslt-xsltInternals.html#xsltElemPreCompPtr">xsltElemPreCompPtr</a> <a href="#xsltDocumentComp">xsltDocumentComp</a> (<a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style, <br /> xmlNodePtr inst, <br /> <a href="libxslt-xsltInternals.html#xsltTransformFunction">xsltTransformFunction</a> function)</pre>
+ </style><title>Module preproc from libxslt</title></head><body bgcolor="#8b7765" text="#000000" link="#000000" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="../epatents.png" alt="Action against software patents" /></a></td><td width="100"><a href="http://www.gnome.org/"><img src="../gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.redhat.com"><img src="../redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/XSLT/"><img src="../Libxslt-Logo-180x168.gif" alt="Made with Libxslt Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1></h1><h2>Module preproc from libxslt</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a style="font-weight:bold" href="../index.html">Main Menu</a></li><li><a style="font-weight:bold" href="../docs.html">Developer Menu</a></li><li><a style="font-weight:bold" href="index.html">API Menu</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Indexes</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="../APIchunk0.html">Alphabetic</a></li><li><a href="../APIconstructors.html">Constructors</a></li><li><a href="../APIfunctions.html">Functions/Types</a></li><li><a href="../APIfiles.html">Modules</a></li><li><a href="../APIsymbols.html">Symbols</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xslt/">Mail archive</a></li><li><a href="http://xmlsoft.org/">XML libxml</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://garypennington.net/libxml2/">Solaris binaries</a></li><li><a href="http://www.zveno.com/open_source/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://bugzilla.gnome.org/buglist.cgi?product=libxslt">Bug Tracker</a></li><li><a href="http://xsldbg.sourceforge.net/">Xsldbg Debugger</a></li><li><a href="http://www.mod-xslt.com/mod-xslt/">Apache module</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libxslt-pattern.html"><img src="left.png" width="24" height="24" border="0" alt="Prev" /></a></td><th align="left"><a href="libxslt-pattern.html">pattern</a></th><td><a accesskey="u" href="index.html"><img src="up.png" width="24" height="24" border="0" alt="Up" /></a></td><th align="left"><a href="index.html">API documentation</a></th><td><a accesskey="h" href="../index.html"><img src="home.png" width="24" height="24" border="0" alt="Home" /></a></td><th align="center"><a href="../index.html">Home</a></th><th align="right"><a href="libxslt-security.html">security</a></th><td><a accesskey="n" href="libxslt-security.html"><img src="right.png" width="24" height="24" border="0" alt="Next" /></a></td></tr></table><p>this is the compilation phase, where most of the stylesheet is "compiled" into faster to use data. </p><h2>Table of Contents</h2><pre class="programlisting"><a href="libxslt-xsltInternals.html#xsltElemPreCompPtr">xsltElemPreCompPtr</a> <a href="#xsltDocumentComp">xsltDocumentComp</a> (<a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style, <br /> xmlNodePtr inst, <br /> <a href="libxslt-xsltInternals.html#xsltTransformFunction">xsltTransformFunction</a> function)</pre>
<pre class="programlisting">void <a href="#xsltFreeStylePreComps">xsltFreeStylePreComps</a> (<a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style)</pre>
<pre class="programlisting">void <a href="#xsltStylePreCompute">xsltStylePreCompute</a> (<a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style, <br /> xmlNodePtr inst)</pre>
<h2>Description</h2>
</pre><p>Free up the data associated to the global variables its value.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the XSLT transformation context</td></tr></tbody></table></div><h3><a name="xsltParseGlobalParam" id="xsltParseGlobalParam"></a>Function: xsltParseGlobalParam</h3><pre class="programlisting">void xsltParseGlobalParam (<a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style, <br /> xmlNodePtr cur)<br />
</pre><p>parse an XSLT transformation param declaration and record its value.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>style</tt></i>:</span></td><td>the XSLT stylesheet</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the "param" element</td></tr></tbody></table></div><h3><a name="xsltParseGlobalVariable" id="xsltParseGlobalVariable"></a>Function: xsltParseGlobalVariable</h3><pre class="programlisting">void xsltParseGlobalVariable (<a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style, <br /> xmlNodePtr cur)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>style</tt></i>:</span></td><td>the XSLT stylesheet</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the "param" element</td></tr></tbody></table></div><h3><a name="xsltParseGlobalVariable" id="xsltParseGlobalVariable"></a>Function: xsltParseGlobalVariable</h3><pre class="programlisting">void xsltParseGlobalVariable (<a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style, <br /> xmlNodePtr cur)<br />
</pre><p>parse an XSLT transformation variable declaration and record its value.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>style</tt></i>:</span></td><td>the XSLT stylesheet</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the "variable" element</td></tr></tbody></table></div><h3><a name="xsltParseStylesheetCallerParam" id="xsltParseStylesheetCallerParam"></a>Function: xsltParseStylesheetCallerParam</h3><pre class="programlisting"><a href="libxslt-xsltInternals.html#xsltStackElemPtr">xsltStackElemPtr</a> xsltParseStylesheetCallerParam (<a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> ctxt, <br /> xmlNodePtr cur)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>style</tt></i>:</span></td><td>the XSLT stylesheet</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the "variable" element</td></tr></tbody></table></div><h3><a name="xsltParseStylesheetCallerParam" id="xsltParseStylesheetCallerParam"></a>Function: xsltParseStylesheetCallerParam</h3><pre class="programlisting"><a href="libxslt-xsltInternals.html#xsltStackElemPtr">xsltStackElemPtr</a> xsltParseStylesheetCallerParam (<a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> ctxt, <br /> xmlNodePtr cur)<br />
</pre><p>parse an XSLT transformation param declaration, compute its value but doesn't record it.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the XSLT transformation context</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the "param" element</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the new <a href="libxslt-xsltInternals.html#xsltStackElemPtr">xsltStackElemPtr</a> or NULL</td></tr></tbody></table></div><h3><a name="xsltParseStylesheetParam" id="xsltParseStylesheetParam"></a>Function: xsltParseStylesheetParam</h3><pre class="programlisting">void xsltParseStylesheetParam (<a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> ctxt, <br /> xmlNodePtr cur)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the XSLT transformation context</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the "param" element</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the new <a href="libxslt-xsltInternals.html#xsltStackElemPtr">xsltStackElemPtr</a> or NULL</td></tr></tbody></table></div><h3><a name="xsltParseStylesheetParam" id="xsltParseStylesheetParam"></a>Function: xsltParseStylesheetParam</h3><pre class="programlisting">void xsltParseStylesheetParam (<a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> ctxt, <br /> xmlNodePtr cur)<br />
</pre><p>parse an XSLT transformation param declaration and record its value.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the XSLT transformation context</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the "param" element</td></tr></tbody></table></div><h3><a name="xsltParseStylesheetVariable" id="xsltParseStylesheetVariable"></a>Function: xsltParseStylesheetVariable</h3><pre class="programlisting">void xsltParseStylesheetVariable (<a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> ctxt, <br /> xmlNodePtr cur)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the XSLT transformation context</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the "param" element</td></tr></tbody></table></div><h3><a name="xsltParseStylesheetVariable" id="xsltParseStylesheetVariable"></a>Function: xsltParseStylesheetVariable</h3><pre class="programlisting">void xsltParseStylesheetVariable (<a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> ctxt, <br /> xmlNodePtr cur)<br />
</pre><p>parse an XSLT transformation variable declaration and record its value.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the XSLT transformation context</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the "variable" element</td></tr></tbody></table></div><h3><a name="xsltQuoteOneUserParam" id="xsltQuoteOneUserParam"></a>Function: xsltQuoteOneUserParam</h3><pre class="programlisting">int xsltQuoteOneUserParam (<a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> ctxt, <br /> const xmlChar * name, <br /> const xmlChar * value)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the XSLT transformation context</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the "variable" element</td></tr></tbody></table></div><h3><a name="xsltQuoteOneUserParam" id="xsltQuoteOneUserParam"></a>Function: xsltQuoteOneUserParam</h3><pre class="programlisting">int xsltQuoteOneUserParam (<a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> ctxt, <br /> const xmlChar * name, <br /> const xmlChar * value)<br />
</pre><p>This is normally called from <a href="libxslt-variables.html#xsltQuoteUserParams">xsltQuoteUserParams</a> to process a single parameter from a list of parameters. The @value is stored in the context's global variable/parameter hash table.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the XSLT transformation context</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>a null terminated string giving the name of the parameter</td></tr><tr><td><span class="term"><i><tt>value</tt></i>:</span></td><td>a null terminated string giving the parameter value</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of error.</td></tr></tbody></table></div><h3><a name="xsltQuoteUserParams" id="xsltQuoteUserParams"></a>Function: xsltQuoteUserParams</h3><pre class="programlisting">int xsltQuoteUserParams (<a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> ctxt, <br /> const char ** params)<br />
</pre><p>Similar to xsltEvalUserParams, but the values are treated literally and are * *not* evaluated as XPath expressions. This should be done on parsed stylesheets before starting to apply transformations.</p>
pre.programlisting {border-style: double}
</style><title>Module xslt from libxslt</title></head><body bgcolor="#8b7765" text="#000000" link="#000000" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="../epatents.png" alt="Action against software patents" /></a></td><td width="100"><a href="http://www.gnome.org/"><img src="../gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.redhat.com"><img src="../redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/XSLT/"><img src="../Libxslt-Logo-180x168.gif" alt="Made with Libxslt Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1></h1><h2>Module xslt from libxslt</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a style="font-weight:bold" href="../index.html">Main Menu</a></li><li><a style="font-weight:bold" href="../docs.html">Developer Menu</a></li><li><a style="font-weight:bold" href="index.html">API Menu</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Indexes</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="../APIchunk0.html">Alphabetic</a></li><li><a href="../APIconstructors.html">Constructors</a></li><li><a href="../APIfunctions.html">Functions/Types</a></li><li><a href="../APIfiles.html">Modules</a></li><li><a href="../APIsymbols.html">Symbols</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xslt/">Mail archive</a></li><li><a href="http://xmlsoft.org/">XML libxml</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://garypennington.net/libxml2/">Solaris binaries</a></li><li><a href="http://www.zveno.com/open_source/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://bugzilla.gnome.org/buglist.cgi?product=libxslt">Bug Tracker</a></li><li><a href="http://xsldbg.sourceforge.net/">Xsldbg Debugger</a></li><li><a href="http://www.mod-xslt.com/mod-xslt/">Apache module</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libxslt-variables.html"><img src="left.png" width="24" height="24" border="0" alt="Prev" /></a></td><th align="left"><a href="libxslt-variables.html">variables</a></th><td><a accesskey="u" href="index.html"><img src="up.png" width="24" height="24" border="0" alt="Up" /></a></td><th align="left"><a href="index.html">API documentation</a></th><td><a accesskey="h" href="../index.html"><img src="home.png" width="24" height="24" border="0" alt="Home" /></a></td><th align="center"><a href="../index.html">Home</a></th><th align="right"><a href="libxslt-xsltInternals.html">xsltInternals</a></th><td><a accesskey="n" href="libxslt-xsltInternals.html"><img src="right.png" width="24" height="24" border="0" alt="Next" /></a></td></tr></table><p>Interfaces, constants and types related to the XSLT engine </p><h2>Table of Contents</h2><pre class="programlisting">#define <a href="#XSLT_DEFAULT_URL">XSLT_DEFAULT_URL</a></pre><pre class="programlisting">#define <a href="#XSLT_DEFAULT_VENDOR">XSLT_DEFAULT_VENDOR</a></pre><pre class="programlisting">#define <a href="#XSLT_DEFAULT_VERSION">XSLT_DEFAULT_VERSION</a></pre><pre class="programlisting">#define <a href="#XSLT_NAMESPACE">XSLT_NAMESPACE</a></pre><pre class="programlisting">#define <a href="#XSLT_PARSE_OPTIONS">XSLT_PARSE_OPTIONS</a></pre><pre class="programlisting">void <a href="#xsltCleanupGlobals">xsltCleanupGlobals</a> (void)</pre>
<h2>Description</h2>
-<h3><a name="XSLT_DEFAULT_URL" id="XSLT_DEFAULT_URL"></a>Macro: XSLT_DEFAULT_URL</h3><pre>#define XSLT_DEFAULT_URL</pre><p>The XSLT "vendor" URL for this processor.</p>
-<h3><a name="XSLT_DEFAULT_VENDOR" id="XSLT_DEFAULT_VENDOR"></a>Macro: XSLT_DEFAULT_VENDOR</h3><pre>#define XSLT_DEFAULT_VENDOR</pre><p>The XSLT "vendor" string for this processor.</p>
+<h3><a name="XSLT_DEFAULT_URL" id="XSLT_DEFAULT_URL"></a>Macro: XSLT_DEFAULT_URL</h3><pre>#define XSLT_DEFAULT_URL</pre><p>The XSLT "vendor" URL for this processor.</p>
+<h3><a name="XSLT_DEFAULT_VENDOR" id="XSLT_DEFAULT_VENDOR"></a>Macro: XSLT_DEFAULT_VENDOR</h3><pre>#define XSLT_DEFAULT_VENDOR</pre><p>The XSLT "vendor" string for this processor.</p>
<h3><a name="XSLT_DEFAULT_VERSION" id="XSLT_DEFAULT_VERSION"></a>Macro: XSLT_DEFAULT_VERSION</h3><pre>#define XSLT_DEFAULT_VERSION</pre><p>The default version of XSLT supported.</p>
<h3><a name="XSLT_NAMESPACE" id="XSLT_NAMESPACE"></a>Macro: XSLT_NAMESPACE</h3><pre>#define XSLT_NAMESPACE</pre><p>The XSLT specification namespace.</p>
<h3><a name="XSLT_PARSE_OPTIONS" id="XSLT_PARSE_OPTIONS"></a>Macro: XSLT_PARSE_OPTIONS</h3><pre>#define XSLT_PARSE_OPTIONS</pre><p>The set of options to pass to an xmlReadxxx when loading files for XSLT consumption.</p>
xmlChar * encoding : encoding string
int omitXmlDeclaration : * Number formatting. *
<a href="libxslt-xsltInternals.html#xsltDecimalFormatPtr">xsltDecimalFormatPtr</a> decimalFormat
- int standalone : standalone = "yes" | "no"
+ int standalone : standalone = "yes" | "no"
xmlChar * doctypePublic : doctype-public string
xmlChar * doctypeSystem : doctype-system string
int indent : should output being indented
unsigned int lasttuse : * Per Context Debugging *
int debugStatus : the context level debug status
unsigned long * traceCode : pointer to the variable holding the mas
+ int parserOptions : parser options xmlParserOption
}</pre><h3>Enum <a name="xsltTransformState" id="xsltTransformState">xsltTransformState</a></h3><pre class="programlisting">Enum xsltTransformState {
<a name="XSLT_STATE_OK" id="XSLT_STATE_OK">XSLT_STATE_OK</a> = 0
<a name="XSLT_STATE_ERROR" id="XSLT_STATE_ERROR">XSLT_STATE_ERROR</a> = 1
</pre><p>parse an XSLT stylesheet building the associated structures except the processing not needed for imported documents.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>an xmlDoc parsed XML</td></tr><tr><td><span class="term"><i><tt>style</tt></i>:</span></td><td>pointer to parent stylesheet</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new XSLT stylesheet structure.</td></tr></tbody></table></div><h3><a name="xsltParseStylesheetOutput" id="xsltParseStylesheetOutput"></a>Function: xsltParseStylesheetOutput</h3><pre class="programlisting">void xsltParseStylesheetOutput (<a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style, <br /> xmlNodePtr cur)<br />
</pre><p>parse an XSLT stylesheet output element and record information related to the stylesheet output</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>style</tt></i>:</span></td><td>the XSLT stylesheet</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the "output" element</td></tr></tbody></table></div><h3><a name="xsltParseStylesheetProcess" id="xsltParseStylesheetProcess"></a>Function: xsltParseStylesheetProcess</h3><pre class="programlisting"><a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> xsltParseStylesheetProcess (<a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> ret, <br /> xmlDocPtr doc)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>style</tt></i>:</span></td><td>the XSLT stylesheet</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the "output" element</td></tr></tbody></table></div><h3><a name="xsltParseStylesheetProcess" id="xsltParseStylesheetProcess"></a>Function: xsltParseStylesheetProcess</h3><pre class="programlisting"><a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> xsltParseStylesheetProcess (<a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> ret, <br /> xmlDocPtr doc)<br />
</pre><p>parse an XSLT stylesheet adding the associated structures</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ret</tt></i>:</span></td><td>the XSLT stylesheet</td></tr><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>and xmlDoc parsed XML</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the value of the 'ret' parameter if everything went right, NULL if something went amiss.</td></tr></tbody></table></div><h3><a name="xsltParseTemplateContent" id="xsltParseTemplateContent"></a>Function: xsltParseTemplateContent</h3><pre class="programlisting">void xsltParseTemplateContent (<a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style, <br /> xmlNodePtr templ)<br />
</pre><p>parse a template content-model Clean-up the template content from unwanted ignorable blank nodes and process xslt:text</p>
<pre class="programlisting">int <a href="#xsltSaveResultToFile">xsltSaveResultToFile</a> (FILE * file, <br /> xmlDocPtr result, <br /> <a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style)</pre>
<pre class="programlisting">int <a href="#xsltSaveResultToFilename">xsltSaveResultToFilename</a> (const char * URL, <br /> xmlDocPtr result, <br /> <a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style, <br /> int compression)</pre>
<pre class="programlisting">int <a href="#xsltSaveResultToString">xsltSaveResultToString</a> (xmlChar ** doc_txt_ptr, <br /> int * doc_txt_len, <br /> xmlDocPtr result, <br /> <a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style)</pre>
+<pre class="programlisting">int <a href="#xsltSetCtxtParseOptions">xsltSetCtxtParseOptions</a> (<a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> ctxt, <br /> int options)</pre>
<pre class="programlisting">void <a href="#xsltSetCtxtSortFunc">xsltSetCtxtSortFunc</a> (<a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> ctxt, <br /> <a href="libxslt-xsltInternals.html#xsltSortFunc">xsltSortFunc</a> handler)</pre>
<pre class="programlisting">int <a href="#xsltSetDebuggerCallbacks">xsltSetDebuggerCallbacks</a> (int no, <br /> void * block)</pre>
<pre class="programlisting">void <a href="#xsltSetDebuggerStatus">xsltSetDebuggerStatus</a> (int value)</pre>
<a name="XSLT_TRACE_VARIABLES" id="XSLT_TRACE_VARIABLES">XSLT_TRACE_VARIABLES</a> = 65536
}
</pre><h3><a name="xslAddCall" id="xslAddCall"></a>Function: xslAddCall</h3><pre class="programlisting">int xslAddCall (<a href="libxslt-xsltInternals.html#xsltTemplatePtr">xsltTemplatePtr</a> templ, <br /> xmlNodePtr source)<br />
-</pre><p>Add template "call" to call stack</p>
+</pre><p>Add template "call" to call stack</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>templ</tt></i>:</span></td><td>current template being applied</td></tr><tr><td><span class="term"><i><tt>source</tt></i>:</span></td><td>the source node being processed</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>: 1 on sucess 0 otherwise an error may be printed if WITH_XSLT_DEBUG_BREAKPOINTS is defined</td></tr></tbody></table></div><h3><a name="xslDropCall" id="xslDropCall"></a>Function: xslDropCall</h3><pre class="programlisting">void xslDropCall (void)<br />
</pre><p>Drop the topmost item off the call stack</p>
<h3><a name="xsltAddCallCallback" id="xsltAddCallCallback"></a>Function type: xsltAddCallCallback</h3><pre class="programlisting">Function type: xsltAddCallCallback
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the value of xslDebugStatus.</td></tr></tbody></table></div><h3><a name="xsltGetNsProp" id="xsltGetNsProp"></a>Function: xsltGetNsProp</h3><pre class="programlisting">xmlChar * xsltGetNsProp (xmlNodePtr node, <br /> const xmlChar * name, <br /> const xmlChar * nameSpace)<br />
</pre><p>Similar to xmlGetNsProp() but with a slightly different semantic Search and get the value of an attribute associated to a node This attribute has to be anchored in the namespace specified, or has no namespace and the element is in that namespace. This does the entity substitution. This function looks in DTD attribute declaration for #FIXED or default declaration values unless DTD use has been turned off.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>the node</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>the attribute name</td></tr><tr><td><span class="term"><i><tt>nameSpace</tt></i>:</span></td><td>the URI of the namespace</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the attribute value or NULL if not found. It's up to the caller to free the memory.</td></tr></tbody></table></div><h3><a name="xsltGetProfileInformation" id="xsltGetProfileInformation"></a>Function: xsltGetProfileInformation</h3><pre class="programlisting">xmlDocPtr xsltGetProfileInformation (<a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> ctxt)<br />
-</pre><p>This function should be called after the transformation completed to extract template processing profiling informations if availble. The informations are returned as an XML document tree like <?xml version="1.0"?> <profile> <template rank="1" match="*" name="" mode="" calls="6" time="48" average="8"/> <template rank="2" match="item2|item3" name="" mode="" calls="10" time="30" average="3"/> <template rank="3" match="item1" name="" mode="" calls="5" time="17" average="3"/> </profile> The caller will need to free up the returned tree with xmlFreeDoc()</p>
+</pre><p>This function should be called after the transformation completed to extract template processing profiling informations if availble. The informations are returned as an XML document tree like <?xml version="1.0"?> <profile> <template rank="1" match="*" name="" mode="" calls="6" time="48" average="8"/> <template rank="2" match="item2|item3" name="" mode="" calls="10" time="30" average="3"/> <template rank="3" match="item1" name="" mode="" calls="5" time="17" average="3"/> </profile> The caller will need to free up the returned tree with xmlFreeDoc()</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a transformation context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the xmlDocPtr corresponding to the result or NULL if not available.</td></tr></tbody></table></div><h3><a name="xsltGetQNameURI" id="xsltGetQNameURI"></a>Function: xsltGetQNameURI</h3><pre class="programlisting">const xmlChar * xsltGetQNameURI (xmlNodePtr node, <br /> xmlChar ** name)<br />
</pre><p>This function analyzes @name, if the name contains a prefix, the function seaches the associated namespace in scope for it. It will also replace @name value with the NCName, the old value being freed. Errors in the prefix lookup are signalled by setting @name to NULL. NOTE: the namespace returned is a pointer to the place where it is defined and hence has the same lifespan as the document holding it.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>the node holding the QName</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>pointer to the initial QName value</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the namespace URI if there is a prefix, or NULL if @name is not prefixed.</td></tr></tbody></table></div><h3><a name="xsltGetUTF8Char" id="xsltGetUTF8Char"></a>Function: xsltGetUTF8Char</h3><pre class="programlisting">int xsltGetUTF8Char (const unsigned char * utf, <br /> int * len)<br />
</pre><p>Save the result @result obtained by applying the @style stylesheet to a file or @URL</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>a filename or URL</td></tr><tr><td><span class="term"><i><tt>result</tt></i>:</span></td><td>the result xmlDocPtr</td></tr><tr><td><span class="term"><i><tt>style</tt></i>:</span></td><td>the stylesheet</td></tr><tr><td><span class="term"><i><tt>compression</tt></i>:</span></td><td>the compression factor (0 - 9 included)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of byte written or -1 in case of failure.</td></tr></tbody></table></div><h3><a name="xsltSaveResultToString" id="xsltSaveResultToString"></a>Function: xsltSaveResultToString</h3><pre class="programlisting">int xsltSaveResultToString (xmlChar ** doc_txt_ptr, <br /> int * doc_txt_len, <br /> xmlDocPtr result, <br /> <a href="libxslt-xsltInternals.html#xsltStylesheetPtr">xsltStylesheetPtr</a> style)<br />
</pre><p>Save the result @result obtained by applying the @style stylesheet to a file or @URL</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc_txt_ptr</tt></i>:</span></td><td>Memory pointer for allocated XML text</td></tr><tr><td><span class="term"><i><tt>doc_txt_len</tt></i>:</span></td><td>Length of the generated XML text</td></tr><tr><td><span class="term"><i><tt>result</tt></i>:</span></td><td>the result xmlDocPtr</td></tr><tr><td><span class="term"><i><tt>style</tt></i>:</span></td><td>the stylesheet</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of byte written or -1 in case of failure.</td></tr></tbody></table></div><h3><a name="xsltSetCtxtSortFunc" id="xsltSetCtxtSortFunc"></a>Function: xsltSetCtxtSortFunc</h3><pre class="programlisting">void xsltSetCtxtSortFunc (<a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> ctxt, <br /> <a href="libxslt-xsltInternals.html#xsltSortFunc">xsltSortFunc</a> handler)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc_txt_ptr</tt></i>:</span></td><td>Memory pointer for allocated XML text</td></tr><tr><td><span class="term"><i><tt>doc_txt_len</tt></i>:</span></td><td>Length of the generated XML text</td></tr><tr><td><span class="term"><i><tt>result</tt></i>:</span></td><td>the result xmlDocPtr</td></tr><tr><td><span class="term"><i><tt>style</tt></i>:</span></td><td>the stylesheet</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of byte written or -1 in case of failure.</td></tr></tbody></table></div><h3><a name="xsltSetCtxtParseOptions" id="xsltSetCtxtParseOptions"></a>Function: xsltSetCtxtParseOptions</h3><pre class="programlisting">int xsltSetCtxtParseOptions (<a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> ctxt, <br /> int options)<br />
+</pre><p>Change the default parser option passed by the XSLT engine to the parser when using document() loading.</p>
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a XSLT process context</td></tr><tr><td><span class="term"><i><tt>options</tt></i>:</span></td><td>a combination of libxml2 xmlParserOption</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the previous options or -1 in case of error</td></tr></tbody></table></div><h3><a name="xsltSetCtxtSortFunc" id="xsltSetCtxtSortFunc"></a>Function: xsltSetCtxtSortFunc</h3><pre class="programlisting">void xsltSetCtxtSortFunc (<a href="libxslt-xsltInternals.html#xsltTransformContextPtr">xsltTransformContextPtr</a> ctxt, <br /> <a href="libxslt-xsltInternals.html#xsltSortFunc">xsltSortFunc</a> handler)<br />
</pre><p>Function to set the handler for XSLT sorting for the specified context. If the handler is NULL, then the global sort function will be called</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a XSLT process context</td></tr><tr><td><span class="term"><i><tt>handler</tt></i>:</span></td><td>the new handler function</td></tr></tbody></table></div><h3><a name="xsltSetDebuggerCallbacks" id="xsltSetDebuggerCallbacks"></a>Function: xsltSetDebuggerCallbacks</h3><pre class="programlisting">int xsltSetDebuggerCallbacks (int no, <br /> void * block)<br />
</pre><p>This function allow to plug a debugger into the XSLT library @block points to a block of memory containing the address of @no callback routines.</p>
<li>text nodes</li>
</ul><p>For the XSLT processing, entity nodes should not be generated (i.e. they
should be replaced by their content). Most nodes also contains the following
-"navigation" informations:</p><ul><li>the containing <strong>doc</strong>ument</li>
+"navigation" informations:</p><ul><li>the containing <strong>doc</strong>ument</li>
<li>the <strong>parent</strong> node</li>
<li>the first <strong>children</strong> node</li>
<li>the <strong>last</strong> children node</li>
<li>the input tree 4/ is not modified except the _private field which may
be used for labelling keys if used by the stylesheet</li>
</ul><h3><a name="XSLT1" id="XSLT1">The XSLT stylesheet compilation</a></h3><p>This is the second step described. It takes a stylesheet tree, and
-"compiles" it. This associates to each node a structure stored in the
+"compiles" it. This associates to each node a structure stored in the
_private field and containing information computed in the stylesheet:</p><p align="center"><img src="stylesheet.gif" alt="a compiled XSLT stylesheet" /></p><p>One xsltStylesheet structure is generated per document parsed for the
stylesheet. XSLT documents allow includes and imports of other documents,
imports are stored in the <strong>imports</strong> list (hence keeping the
structures for the templates:</p><p align="center"><img src="templates.gif" alt="The templates related structure" /></p><p>Let's describe a bit more closely what is built. First the xsltStylesheet
structure holds a pointer to the template hash table. All the XSLT patterns
compiled in this stylesheet are indexed by the value of the the target
-element (or attribute, pi ...) name, so when a element or an attribute "foo"
+element (or attribute, pi ...) name, so when a element or an attribute "foo"
needs to be processed the lookup is done using the name as a key.</p><p>Each of the patterns is compiled into an xsltCompMatch structure. It holds
the set of rules based on the tokenization of the pattern stored in reverse
order (matching is easier this way). It also holds some information about the
Predicate expressions are not compiled at this stage, they may be at run-time
if needed, but in this case they are compiled as full XPath expressions (the
use of some fixed predicate can probably be optimized, they are not yet).</p><p>The xsltCompMatch are then stored in the hash table, the clash list is
-itself sorted by priority of the template to implement "naturally" the XSLT
+itself sorted by priority of the template to implement "naturally" the XSLT
priority rules.</p><p>Associated to the compiled pattern is the xsltTemplate itself containing
the information required for the processing of the pattern including, of
course, a pointer to the list of elements used for building the pattern
<exports symbol='xsltSetGenericErrorFunc' type='function'/>
<exports symbol='xsltSetDebuggerCallbacks' type='function'/>
<exports symbol='xsltCalibrateAdjust' type='function'/>
+ <exports symbol='xsltSetGenericDebugFunc' type='function'/>
<exports symbol='xsltDebugSetDefaultTrace' type='function'/>
<exports symbol='xsltDropCallCallback' type='function'/>
- <exports symbol='xsltSetGenericDebugFunc' type='function'/>
+ <exports symbol='xsltSetCtxtParseOptions' type='function'/>
<exports symbol='xsltComputeSortResult' type='function'/>
<exports symbol='xsltSetSortFunc' type='function'/>
<exports symbol='xsltDocumentSortFunction' type='function'/>
*'/>
<field name='debugStatus' type='int' info=' the context level debug status'/>
<field name='traceCode' type='unsigned long *' info=' pointer to the variable holding the mask'/>
+ <field name='parserOptions' type='int' info=' parser options xmlParserOption'/>
</struct>
<typedef name='xsltTransformContextPtr' file='xsltInternals' type='xsltTransformContext *'/>
<typedef name='xsltTransformState' file='xsltInternals' type='enum'/>
<arg name='ctxt' type='xsltTransformContextPtr' info='an XSLT transformation context'/>
<arg name='value' type='const char *' info='unused'/>
</function>
+ <function name='xsltSetCtxtParseOptions' file='xsltutils'>
+ <info>Change the default parser option passed by the XSLT engine to the parser when using document() loading.</info>
+ <return type='int' info='the previous options or -1 in case of error'/>
+ <arg name='ctxt' type='xsltTransformContextPtr' info='a XSLT process context'/>
+ <arg name='options' type='int' info='a combination of libxml2 xmlParserOption'/>
+ </function>
<function name='xsltSetCtxtSecurityPrefs' file='security'>
<info>Set the security preference for a specific transformation</info>
<return type='int' info='-1 in case of error, 0 otherwise'/>
<reference name='xsltSecurityOption' href='html/libxslt-security.html#xsltSecurityOption'/>
<reference name='xsltSecurityPrefs' href='html/libxslt-security.html#xsltSecurityPrefs'/>
<reference name='xsltSecurityPrefsPtr' href='html/libxslt-security.html#xsltSecurityPrefsPtr'/>
+ <reference name='xsltSetCtxtParseOptions' href='html/libxslt-xsltutils.html#xsltSetCtxtParseOptions'/>
<reference name='xsltSetCtxtSecurityPrefs' href='html/libxslt-security.html#xsltSetCtxtSecurityPrefs'/>
<reference name='xsltSetCtxtSortFunc' href='html/libxslt-xsltutils.html#xsltSetCtxtSortFunc'/>
<reference name='xsltSetDebuggerCallbacks' href='html/libxslt-xsltutils.html#xsltSetDebuggerCallbacks'/>
<ref name='xsltSecurityOption'/>
<ref name='xsltSecurityPrefs'/>
<ref name='xsltSecurityPrefsPtr'/>
+ <ref name='xsltSetCtxtParseOptions'/>
<ref name='xsltSetCtxtSecurityPrefs'/>
<ref name='xsltSetCtxtSortFunc'/>
<ref name='xsltSetDebuggerCallbacks'/>
<ref name='xsltStyleExtInitFunction'/>
</type>
<type name='xmlAttrPtr'>
- <ref name='xsltAttrTemplateProcess'/>
<ref name='xsltAttrListTemplateProcess'/>
+ <ref name='xsltAttrTemplateProcess'/>
</type>
<type name='xmlChar *'>
<ref name='xsltAttrTemplateValueProcess'/>
<ref name='xsltEvalAttrValueTemplate'/>
<ref name='xsltEvalTemplateString'/>
+ <ref name='xsltGetNsProp'/>
<ref name='xsltAttrTemplateValueProcessNode'/>
<ref name='xsltEvalXPathString'/>
<ref name='xsltEvalXPathStringNs'/>
- <ref name='xsltGetNsProp'/>
<ref name='xsltEvalStaticAttrValueTemplate'/>
</type>
<type name='xmlDocPtr'>
<ref name='xsltCreateRVT'/>
- <ref name='xsltApplyStylesheet'/>
<ref name='xsltProfileStylesheet'/>
<ref name='xsltApplyStylesheetUser'/>
+ <ref name='xsltApplyStylesheet'/>
<ref name='xsltGetProfileInformation'/>
</type>
<type name='xmlHashTablePtr'>
</type>
<type name='xmlNsPtr'>
<ref name='xsltCopyNamespace'/>
+ <ref name='xsltGetSpecialNamespace'/>
<ref name='xsltGetNamespace'/>
<ref name='xsltCopyNamespaceList'/>
- <ref name='xsltGetSpecialNamespace'/>
</type>
<type name='xmlXPathError'>
<ref name='xsltFormatNumberConversion'/>
</type>
<type name='xmlXPathFunction'>
<ref name='xsltExtFunctionLookup'/>
- <ref name='xsltExtModuleFunctionLookup'/>
<ref name='xsltXPathFunctionLookup'/>
+ <ref name='xsltExtModuleFunctionLookup'/>
</type>
<type name='xmlXPathObjectPtr'>
<ref name='xsltXPathVariableLookup'/>
<ref name='xsltGetSecurityPrefs'/>
</type>
<type name='xsltSecurityPrefsPtr'>
- <ref name='xsltNewSecurityPrefs'/>
<ref name='xsltGetDefaultSecurityPrefs'/>
+ <ref name='xsltNewSecurityPrefs'/>
</type>
<type name='xsltStackElemPtr'>
<ref name='xsltParseStylesheetCallerParam'/>
<ref name='xsltSecurityAllow'/>
<ref name='xsltSecurityCheck'/>
<ref name='xsltSecurityForbid'/>
+ <ref name='xsltSetCtxtParseOptions'/>
<ref name='xsltSetCtxtSecurityPrefs'/>
<ref name='xsltSetCtxtSortFunc'/>
<ref name='xsltSetTransformErrorFunc'/>
<ref name='xsltGetProfileInformation'/>
<ref name='XSLT_TRACE_IF'/>
<ref name='XSLT_TRACE_NONE'/>
+ <ref name='xsltSetCtxtParseOptions'/>
<ref name='xsltSetDebuggerStatus'/>
<ref name='XSLT_TRACE_TEMPLATES'/>
<ref name='xsltSetSortFunc'/>
<word name='CDTATA'>
<ref name='xsltFindElemSpaceHandling'/>
</word>
+ <word name='Change'>
+ <ref name='xsltSetCtxtParseOptions'/>
+ </word>
<word name='Char'>
<ref name='xsltGetUTF8Char'/>
</word>
<word name='com'>
<ref name='xsltFormatNumberConversion'/>
</word>
+ <word name='combination'>
+ <ref name='xsltSetCtxtParseOptions'/>
+ </word>
<word name='comment'>
<ref name='xsltComment'/>
</word>
<ref name='xsltGetXIncludeDefault'/>
<ref name='xsltRegisterAllElement'/>
<ref name='xsltRegisterAllFunctions'/>
+ <ref name='xsltSetCtxtParseOptions'/>
<ref name='xsltSetDefaultSecurityPrefs'/>
<ref name='xsltSetSortFunc'/>
<ref name='xsltSetXIncludeDefault'/>
<ref name='xsltRegisterPersistRVT'/>
<ref name='xsltRegisterTmpRVT'/>
</word>
+ <word name='engine'>
+ <ref name='xsltSetCtxtParseOptions'/>
+ </word>
<word name='entity'>
<ref name='xsltGetNsProp'/>
</word>
</word>
<word name='libxml2'>
<ref name='xsltGetUTF8Char'/>
+ <ref name='xsltSetCtxtParseOptions'/>
</word>
<word name='libxslt'>
<ref name='XSLT_LIBXSLT_NAMESPACE'/>
</word>
<word name='loading'>
<ref name='XSLT_PARSE_OPTIONS'/>
+ <ref name='xsltSetCtxtParseOptions'/>
</word>
<word name='local'>
<ref name='_xsltStackElem'/>
</word>
<word name='option'>
<ref name='xsltGetSecurityPrefs'/>
+ <ref name='xsltSetCtxtParseOptions'/>
<ref name='xsltSetSecurityPrefs'/>
</word>
<word name='options'>
<ref name='XSLT_PARSE_OPTIONS'/>
+ <ref name='_xsltTransformContext'/>
<ref name='xsltCheckRead'/>
<ref name='xsltCheckWrite'/>
+ <ref name='xsltSetCtxtParseOptions'/>
</word>
<word name='order'>
<ref name='XSLT_GET_IMPORT_INT'/>
<ref name='xsltRunStylesheetUser'/>
</word>
<word name='parser'>
+ <ref name='_xsltTransformContext'/>
<ref name='xsltFreeTransformContext'/>
+ <ref name='xsltSetCtxtParseOptions'/>
</word>
<word name='parsing'>
<ref name='xsltSetGenericDebugFunc'/>
</word>
<word name='passed'>
<ref name='xsltApplyOneTemplate'/>
+ <ref name='xsltSetCtxtParseOptions'/>
<ref name='xsltSetGenericDebugFunc'/>
<ref name='xsltSetGenericErrorFunc'/>
</word>
<ref name='_xsltStylesheet'/>
<ref name='xsltFindElemSpaceHandling'/>
</word>
+ <word name='previous'>
+ <ref name='xsltSetCtxtParseOptions'/>
+ </word>
<word name='printed'>
<ref name='xslAddCall'/>
</word>
<ref name='xsltEvalXPathStringNs'/>
<ref name='xsltRunStylesheet'/>
<ref name='xsltRunStylesheetUser'/>
+ <ref name='xsltSetCtxtParseOptions'/>
</word>
</letter>
</chunk>
<ref name='XSLT_PARSE_OPTIONS'/>
<ref name='_xsltTransformContext'/>
<ref name='xsltInitElemPreComp'/>
+ <ref name='xsltSetCtxtParseOptions'/>
<ref name='xsltXPathFunctionLookup'/>
<ref name='xsltXPathGetTransformContext'/>
<ref name='xsltXPathVariableLookup'/>
<ref name='xsltCopyNamespace'/>
<ref name='xsltCopyNamespaceList'/>
</word>
+ <word name='xmlParserOption'>
+ <ref name='_xsltTransformContext'/>
+ <ref name='xsltSetCtxtParseOptions'/>
+ </word>
<word name='xmlReadxxx'>
<ref name='XSLT_PARSE_OPTIONS'/>
</word>
<li>fixed stack overflow in recursive global variable or params</li>
<li>cleaned up Result Value Tree handling, and fixed a couple of old bugs
in the process</li>
-</ul><h3>1.0.27: Feb 24 2003</h3><ul><li>bug fixes: spurious xmlns:nsX="" generation, serialization bug (in
+</ul><h3>1.0.27: Feb 24 2003</h3><ul><li>bug fixes: spurious xmlns:nsX="" generation, serialization bug (in
libxml2), a namespace copy problem, errors in the RPM spec prereqs</li>
<li>Windows path canonicalization and document cache fix (Igor)</li>
</ul><h3>1.0.26: Feb 10 2003</h3><ul><li>Fixed 3 serious bugs in document() and stylesheet compilation which
<li>Allowed per transformation error handler.</li>
<li>Fixed a few bugs: node() semantic, URI escaping, media-type, attribute
lists</li>
-</ul><h3>1.0.21: Sep 26 2002</h3><ul><li>Bug fixes: match="node()", date:difference() (Igor and Charlie
+</ul><h3>1.0.21: Sep 26 2002</h3><ul><li>Bug fixes: match="node()", date:difference() (Igor and Charlie
Bozeman), disable-output-escaping</li>
<li>Python bindings: style.saveResultToString() from Ralf Mattes</li>
<li>Logos from Marc Liyanage</li>
<li>xsl:number fix: Richard Jinks</li>
<li>xsl:format-numbers fix: Ken Neighbors</li>
<li>document('') fix: bug pointed by Eric van der Vlist</li>
- <li>xsl:message with terminate="yes" fixes: William Brack</li>
+ <li>xsl:message with terminate="yes" fixes: William Brack</li>
<li>xsl:sort order support added: Ken Neighbors</li>
<li>a few other bug fixes, some of them requiring the latest version of
libxml2</li>
<li>Nasty bug fix related to exslt:node-set</li>
<li>Fixed the python Makefiles, cleanup of doc comments, Windows
portability fixes</li>
-</ul><h3>1.0.13: Mar 8 2002</h3><ul><li>a number of bug fixes including "namespace node have no parents"</li>
+</ul><h3>1.0.13: Mar 8 2002</h3><ul><li>a number of bug fixes including "namespace node have no parents"</li>
<li>Improvement of the Python bindings</li>
<li>Charles Bozeman provided fixes and regression tests for exslt date
functions.</li>
informations</li>
</ul><h3>1.0.7: Nov 10 2001</h3><ul><li>remove a compilation problem with LIBXSLT_PUBLIC</li>
<li>Finishing the integration steps for Keith Isdale debugger</li>
- <li>fixes the handling of indent="no" on HTML output</li>
+ <li>fixes the handling of indent="no" on HTML output</li>
<li>fixes on the configure script and RPM spec file</li>
</ul><h3>1.0.6: Oct 30 2001</h3><ul><li>bug fixes on number formatting (Thomas), date/time functions (Bruce
Miller)</li>
<li>Still misses extension element/function/prefixes support. Support of
key() and document() is not complete</li>
</ul><h3>0.1.0: Feb 8 2001</h3><ul><li>first beta version, released at the same time as libxml2-2.3.0</li>
- <li>lots of bug fixes, first "testing" version, but incomplete</li>
+ <li>lots of bug fixes, first "testing" version, but incomplete</li>
</ul><h3>0.0.1: Jan 25 2001</h3><ul><li>first alpha version released at the same time as libxml2-2.2.12</li>
<li>Framework in place, should work on simple examples, but far from being
feature complete</li>
earlier version of the libxml/libxslt <a href="http://www.rexx.com/~dkuhlman">wrappers for Python</a></li>
<li>Petr Kozelka provides <a href="http://sourceforge.net/projects/libxml2-pas">Pascal units to glue
libxml2</a> with Kylix, Delphi and other Pascal compilers</li>
- <li>Wai-Sun "Squidster" Chia provides <a href="http://www.rubycolor.org/arc/redist/">bindings for Ruby</a> and
+ <li>Wai-Sun "Squidster" Chia provides <a href="http://www.rubycolor.org/arc/redist/">bindings for Ruby</a> and
libxml2 bindings are also available in Ruby through the <a href="http://libgdome-ruby.berlios.de/">libgdome-ruby</a> module
maintained by Tobias Peters.</li>
<li>Steve Ball and contributors maintains <a href="http://tclxml.sourceforge.net/">libxml2 and libxslt bindings for
<li>Otherwise use the <a href="ftp://xmlsoft.org/python/">libxml2-python
module distribution</a> corresponding to your installed version of
libxml2 and libxslt. Note that to install it you will need both libxml2
- and libxslt installed and run "python setup.py build install" in the
+ and libxslt installed and run "python setup.py build install" in the
module tree.</li>
</ul><p>The distribution includes a set of examples and regression tests for the
python bindings in the <code>python/tests</code> directory. Here are some
document, transforming the document and saving the result.</p><pre>import libxml2
import libxslt
-styledoc = libxml2.parseFile("test.xsl")
+styledoc = libxml2.parseFile("test.xsl")
style = libxslt.parseStylesheetDoc(styledoc)
-doc = libxml2.parseFile("test.xml")
+doc = libxml2.parseFile("test.xml")
result = style.applyStylesheet(doc, None)
-style.saveResultToFilename("foo", result, 0)
+style.saveResultToFilename("foo", result, 0)
style.freeStylesheet()
doc.freeDoc()
result.freeDoc()</pre><p>The Python module is called libxslt, you will also need the libxml2 module
for the operations on XML trees. Let's have a look at the objects manipulated
in that example and how is the processing done:</p><ul><li><code>styledoc</code> : is a libxml2 document tree. It is obtained by
- parsing the XML file "test.xsl" containing the stylesheet.</li>
+ parsing the XML file "test.xsl" containing the stylesheet.</li>
<li><code>style</code> : this is a precompiled stylesheet ready to be used
by the following transformations (note the plural form, multiple
transformations can resuse the same stylesheet).</li>
stylesheet to the document. Note that some of the stylesheet informations
may be related to the serialization of that document and as in this
example a specific saveResultToFilename() method of the stylesheet should
- be used to save it to a file (in that case to "foo").</li>
+ be used to save it to a file (in that case to "foo").</li>
</ul><p>Also note the need to explicitely deallocate documents with freeDoc()
except for the stylesheet document which is freed when its compiled form is
garbage collected.</p><h3>extfunc.py:</h3><p>This one is a far more complex test. It shows how to modify the behaviour
return string.upper(str)
-libxslt.registerExtModuleFunction("foo", "http://example.com/foo", f)</pre><p>This code defines and register an extension function. Note that the
+libxslt.registerExtModuleFunction("foo", "http://example.com/foo", f)</pre><p>This code defines and register an extension function. Note that the
function can be bound to any name (foo) and how the binding is also
-associated to a namespace name "http://example.com/foo". From an XSLT point
+associated to a namespace name "http://example.com/foo". From an XSLT point
of view the function just returns an upper case version of the string passed
as a parameter. But the first part of the function also read some contextual
information from the current XSLT processing environement, in that case it
The pctxt is actually an object from a class derived from the
libxml2.xpathParserContext() with just a couple more properties including the
possibility to look up the XSLT transformation context from the XPath
-context.</p><pre>styledoc = libxml2.parseDoc("""
+context.</p><pre>styledoc = libxml2.parseDoc("""
<xsl:stylesheet version='1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
xmlns:foo='http://example.com/foo'
<article><xsl:value-of select='foo:foo($bar)'/></article>
</xsl:template>
</xsl:stylesheet>
-""")</pre><p>Here is a simple example of how to read an XML document from a python
+""")</pre><p>Here is a simple example of how to read an XML document from a python
string with libxml2. Note how this stylesheet:</p><ul><li>Uses a global parameter <code>bar</code></li>
<li>Reference the extension function f</li>
- <li>how the Namespace name "http://example.com/foo" has to be bound to a
+ <li>how the Namespace name "http://example.com/foo" has to be bound to a
prefix</li>
<li>how that prefix is excluded from the output</li>
<li>how the function is called from the select</li>
</ul><pre>style = libxslt.parseStylesheetDoc(styledoc)
-doc = libxml2.parseDoc("<doc/>")
-result = style.applyStylesheet(doc, { "bar": "'success'" })
+doc = libxml2.parseDoc("<doc/>")
+result = style.applyStylesheet(doc, { "bar": "'success'" })
style.freeStylesheet()
doc.freeDoc()</pre><p>that part is identical, to the basic example except that the
transformation is passed a dictionnary of parameters. Note that the string
-passed "success" had to be quoted, otherwise it is interpreted as an XPath
-query for the childs of root named "success".</p><pre>root = result.children
-if root.name != "article":
- print "Unexpected root node name"
+passed "success" had to be quoted, otherwise it is interpreted as an XPath
+query for the childs of root named "success".</p><pre>root = result.children
+if root.name != "article":
+ print "Unexpected root node name"
sys.exit(1)
-if root.content != "SUCCESS":
- print "Unexpected root node content, extension function failed"
+if root.content != "SUCCESS":
+ print "Unexpected root node content, extension function failed"
sys.exit(1)
if nodeName != 'article':
- print "The function callback failed to access its context"
+ print "The function callback failed to access its context"
sys.exit(1)
result.freeDoc()</pre><p>That part just verifies that the transformation worked, that the parameter
}
#ifdef XSLT_PARSE_OPTIONS
- doc = xmlReadFile((const char *) URI, NULL, XSLT_PARSE_OPTIONS);
+ doc = xmlReadFile((const char *) URI, NULL, ctxt->parserOptions);
#else
doc = xmlParseFile((const char *) URI);
#endif
if (ctxt->xinclude != 0) {
#ifdef LIBXML_XINCLUDE_ENABLED
#if LIBXML_VERSION >= 20603
- xmlXIncludeProcessFlags(doc, XSLT_PARSE_OPTIONS);
+ xmlXIncludeProcessFlags(doc, ctxt->parserOptions);
#else
xmlXIncludeProcess(doc);
#endif
cur->sec = xsltGetDefaultSecurityPrefs();
cur->debugStatus = xslDebugStatus;
cur->traceCode = (unsigned long*) &xsltDefaultTrace;
+ cur->parserOptions = XSLT_PARSE_OPTIONS;
return(cur);
}
/*
* Per Context Debugging
*/
- int debugStatus; /* the context level debug status */
+ int debugStatus; /* the context level debug status */
unsigned long* traceCode; /* pointer to the variable holding the mask */
+
+ int parserOptions; /* parser options xmlParserOption */
};
/**
/************************************************************************
* *
+ * Parsing options *
+ * *
+ ************************************************************************/
+
+/**
+ * xsltSetCtxtParseOptions:
+ * @ctxt: a XSLT process context
+ * @options: a combination of libxml2 xmlParserOption
+ *
+ * Change the default parser option passed by the XSLT engine to the
+ * parser when using document() loading.
+ *
+ * Returns the previous options or -1 in case of error
+ */
+int
+xsltSetCtxtParseOptions(xsltTransformContextPtr ctxt, int options)
+{
+ int oldopts;
+
+ if (ctxt == NULL)
+ return(-1);
+ oldopts = ctxt->parserOptions;
+ ctxt->parserOptions = options;
+ return(oldopts);
+}
+
+/************************************************************************
+ * *
* Output *
* *
************************************************************************/
const char *msg,
...);
+XSLTPUBFUN int XSLTCALL
+ xsltSetCtxtParseOptions (xsltTransformContextPtr ctxt,
+ int options);
/*
* Sorting.
*/
printErrorContext()
profileInformation()
saveProfiling()
+ setCtxtParseOptions()
Class stylesheet()
# accessors
doc()
xsltSaveResultToString
xsltSecurityAllow
xsltSecurityForbid
+xsltSetCtxtParseOptions
xsltSetCtxtSecurityPrefs
xsltSetCtxtSortFunc
xsltSetDebuggerCallbacks
ctxt = xsltNewTransformContext(cur, doc);
if (ctxt == NULL)
return;
+ xsltSetCtxtParseOptions(ctxt, options);
if (profile) {
res = xsltApplyStylesheetUser(cur, doc, params, NULL,
stderr, ctxt);
xmlLoadExtDtdDefaultValue = 0;
xmlSubstituteEntitiesDefault(1);
xmlLineNumbersDefault(1);
+#else
+ if (novalid != 0)
+ options = XML_PARSE_NOENT | XML_PARSE_NOCDATA;
#endif
/*