From 26cfddfe78ecd3b4a8a72e9c3a222fa6ae7e84d2 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Mon, 24 Mar 2003 21:38:13 +0000 Subject: [PATCH] Result Value Tree are now generated with a document root node not an * libxslt/pattern.c libxslt/transform.c libxslt/variables.c: Result Value Tree are now generated with a document root node not an element, it's quite cleaner. * configure.in libxslt.spec.in NEWS: But this requires libxml2-2.5.5 also prepared for libxslt-1.0.28 release * doc/*: updated and regenerated the docs Daniel --- ChangeLog | 9 ++ NEWS | 10 +- configure.in | 6 +- doc/html/index.sgml | 1 + doc/html/libxslt-numbersinternals.html | 16 +-- doc/html/libxslt-xsltinternals.html | 242 +++++++++++++++++++++++---------- doc/libxslt-decl.txt | 21 ++- doc/libxslt-sections.txt | 1 + doc/news.html | 10 +- doc/python.html | 8 +- doc/xslt.html | 19 ++- libxslt.spec.in | 12 +- libxslt/pattern.c | 9 +- libxslt/transform.c | 22 ++- libxslt/variables.c | 28 ++-- 15 files changed, 275 insertions(+), 139 deletions(-) diff --git a/ChangeLog b/ChangeLog index 921dcdd..2d37e89 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Mon Mar 24 22:30:00 CET 2003 Daniel Veillard + + * libxslt/pattern.c libxslt/transform.c libxslt/variables.c: + Result Value Tree are now generated with a document root node + not an element, it's quite cleaner. + * configure.in libxslt.spec.in NEWS: But this requires libxml2-2.5.5 + also prepared for libxslt-1.0.28 release + * doc/*: updated and regenerated the docs + Mon Mar 24 15:01:07 CET 2003 Daniel Veillard * libxslt/pattern.c libxslt/transform.c libxslt/variables.c: diff --git a/NEWS b/NEWS index c3efb11..0b2106e 100644 --- a/NEWS +++ b/NEWS @@ -11,10 +11,18 @@ http://cvs.gnome.org/lxr/source/libxslt/ChangeLog file for a really accurate description: +1.0.28: Mar 24 2003: + - fixed node() in patterns semantic. + - fixed a memory access problem in format-number() + - fixed stack overflow in recursive global variable or params + - cleaned up Result Value Tree handling, and fixed a couple of old bugs + in the process + + 1.0.27: Feb 24 2003: - bug fixes: spurious xmlns:nsX="" generation, serialization bug (in libxml2), a namespace copy problem, errors in the RPM spec prereqs - - Windows path canonicalization and document cache fix (Igor) + - Windows path canonicalization and document cache fix (Igor) 1.0.26: Feb 10 2003: diff --git a/configure.in b/configure.in index 139322a..78c5adf 100644 --- a/configure.in +++ b/configure.in @@ -6,12 +6,12 @@ dnl libexslt is an extension dnl LIBXSLT_MAJOR_VERSION=1 LIBXSLT_MINOR_VERSION=0 -LIBXSLT_MICRO_VERSION=27 +LIBXSLT_MICRO_VERSION=28 PACKAGE=libxslt LIBEXSLT_MAJOR_VERSION=0 LIBEXSLT_MINOR_VERSION=7 -LIBEXSLT_MICRO_VERSION=18 -LIBXML_REQUIRED_VERSION=2.5.2 +LIBEXSLT_MICRO_VERSION=19 +LIBXML_REQUIRED_VERSION=2.5.5 LIBXSLT_VERSION=$LIBXSLT_MAJOR_VERSION.$LIBXSLT_MINOR_VERSION.$LIBXSLT_MICRO_VERSION diff --git a/doc/html/index.sgml b/doc/html/index.sgml index 4dc35ab..5982503 100644 --- a/doc/html/index.sgml +++ b/doc/html/index.sgml @@ -232,6 +232,7 @@ + diff --git a/doc/html/libxslt-numbersinternals.html b/doc/html/libxslt-numbersinternals.html index b859239..14ea311 100644 --- a/doc/html/libxslt-numbersinternals.html +++ b/doc/html/libxslt-numbersinternals.html @@ -111,7 +111,7 @@ NAME="LIBXSLT-NUMBERSINTERNALS" >

Name

Synopsis

Description

Details




xsltStylesheetPtr xsltParseStylesheetImportedDoc + (xmlDocPtr doc); +xsltStylesheetPtr xsltLoadStylesheetPI (

Description

Details









































doc : and xmlDoc parsed XML
Returns :a new XSLT stylesheet structure.


xsltParseStylesheetImportedDoc ()

xsltStylesheetPtr xsltParseStylesheetImportedDoc
+                                            (xmlDocPtr doc);

parse an XSLT stylesheet building the associated structures +except the processing not needed for imported documents.







LIBXSLT_DOTTED_VERSION -#define LIBXSLT_DOTTED_VERSION "1.0.23" +#define LIBXSLT_DOTTED_VERSION "1.0.27" LIBXSLT_VERSION -#define LIBXSLT_VERSION 10023 +#define LIBXSLT_VERSION 10027 LIBXSLT_VERSION_STRING -#define LIBXSLT_VERSION_STRING "10023" +#define LIBXSLT_VERSION_STRING "10027" WITH_XSLT_DEBUG @@ -27,6 +27,10 @@ #define XSLT_NEED_TRIO +XSLT_NEED_TRIO +#define XSLT_NEED_TRIO + + WITH_DEBUGGER #define WITH_DEBUGGER @@ -1146,15 +1150,15 @@ void LIBXSLT_DOTTED_VERSION -#define LIBXSLT_DOTTED_VERSION "1.0.23" +#define LIBXSLT_DOTTED_VERSION "1.0.27" LIBXSLT_VERSION -#define LIBXSLT_VERSION 10023 +#define LIBXSLT_VERSION 10027 LIBXSLT_VERSION_STRING -#define LIBXSLT_VERSION_STRING "10023" +#define LIBXSLT_VERSION_STRING "10027" WITH_XSLT_DEBUG @@ -1773,6 +1777,11 @@ xsltStylesheetPtr style,xmlNodePtr cur xmlDocPtr doc +xsltParseStylesheetImportedDoc +xsltStylesheetPtr +xmlDocPtr doc + + xsltLoadStylesheetPI xsltStylesheetPtr xmlDocPtr doc diff --git a/doc/libxslt-sections.txt b/doc/libxslt-sections.txt index 11206c0..fdc50c8 100644 --- a/doc/libxslt-sections.txt +++ b/doc/libxslt-sections.txt @@ -359,6 +359,7 @@ xsltDecimalFormatGetByName xsltParseStylesheetProcess xsltParseStylesheetOutput xsltParseStylesheetDoc +xsltParseStylesheetImportedDoc xsltLoadStylesheetPI xsltNumberFormat xsltFormatNumberConversion diff --git a/doc/news.html b/doc/news.html index 065047f..382f08d 100644 --- a/doc/news.html +++ b/doc/news.html @@ -84,11 +84,19 @@ A:link, A:visited, A:active { text-decoration: underline }

CVS only : check the Changelog file for a really accurate description

+

1.0.28: Mar 24 2003

+
    +
  • fixed node() in patterns semantic.
  • +
  • fixed a memory access problem in format-number()
  • +
  • fixed stack overflow in recursive global variable or params
  • +
  • cleaned up Result Value Tree handling, and fixed a couple of old bugs + in the process
  • +

1.0.27: Feb 24 2003

  • bug fixes: spurious xmlns:nsX="" generation, serialization bug (in libxml2), a namespace copy problem, errors in the RPM spec prereqs
  • -
  • Windows path canonicalization and document cache fix (Igor)
  • +
  • Windows path canonicalization and document cache fix (Igor)

1.0.26: Feb 10 2003

    diff --git a/doc/python.html b/doc/python.html index 3563e49..adae50e 100644 --- a/doc/python.html +++ b/doc/python.html @@ -91,8 +91,7 @@ or libxslt wrappers or bindings:

  • Matt Sergeant developped XML::LibXML - and XML::LibXSLT, Perl wrappers for libxml2/libxslt as part of the - AxKit XML application server + and XML::LibXSLT, Perl wrappers for libxml2/libxslt as part of the AxKit XML application server
  • Dave Kuhlman provides and @@ -116,9 +115,8 @@ or libxslt wrappers or bindings:

    for PHP.
  • LibxmlJ is - an effort to create a 100% JAXP-compatible Java wrapper for - libxml2 and libxslt as part of GNU ClasspathX project. -
  • + an effort to create a 100% JAXP-compatible Java wrapper for libxml2 and + libxslt as part of GNU ClasspathX project.

The libxslt Python module depends on the libxml2 Python module.

The distribution includes a set of Python bindings, which are garanteed to diff --git a/doc/xslt.html b/doc/xslt.html index 0ffdef0..8b30b6b 100644 --- a/doc/xslt.html +++ b/doc/xslt.html @@ -267,11 +267,20 @@ platform, get in touch with me to upload the package. I will keep them in the href="http://cvs.gnome.org/lxr/source/libxslt/ChangeLog">Changelog file for a really accurate description +

1.0.28: Mar 24 2003

+
    +
  • fixed node() in patterns semantic.
  • +
  • fixed a memory access problem in format-number()
  • +
  • fixed stack overflow in recursive global variable or params
  • +
  • cleaned up Result Value Tree handling, and fixed a couple of old bugs + in the process
  • +
+

1.0.27: Feb 24 2003

  • bug fixes: spurious xmlns:nsX="" generation, serialization bug (in libxml2), a namespace copy problem, errors in the RPM spec prereqs
  • -
  • Windows path canonicalization and document cache fix (Igor)
  • +
  • Windows path canonicalization and document cache fix (Igor)

1.0.26: Feb 10 2003

@@ -859,8 +868,8 @@ or libxslt wrappers or bindings:

  • Matt Sergeant developped XML::LibXML - and XML::LibXSLT, Perl wrappers for libxml2/libxslt as part of the - AxKit XML application server
  • + and XML::LibXSLT, Perl wrappers for libxml2/libxslt as part of the AxKit XML application server
  • Dave Kuhlman provides and earlier version of the libxml/libxslt wrappers for Python
  • @@ -882,8 +891,8 @@ or libxslt wrappers or bindings:

    using libxslt for PHP.
  • LibxmlJ is - an effort to create a 100% JAXP-compatible Java wrapper for - libxml2 and libxslt as part of GNU ClasspathX project. + an effort to create a 100% JAXP-compatible Java wrapper for libxml2 and + libxslt as part of GNU ClasspathX project.
  • The libxslt Python module depends on the = 2.5.4 -BuildRequires: libxml2-devel >= 2.5.4 +Requires: libxml2 >= 2.5.5 +BuildRequires: libxml2-devel >= 2.5.5 BuildRequires: python python-devel BuildRequires: libxml2-python Prefix: %{_prefix} @@ -17,26 +17,26 @@ Docdir: %{_docdir} %description This C library allows to transform XML files into other XML files (or HTML, text, ...) using the standard XSLT stylesheet transformation -mechanism. To use it you need to have a version of libxml2 >= 2.5.4 +mechanism. To use it you need to have a version of libxml2 >= 2.5.5 installed. The xsltproc command is a command line interface to the XSLT engine %package devel Summary: Libraries, includes, etc. to embed the Gnome XSLT engine Group: Development/Libraries Requires: libxslt = %{version} -Requires: libxml2-devel >= 2.5.4 +Requires: libxml2-devel >= 2.5.5 %description devel This C library allows to transform XML files into other XML files (or HTML, text, ...) using the standard XSLT stylesheet transformation -mechanism. To use it you need to have a version of libxml2 >= 2.5.4 +mechanism. To use it you need to have a version of libxml2 >= 2.5.5 installed. %package python Summary: Python bindings for the libxslt library Group: Development/Libraries Requires: libxslt = %{version} -Requires: libxml2 >= 2.5.4 +Requires: libxml2 >= 2.5.5 Requires: python %description python diff --git a/libxslt/pattern.c b/libxslt/pattern.c index 53ae86c..b0283e6 100644 --- a/libxslt/pattern.c +++ b/libxslt/pattern.c @@ -638,11 +638,10 @@ xsltTestCompMatch(xsltTransformContextPtr ctxt, xsltCompMatchPtr comp, if ((parent == NULL) || (node->doc == NULL)) nocache = 1; else { - while (parent->parent != NULL) - parent = parent->parent; - if (((parent->type != XML_DOCUMENT_NODE) && - (parent->type != XML_HTML_DOCUMENT_NODE)) || - (parent != (xmlNodePtr) node->doc)) + if ((doc->name != NULL) && + (doc->name[0] == ' ') && + (xmlStrEqual(BAD_CAST doc->name, + BAD_CAST " fake node libxslt"))) nocache = 1; } if (nocache == 0) { diff --git a/libxslt/transform.c b/libxslt/transform.c index 6901657..54ecd48 100644 --- a/libxslt/transform.c +++ b/libxslt/transform.c @@ -3064,25 +3064,19 @@ xsltApplyTemplates(xsltTransformContextPtr ctxt, xmlNodePtr node, (list->nodeTab[i]->doc->doc)!=ctxt->xpathCtxt->doc) { /* The nodeset is from another document, so must change */ ctxt->xpathCtxt->doc=list->nodeTab[i]->doc->doc; - if (list->nodeTab[i]->doc->type != XML_ELEMENT_NODE) { - if ((ctxt->document = xsltFindDocument(ctxt, - list->nodeTab[i]->doc->doc))==NULL) { - xsltTransformError(ctxt, NULL, inst, - "xsl:apply-templates : can't find doc\n"); - goto error; - } + if (list->nodeTab[i]->doc->name != NULL) { + ctxt->document = xsltFindDocument(ctxt, + list->nodeTab[i]->doc->doc); ctxt->xpathCtxt->node = list->nodeTab[i]; #ifdef WITH_XSLT_DEBUG_PROCESS - xsltGenericDebug(xsltGenericDebugContext, + if (ctxt->document != NULL) { + xsltGenericDebug(xsltGenericDebugContext, "xsltApplyTemplates: Changing document - context doc %s, xpathdoc %s\n", ctxt->document->doc->URL, ctxt->xpathCtxt->doc->URL); -#endif - } else { - ctxt->xpathCtxt->node = list->nodeTab[i]; - ctxt->document = NULL; -#ifdef WITH_XSLT_DEBUG_PROCESS - xsltGenericDebug(xsltGenericDebugContext, + } else { + xsltGenericDebug(xsltGenericDebugContext, "xsltApplyTemplates: Changing document - Return tree fragment\n"); + } #endif } } diff --git a/libxslt/variables.c b/libxslt/variables.c index 98b872e..1a0a921 100644 --- a/libxslt/variables.c +++ b/libxslt/variables.c @@ -360,21 +360,21 @@ xsltEvalVariable(xsltTransformContextPtr ctxt, xsltStackElemPtr elem, /* * This is a result tree fragment. */ - xmlNodePtr container; + xmlDocPtr container; xmlNodePtr oldInsert; xmlDocPtr oldoutput; - container = xmlNewDocNode(NULL, NULL, - (const xmlChar *) " fake node libxslt", NULL); + container = xmlNewDoc(NULL); if (container == NULL) return(NULL); - container->doc = (xmlDocPtr) container; + container->name = xmlStrdup(BAD_CAST " fake node libxslt"); + container->doc = container; container->parent = NULL; oldoutput = ctxt->output; - ctxt->output = (xmlDocPtr) container; + ctxt->output = container; oldInsert = ctxt->insert; - ctxt->insert = container; + ctxt->insert = (xmlNodePtr) container; xsltApplyOneTemplate(ctxt, ctxt->node, elem->tree, NULL, NULL); ctxt->insert = oldInsert; ctxt->output = oldoutput; @@ -497,23 +497,21 @@ xsltEvalGlobalVariable(xsltStackElemPtr elem, xsltTransformContextPtr ctxt) { /* * This is a result tree fragment. */ - xmlNodePtr container; + xmlDocPtr container; xmlNodePtr oldInsert; xmlDocPtr oldoutput; - container = xmlNewDocNode(NULL , NULL, - (const xmlChar *) " fake node libxslt", NULL); - if (container == NULL) { - elem->name = name; + container = xmlNewDoc(NULL); + if (container == NULL) return(NULL); - } - container->doc = (xmlDocPtr) container; + container->name = xmlStrdup(BAD_CAST " fake node libxslt"); + container->doc = container; container->parent = NULL; oldoutput = ctxt->output; - ctxt->output = (xmlDocPtr) container; + ctxt->output = container; oldInsert = ctxt->insert; - ctxt->insert = container; + ctxt->insert = (xmlNodePtr) container; xsltApplyOneTemplate(ctxt, ctxt->node, elem->tree, NULL, NULL); ctxt->insert = oldInsert; ctxt->output = oldoutput; -- 2.7.4