### Configure Source Automatically Source: https://github.com/gnome/libxslt/blob/master/win32/Readme.txt Example of configuring the build process with specific installation paths, include/lib paths, and debug symbols enabled. ```bash cscript configure.js prefix=c:\\opt include=c:\\opt\\include \ lib=c:\\opt\\lib debug=yes ``` -------------------------------- ### Install with NMAKE Source: https://github.com/gnome/libxslt/blob/master/win32/Readme.txt Command to install the compiled software to the directory specified during the configure stage. ```bash nmake install ``` -------------------------------- ### Generate List of Examples Source: https://github.com/gnome/libxslt/blob/master/tests/docbook/doc/fo/param.html Controls the generation of a list of titles for all Examples. A non-zero value activates the creation of a list of examples. ```XSLT ``` -------------------------------- ### Examples of Element-Content Models Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006.html Illustrative examples of how to define element content models for XML elements. ```XML ``` ```XML ``` ```XML ``` -------------------------------- ### DocBook XSL Driver File Example Source: https://github.com/gnome/libxslt/blob/master/tests/docbook/doc/ch01s04.html This example shows a typical structure of a DocBook XSL driver file, using to assemble various component stylesheets. ```xslt ... ``` -------------------------------- ### Example XML Start-Tag Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006.html An illustration of a valid XML start-tag with attributes. ```XML ``` -------------------------------- ### Get Help for configure.js Source: https://github.com/gnome/libxslt/blob/master/win32/Readme.txt Run this command to see a full list of options supported by the configuration script for the Windows port. ```bash cscript configure.js help ``` -------------------------------- ### Examples of Mixed Content Declarations Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006.html Illustrative examples of XML mixed content declarations. ```XML ``` ```XML ``` ```XML ``` -------------------------------- ### Example Element Type Declarations Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006.html Illustrates various ways to declare element types and their content models. ```XML ``` ```XML ``` ```XML ``` ```XML ``` -------------------------------- ### DocBook Menu Choice Example Source: https://github.com/gnome/libxslt/blob/master/tests/docbook/result/html/gdp-handbook.html Demonstrates how to represent a sequence of menu selections in DocBook using , , , and . ```DocBook Main Menu Utilities GNOME terminal ``` -------------------------------- ### Example of Parameter Entity Declaration and Reference Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006.html Demonstrates how to declare a parameter entity in XML and then reference it within the DTD. ```XML %ISOLat2; ``` -------------------------------- ### Example XML Comment Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006.html A simple example of a well-formed XML comment used for declarations. ```xml ``` -------------------------------- ### Example of a Tip Note Source: https://github.com/gnome/libxslt/blob/master/tests/docbook/result/html/gdp-handbook.html Use the tag to provide helpful suggestions. It should contain a and <para> for the tip's content. ```xml <tip> <title>TIP To speed up program compilation, use gcc compiler with Pentium optimization. ``` -------------------------------- ### CDATA Section Start Syntax Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006.html Specifies the starting delimiter for a CDATA section. ```xml CDStart ::= " TextFileWriter HandlerBase Writer writer String writerName "MyWriter" ``` -------------------------------- ### DocBook V4.0 simplemsgentry Example Source: https://github.com/gnome/libxslt/blob/master/tests/docbook/result/html/docbook40.html Shows the usage of the new simplemsgentry element for message entries in DocBook V4.0. ```docbook The text of a message An explanation of the message. The text of a message An explanation of the message. ``` -------------------------------- ### Example XML Text Declarations with Encoding Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006.html Illustrates how to specify character encodings like UTF-8 and EUC-JP within an XML declaration. These examples show the correct placement and quoting of the encoding attribute. ```XML ``` ```XML ``` -------------------------------- ### Example of Program Listing Source: https://github.com/gnome/libxslt/blob/master/tests/docbook/result/html/gdp-handbook.html Display file fragments or program listings using the tag. This tag preserves line breaks. ```xml [Desktop Entry] Name=Gnumeric spreadsheet Exec=gnumeric Icon=gnome-gnumeric.png Terminal=0 Type=Application ``` -------------------------------- ### Example of Terminal Session Source: https://github.com/gnome/libxslt/blob/master/tests/docbook/result/html/gdp-handbook.html Represent terminal sessions using the tag. Use for the system prompt and for commands. ```xml bash$make love make: *** No rule to make target `love'. Stop. ``` -------------------------------- ### Example Empty Elements Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006.html Illustrates different ways to represent empty elements in XML. ```XML ``` ```XML

``` ```XML
``` -------------------------------- ### DocBook V4.0 revhistory Example Source: https://github.com/gnome/libxslt/blob/master/tests/docbook/result/html/docbook40.html Demonstrates the use of revhistory for documenting revisions in DocBook V4.0. ```docbook 2 today N Walsh Longer descriptions are possible in a revhistory. 1 yesterday N Walsh ``` -------------------------------- ### Entity Expansion Example Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006.html Demonstrates the expansion of entity and character references within an XML document, showing the final content after parsing. ```XML

An ampersand (&) may be escaped numerically (&#38;) or with a general entity (&amp;).

``` -------------------------------- ### Entity and Character Reference Expansion Example 1 Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006-review.html Illustrates the expansion of character references and general entities within an entity declaration. ```XML An ampersand (&#38;) may be escaped numerically (&#38;#38;) or with a general entity (&amp;).

" > ``` ```XML

An ampersand (&) may be escaped numerically (&#38;) or with a general entity (&amp;).

``` ```XML An ampersand (&) may be escaped numerically (&) or with a general entity (&). ``` -------------------------------- ### Example Document with Language Attribute Source: https://github.com/gnome/libxslt/blob/master/tests/docbook/doc/ch01s04.html An example of a DocBook XML document specifying the language as French ('fr') in the root element. This enables localization of generated text. ```xml ... ``` -------------------------------- ### XML Entity Declarations for Normalization Examples Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006.html Defines entities used in attribute normalization examples, including carriage return, line feed, and a combination of both. ```xml ``` -------------------------------- ### DocBook Variable List Example Source: https://github.com/gnome/libxslt/blob/master/tests/docbook/result/html/gdp-handbook.html Shows the structure for a variable list in DocBook, suitable for defining terms and their descriptions. It uses , , and . ```DocBook <itemizedlist> This is the simplest unnumbered list, parallel to <ul> in HTML. Here is an example:... <orderedlist> This list is completely analogous to <itemizedlist> <variablelist> This list is used when each entry is rather long,... ``` -------------------------------- ### Open Help Document in GNOME Help Browser Source: https://github.com/gnome/libxslt/blob/master/tests/docbook/result/html/gdp-handbook.html Example code for developers to make Help buttons call the correct document in the GNOME Help Browser. This code finds and opens a specific help file. ```c gchar *tmp; tmp = gnome_help_file_find_file ("module", "page.html"); if (tmp) { gnome_help_goto(0, tmp); g_free(tmp); } ``` -------------------------------- ### Localization File Example (French) Source: https://github.com/gnome/libxslt/blob/master/tests/docbook/doc/ch01s04.html A snippet from a French localization file (fr.xml) showing key-value pairs for generated text. The stylesheet uses these keys to look up localized strings. ```xml ... ``` -------------------------------- ### Set Starting Character for Unicode Callouts Source: https://github.com/gnome/libxslt/blob/master/tests/docbook/doc/fo/param.html If non-zero, callouts are presented using Unicode characters starting with the specified character. Zero disables Unicode callouts. Defaults to 1. ```xsl ``` -------------------------------- ### Example XML End-Tag Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006.html An illustration of a valid XML end-tag. ```XML
``` -------------------------------- ### XML Replacement Text Example Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006.html Shows the resulting replacement text for the 'book' entity after processing character and parameter entity references, but leaving general entity references unexpanded. ```text La Peste: Albert Camus, � 1947 �ditions Gallimard. &rights; ``` -------------------------------- ### Example XML Document with XML Declaration Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006.html A well-formed XML document including an XML declaration specifying the version. ```xml Hello, world! ``` -------------------------------- ### XML Entity Declaration Example Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006.html Demonstrates the declaration of parameter and general entities, including nested references. The replacement text for 'book' is shown, illustrating how parameter entities are expanded but general entities are not within the literal value. ```xml ``` -------------------------------- ### Example Usage of Character and Entity References Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006.html Illustrates the use of character references for special characters and predefined entity references within an XML document. ```XML Type less-than (<) to save options. This document was prepared on &docdate; and is classified &security-level;. ``` -------------------------------- ### Complex Entity Expansion Scenario Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006.html A detailed example illustrating nested parameter entity expansion and the declaration of a general entity within a DTD. ```XML ' > %xx; ]> This sample shows a &tricky; method. ``` -------------------------------- ### Install GDP DocBook DTD for PNG Support (3.1) Source: https://github.com/gnome/libxslt/blob/master/tests/docbook/result/html/gdp-handbook.html Add this line to your SGML CATALOG file to use the GDP DocBook DTD variant for PNG support (version 3.1). ```text PUBLIC "-//GNOME//DTD DocBook PNG Variant V1.1//EN" "png-support-3.1.dtd" ``` -------------------------------- ### Install GDP DocBook DTD for PNG Support (3.0) Source: https://github.com/gnome/libxslt/blob/master/tests/docbook/result/html/gdp-handbook.html Add this line to your SGML CATALOG file to use the GDP DocBook DTD variant for PNG support (version 3.0). ```text PUBLIC "-//GNOME//DTD DocBook PNG Variant V1.0//EN" "png-support-3.0.dtd" ``` -------------------------------- ### Perl Script Callout Example Source: https://github.com/gnome/libxslt/blob/master/tests/docbook/result/html/book2.html Demonstrates embedding a Perl script within a DOS batch file, using callouts to explain specific parts of the script. Requires Perl and DOS batch interpreter. ```perl @rem = '--*-Perl-*-- @echo off perl.exe %_batchname %$ goto endofperl @rem '; # Compress mail... require 'n:/home/nwalsh/lib/cygnus.pl'; require 'timelocal.pl'; use Cwd; select (STDERR); $| = 1; select (STDOUT); $| = 1; @DIRS = ("/home/nwalsh/Mail"); while (@DIRS) { $dir = shift @DIRS; opendir (DIR, $dir); while ($fname = readdir(DIR)) { $file = "$dir/$fname"; next if ! -d $file; next if $fname =~ /^\.\.?$/; print "$file\n"; push (@DIRS, $file); &compress ($file); } } exit; ![1](../images/callouts/1.png) The prologue handles embedding a Perl script in a DOS batch file. ![2](../images/callouts/2.png) The goto statement, interpreted by the DOS batch file interpreter, skips over the body of the Perl script. ![3](../images/callouts/3.png) The require statement sources in external program fragments. ![4](../images/callouts/4.png) The use statement is similar, but has additional utility. It is a Perl5 function. (Note that this callout area specifies both a line and a column.) ![5](../images/callouts/5.png) This is a user subroutine call. ``` -------------------------------- ### DocBook Ordered List Example Source: https://github.com/gnome/libxslt/blob/master/tests/docbook/result/html/gdp-handbook.html Illustrates an ordered list in DocBook, analogous to but producing numbered entries. The 'numeration' attribute can control the numbering style. ```DocBook Example list item 1 Example list item 2 ``` -------------------------------- ### GNOME Application Manual Introduction Section Source: https://github.com/gnome/libxslt/blob/master/tests/docbook/result/html/gdp-handbook.html This XML snippet defines the introduction section for a GNOME application manual. It includes a description of the application, how to run it, and its package information. ```xml Introduction MY-GNOME-APP is an application which proves mathematical theorems. It has all the basic features expected from a mathematical theorem prover, as well as a number of advanced ones, such as proof by confusion. In fact, many of the proofs produced by MY-GNOME-APP are so complex that they are capable of proving almost anything with a virtually null likelihood of being disproven. It also has the very popular predecessor of proof by confusion, proof by dialog, first implemented by Plato. It also allows you to save and print theorem proofs and to add comments to the proofs it produces. To run MY-GNOME-APP, select SUBMENU MY-GNOME-APP from the Main Menu, or type MYGNOMEAPP on the command line. MY-GNOME-APP is included in the GNOME-PACKAGE package, which is part of the GNOME desktop environment. This document describes version &version; of MY-GNOME-APP. ``` -------------------------------- ### DocBook Itemized List Example Source: https://github.com/gnome/libxslt/blob/master/tests/docbook/result/html/gdp-handbook.html Demonstrates the structure of an itemized list in DocBook, similar to HTML's
    . It uses and tags for content. ```DocBook Show backup files — This will show any backup file that might be on your system. Show hidden files — This will show all "dot files" or files that begin with a dot. This files typically include configuration files and directories. Mix files and directories — This option will display files and directories in the order you sort them instead of always having directories shown above files. ``` -------------------------------- ### Open a Local File with KWrite Source: https://github.com/gnome/libxslt/blob/master/tests/docbook/result/html/kwrite.html Specify the path and name of a file to have KWrite open or create it immediately upon startup. ```bash kwrite /home/myhome/docs/myfile.txt ``` -------------------------------- ### Example CDATA Section Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006.html An example of a CDATA section where the enclosed content is treated as character data, not markup. ```xml Hello, world!]]> ``` -------------------------------- ### Invalid XML Comment Example Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006.html An example of an XML comment that is not well-formed due to an invalid ending sequence. ```xml ``` -------------------------------- ### Main Program Entry Point and Variable Initialization Source: https://github.com/gnome/libxslt/blob/master/doc/tutorial2/libxslt_pipes.html Initializes variables for argument parsing, parameter storage, stylesheet and file handling, and transformation results. Allocates memory for stylesheets and files using calloc. ```c int main(int argc, char **argv) { int arg_indx; const char *params[16 + 1]; int params_indx = 0; int stylesheet_indx = 0; int file_indx = 0; int i, j, k; FILE *output_file = stdout; xsltStylesheetPtr *stylesheets = (xsltStylesheetPtr *) calloc(argc, sizeof(xsltStylesheetPtr)); xmlDocPtr *files = (xmlDocPtr *) calloc(argc, sizeof(xmlDocPtr)); int return_value = 0; ``` -------------------------------- ### XML Name Start Characters Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006.html Defines the character ranges allowed for the start of an XML name, including various Unicode character categories. ```XML [#x0030-#x0039] |�[#x0660-#x0669] |�[#x06F0-#x06F9] |�[#x0966-#x096F] |�[#x09E6-#x09EF] |�[#x0A66-#x0A6F] |�[#x0AE6-#x0AEF] |�[#x0B66-#x0B6F] |�[#x0BE7-#x0BEF] |�[#x0C66-#x0C6F] |�[#x0CE6-#x0CEF] |�[#x0D66-#x0D6F] |�[#x0E50-#x0E59] |�[#x0ED0-#x0ED9] |�[#x0F20-#x0F29] ``` -------------------------------- ### XML Name Start and Extender Characters Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006-review.html Defines character ranges for XML name start characters and extender characters, derived from Unicode properties. ```XML [#x0030-#x0039] |�[#x0660-#x0669] |�[#x06F0-#x06F9] |�[#x0966-#x096F] |�[#x09E6-#x09EF] |�[#x0A66-#x0A6F] |�[#x0AE6-#x0AEF] |�[#x0B66-#x0B6F] |�[#x0BE7-#x0BEF] |�[#x0C66-#x0C6F] |�[#x0CE6-#x0CEF] |�[#x0D66-#x0D6F] |�[#x0E50-#x0E59] |�[#x0ED0-#x0ED9] |�[#x0F20-#x0F29] ``` ```XML #x00B7 |�#x02D0 |�#x02D1 |�#x0387 |�#x0640 |�#x0E46 |�#x0EC6 |�#x3005 |�[#x3031-#x3035] |�[#x309D-#x309E] |�[#x30FC-#x30FE] ``` -------------------------------- ### MS-Windows Build Commands Source: https://github.com/gnome/libxslt/blob/master/doc/tutorial2/libxslt_pipes.html Commands for building zlib and iconv on MS-Windows using nmake. Building libxml and libxslt requires an additional configuration step using cscript and configure.js. ```bash nmake /F Makefile.msc nmake /F Makefile.msvc ``` -------------------------------- ### Simple Command: cd Source: https://github.com/gnome/libxslt/blob/master/tests/docbook/result/html/condition.html Basic command to change directory. ```bash cd {_directory_} ``` -------------------------------- ### libxslt Tutorial C Program Source: https://github.com/gnome/libxslt/blob/master/doc/tutorial/libxslttutorial.html A C program demonstrating the use of libxslt for XSL transformations. It parses a stylesheet and an XML file, applies the transformation, saves the result, and cleans up resources. ```c /* * libxslt_tutorial.c: demo program for the XSL Transformation 1.0 engine * * based on xsltproc.c, by Daniel.Veillard@imag.fr * by John Fleck * * See the file Copyright for the status of this software. * */ #include #include #include #include #include #include #include #include #include #include #include #include extern int xmlLoadExtDtdDefaultValue; static void usage(const char *name) { printf("Usage: %s [options] stylesheet file [file ...]\n", name); printf(" --param name value : pass a (parameter,value) pair\n"); } int main(int argc, char **argv) { int i; const char *params[16 + 1]; int nbparams = 0; xsltStylesheetPtr cur = NULL; xmlDocPtr doc, res; if (argc <= 1) { usage(argv[0]); return(1); } for (i = 1; i < argc; i++) { if (argv[i][0] != '-') break; if ((!strcmp(argv[i], "-param")) || (!strcmp(argv[i], "--param"))) { i++; params[nbparams++] = argv[i++]; params[nbparams++] = argv[i]; if (nbparams >= 16) { fprintf(stderr, "too many params\n"); return (1); } } else { fprintf(stderr, "Unknown option %s\n", argv[i]); usage(argv[0]); return (1); } } params[nbparams] = NULL; xmlSubstituteEntitiesDefault(1); xmlLoadExtDtdDefaultValue = 1; cur = xsltParseStylesheetFile((const xmlChar *)argv[i]); i++; doc = xmlParseFile(argv[i]); res = xsltApplyStylesheet(cur, doc, params); xsltSaveResultToFile(stdout, res, cur); xsltFreeStylesheet(cur); xmlFreeDoc(res); xmlFreeDoc(doc); xsltCleanupGlobals(); xmlCleanupParser(); return(0); } ``` -------------------------------- ### xsltUninit Source: https://github.com/gnome/libxslt/blob/master/doc/devhelp/libxslt-xsltInternals.html Uninitializes the processor. ```APIDOC ## xsltUninit ### Description Uninitializes the processor. ### Method void ``` -------------------------------- ### Example XML Document without XML Declaration Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006.html A well-formed XML document that omits the XML declaration. ```xml Hello, world! ``` -------------------------------- ### Define GNOME Help Menu Source: https://github.com/gnome/libxslt/blob/master/tests/docbook/result/html/gdp-handbook.html Defines a help menu structure for a GNOME application. Ensure help files are in the correct directory for menu items to appear. ```c GnomeUIInfo helpmenu[] = { {GNOME_APP_UI_ITEM, N_("About"), N_("Info about this program"), about_cb, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_ABOUT, 0, 0, NULL}, GNOMEUIINFO_SEPARATOR, GNOMEUIINFO_HELP("_appname_"), GNOMEUIINFO_END }; ``` -------------------------------- ### XML Document with Internal Subset Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006.html An example of an XML document where the DTD is declared locally within an internal subset. ```xml ]> Hello, world! ``` -------------------------------- ### XML Document with External Subset Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006.html An example of an XML document that includes an external DTD specified by a system identifier. ```xml Hello, world! ``` -------------------------------- ### Configure libxml/libxslt on MS-Windows Source: https://github.com/gnome/libxslt/blob/master/doc/tutorial2/libxslt_pipes.html Command to run the JScript configuration script for libxml and libxslt on MS-Windows. Use 'cscript configure.js help' to see available parameters. ```bash cscript configure.js ``` -------------------------------- ### XSLT Parameter for Body Bottom Margin Source: https://github.com/gnome/libxslt/blob/master/tests/docbook/doc/fo/param.html Defines the bottom margin of the body text. Example value: '24pt'. ```xslt 24pt ``` -------------------------------- ### xsltEvalGlobalVariables Source: https://github.com/gnome/libxslt/blob/master/doc/devhelp/libxslt-variables.html Evaluates all global variables and parameters of a stylesheet. This function is intended for internal use and is called at the start of a transformation. ```APIDOC ## Function xsltEvalGlobalVariables ### Description Evaluates all global variables and parameters of a stylesheet. For internal use only. This is called at start of a transformation. ### Signature ```c int xsltEvalGlobalVariables(xsltTransformContextPtr ctxt) ``` ### Parameters * `ctxt` (xsltTransformContextPtr) - The XSLT transformation context. ### Returns 0 in case of success, -1 in case of error. ``` -------------------------------- ### xsltGetPlainNamespace Source: https://github.com/gnome/libxslt/blob/master/doc/devhelp/libxslt-namespaces.html Obsolete function to get a namespace declaration. It is functionally identical to xsltGetNamespace() and is not called by any libxslt or libexslt functions. ```APIDOC ## xsltGetPlainNamespace (Obsolete) ### Description Obsolete. Not called by any Libxslt/Libexslt function. Exactly the same as xsltGetNamespace(). ### Function Signature xmlNsPtr xsltGetPlainNamespace(xsltTransformContextPtr ctxt, xmlNodePtr cur, xmlNsPtr ns, xmlNodePtr out) ### Parameters * **ctxt** (xsltTransformContextPtr) - a transformation context * **cur** (xmlNodePtr) - the input node * **ns** (xmlNsPtr) - the namespace * **out** (xmlNodePtr) - the result element ### Returns A namespace declaration or NULL in case of namespace fixup failures or API or internal errors. ``` -------------------------------- ### Print Usage Information Source: https://github.com/gnome/libxslt/blob/master/doc/tutorial2/libxslt_pipes.html Prints the usage instructions for the program. This is typically called when the program receives no arguments or an invalid option. ```c printf(" --out file: send output to file\n"); printf(" --param name value: pass a (parameter,value) pair\n"); ``` -------------------------------- ### Internal Entity Declaration Example Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006.html Declares an internal entity with a string value. The replacement text is directly provided in the declaration. ```xml ``` -------------------------------- ### XML Declaration with Standalone Document Declaration Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006.html An example of an XML declaration that includes a standalone document declaration set to 'yes'. ```xml ``` -------------------------------- ### xsltUninit Source: https://github.com/gnome/libxslt/blob/master/doc/devhelp/libxslt-xsltInternals.html Uninitializes the libxslt library. ```APIDOC ## xsltUninit ### Description Uninitializes the libxslt library, releasing any resources it holds. ### Function Signature `void xsltUninit(void)` ``` -------------------------------- ### Convert DocBook to HTML using db2html Source: https://github.com/gnome/libxslt/blob/master/tests/docbook/result/html/gdp-handbook.html Run this command to convert your SGML document to HTML. It creates a directory with the resulting HTML files. Screenshots need to be copied manually. ```bash $db2html mydocument.sgml ``` -------------------------------- ### Extension Initialization and Shutdown Source: https://github.com/gnome/libxslt/blob/master/doc/devhelp/libxslt-extensions.html Functions for initializing and shutting down extension modules. ```APIDOC ## xsltExtInitFunction ### Description Type definition for an extension module initialization function. ### Synopsis ```c typedef void * xsltExtInitFunction(xsltTransformContextPtr ctxt, const xmlChar * URI); ``` ## xsltExtShutdownFunction ### Description Type definition for an extension module shutdown function. ### Synopsis ```c typedef void xsltExtShutdownFunction(xsltTransformContextPtr ctxt, const xmlChar * URI, void * data); ``` ## xsltRegisterExtModule ### Description Registers an extension module with its initialization function and URI. ### Synopsis ```c int xsltRegisterExtModule(const xmlChar * URI, xsltExtInitFunction initFunc, ``` -------------------------------- ### Compile with NMAKE (MSVC) Source: https://github.com/gnome/libxslt/blob/master/win32/Readme.txt Command to compile the software using the NMAKE utility, assuming MSVC compiler is configured. ```bash nmake ``` -------------------------------- ### Initialize Keys for Transformation Context Source: https://github.com/gnome/libxslt/blob/master/doc/devhelp/libxslt-keys.html Computes all key tables for the current input document. This should be done before global variables are initialized. Note: This function is no longer used in the refactored code. ```c void xsltInitCtxtKeys (xsltTransformContextPtr ctxt, xsltDocumentPtr idoc) ``` -------------------------------- ### GNOME Application Manual Article Header Source: https://github.com/gnome/libxslt/blob/master/tests/docbook/result/html/gdp-handbook.html This XML snippet defines the header for a GNOME application manual using DocBook. It includes the article ID, title, copyright information, legal notice, and release information. ```xml
    MY-GNOME-APP 2000 ME-THE-AUTHOR Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. You may obtain a copy of the GNU Free Documentation License from the Free Software Foundation by visiting their Web site or by writing to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Many of the names used by companies to distinguish their products and services are claimed as trademarks. Where those names appear in any GNOME documentation, and those trademarks are made aware to the members of the GNOME Documentation Project, the names have been printed in caps or initial caps. This is version 1.0 of MY-GNOME-APP manual. ``` -------------------------------- ### Handle No Arguments Case Source: https://github.com/gnome/libxslt/blob/master/doc/tutorial2/libxslt_pipes.html Checks if the program received any arguments. If not, it prints usage information, sets the return value to 1, and jumps to the finish label for cleanup. ```c if (argc <= 1) { usage(argv[0]); return_value = 1; goto finish; } ``` -------------------------------- ### XML PITarget Syntax Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006.html Specifies the syntax for a PITarget, which identifies the application for a processing instruction. Reserved names starting with 'XML' are disallowed. ```xml PITarget ::= [Name](#NT-Name) - (("X" | "x") ("M" | "m") ("L" | "l")) ``` -------------------------------- ### XML Name Definition Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006.html Defines the syntax for an XML name, which must start with a letter, underscore, or colon, followed by name characters. ```xml Name ::= (Letter | '_' | ':') (NameChar)* ``` -------------------------------- ### xsltNewStylesheet Source: https://github.com/gnome/libxslt/blob/master/doc/devhelp/libxslt-xsltInternals.html Creates and initializes a new, empty XSLT stylesheet structure. This is typically used as a starting point before populating stylesheet rules. ```APIDOC ## xsltNewStylesheet ### Description Creates a new, empty XSLT Stylesheet structure. This function allocates memory for a new stylesheet. ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Method N/A (C function) ### Endpoint N/A (C function) ### Request Example N/A ### Response #### Success Response Returns a pointer to the newly allocated XSLT stylesheet structure. #### Error Response (NULL) Returns NULL in case of an allocation error. #### Response Example ``` [xsltStylesheetPtr] ``` ``` -------------------------------- ### xsltInitCtxtExts Source: https://github.com/gnome/libxslt/blob/master/doc/devhelp/libxslt-extensions.html Initializes the set of modules with registered stylesheet data for a transformation context. ```APIDOC ## xsltInitCtxtExts ### Description Initializes the set of modules with registered stylesheet data for a transformation context. ### Parameters #### Path Parameters - **ctxt** ([xsltTransformContextPtr]) - An XSLT transformation context. ### Returns - (int) - The number of modules initialized, or -1 in case of error. ``` -------------------------------- ### Get Namespace Property Source: https://github.com/gnome/libxslt/blob/master/doc/devhelp/libxslt-xsltutils.html Retrieves the value of a property associated with a namespace from an XML node. This is a general-purpose function for accessing namespaced attributes. ```c xmlChar * xslGetNsProp(xmlNodePtr node, const xmlChar * name, const xmlChar * nameSpace); ``` -------------------------------- ### Get Debugger Status Source: https://github.com/gnome/libxslt/blob/master/doc/devhelp/libxslt-xsltutils.html Checks the current status of the XSLT debugger. Returns an integer indicating whether the debugger is active or in what state it is. ```c int xslGetDebuggerStatus(void); ``` -------------------------------- ### Include Necessary Libraries for libxslt Source: https://github.com/gnome/libxslt/blob/master/doc/tutorial2/libxslt_pipes.html Includes general C libraries and specific libxslt headers for transformation and utility functions. Ensure these are available in your build environment. ```c #include #include #include #include #include ``` -------------------------------- ### Get Fully Qualified Length Specification Source: https://github.com/gnome/libxslt/blob/master/tests/docbook/doc/lib/lib.html Returns a qualified length specification. If an unqualified length is provided, it appends the default units. ```xsl ... ``` -------------------------------- ### Applying Stylesheets and Saving Results Source: https://github.com/gnome/libxslt/blob/master/doc/tutorial2/libxslt_pipes.html Iterates through files, applying each stylesheet and saving the transformed document. Handles cases with and without stylesheets. ```c / * Process files */ for (i = 0; files[i]; i++) { doc = files[i]; res = doc; for (j = 0; stylesheets[j]; j++) { res = xsltApplyStylesheet(stylesheets[j], doc, params); xmlFreeDoc(doc); doc = res; } if (stylesheets[0]) { xsltSaveResultToFile(output_file, res, stylesheets[j-1]); } else { xmlDocDump(output_file, res); } xmlFreeDoc(res); } fclose(output_file); for (k = 0; stylesheets[k]; k++) { xsltFreeStylesheet(stylesheets[k]); } xsltCleanupGlobals(); xmlCleanupParser(); finish: free(stylesheets); free(files); return(return_value); ``` -------------------------------- ### Registering a Manual Callback for Applets Source: https://github.com/gnome/libxslt/blob/master/tests/docbook/result/html/gdp-handbook.html Use this function to add a 'Manual' item to an applet's menu. The callback function will be invoked when the user selects this item. ```c /* add an item to the applet menu */ applet_widget_register_callback(APPLET_WIDGET(applet), "manual", _("Manual"), &open_manual, NULL); ``` -------------------------------- ### Example of a Figure Inclusion Source: https://github.com/gnome/libxslt/blob/master/tests/docbook/result/html/gdp-handbook.html Include figures using the
    tag, which requires an 'id'. It contains a and a <screenshot> element with <graphic> details. ```xml <figure id="shot1"> <title>Screenshot Screenshot of a program
    ``` -------------------------------- ### Customize Section Numbering Source: https://github.com/gnome/libxslt/blob/master/tests/docbook/doc/fo/param.html Example of a driver stylesheet to enable automatic section numbering by importing the main stylesheet and setting the 'section.autolabel' parameter. ```xslt ``` -------------------------------- ### Get Profile Information Source: https://github.com/gnome/libxslt/blob/master/doc/devhelp/libxslt-xsltutils.html Retrieves profiling information collected during an XSLT transformation. This data can be used to analyze the performance of different parts of the stylesheet. ```c xmlDocPtr xslGetProfileInformation(xsltTransformContextPtr ctxt); ``` -------------------------------- ### Malformed XML Entity Usage Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006.html An example demonstrating an invalid use of an entity reference within an attribute value, which would result in a fatal error. ```xml ``` -------------------------------- ### XML Start-Tag Syntax Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006.html Defines the structure of an XML start-tag, including the element name and optional attributes. ```XML ``` -------------------------------- ### Attribute Normalization Example: CDATA Type Source: https://github.com/gnome/libxslt/blob/master/tests/xmlspec/REC-xml-20001006.html Illustrates attribute value normalization for an attribute declared as CDATA, showing how whitespace and entity references are processed. ```xml a=" xyz" -> #x20 #x20 x y z ``` ```xml a="&d;&d;A&a;&a;B&da;" -> #x20 #x20 A #x20 #x20 B #x20 #x20 ``` ```xml a=" A B " -> #xD #xD A #xA #xA B #xD #xD ``` -------------------------------- ### xsltInitCtxtKeys Source: https://github.com/gnome/libxslt/blob/master/doc/devhelp/libxslt-keys.html Initializes the key tables for the current input document. This should be called before global variables are initialized. Note: This function is no longer used in the refactored code. ```APIDOC ## xsltInitCtxtKeys() ### Description Computes all the keys tables for the current input document. Should be done before global varibales are initialized. NOTE: Not used anymore in the refactored code. ### Parameters * **ctxt** (*xsltTransformContextPtr*) - An XSLT transformation context. * **idoc** (*xsltDocumentPtr*) - A document info. ```