fixed problem with timezone offset (bug 153000) changed regression test
authorWilliam M. Brack <wbrack@src.gnome.org>
Sun, 19 Sep 2004 00:14:04 +0000 (00:14 +0000)
committerWilliam M. Brack <wbrack@src.gnome.org>
Sun, 19 Sep 2004 00:14:04 +0000 (00:14 +0000)
* libexslt/date.c: fixed problem with timezone offset
  (bug 153000)
* tests/exslt/date/add.1.out: changed regression test output,
  which was apparently incorrect for above case

* libxslt/transform.c: re-arranged sequence of setting up
  namespaces within xsltCopyTree (see the list thread
  http://mail.gnome.org/archives/xml/2004-September/msg00072.html)
* tests/general/bug-104.out: slight change to expected output
  due to above fix

ChangeLog
libexslt/date.c
libxslt/transform.c
tests/exslt/date/add.1.out
tests/general/bug-104.out

index 87ae6ed..e6d5e07 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+Sat Sep 18 17:08:31 PDT 2004 William Brack <wbrack@mmm.com.hk>
+
+       * libexslt/date.c: fixed problem with timezone offset
+         (bug 153000)
+       * tests/exslt/date/add.1.out: changed regression test output,
+         which was apparently incorrect for above case
+
+Sat Sep 18 00:04:02 PDT 2004 William Brack <wbrack@mmm.com.hk>
+
+       * libxslt/transform.c: re-arranged sequence of setting up
+         namespaces within xsltCopyTree (see the list thread
+         http://mail.gnome.org/archives/xml/2004-September/msg00072.html)
+       * tests/general/bug-104.out: slight change to expected output
+         due to above fix
+
 Fri Sep 17 23:15:33 PDT 2004 William Brack <wbrack@mmm.com.hk>
 
        * libexslt/date.c: enhanced validation of date-time to catch
index 8863fa7..3cf8160 100644 (file)
@@ -1449,7 +1449,7 @@ _exsltDateAdd (exsltDateValPtr dt, exsltDateValPtr dur)
         d->mon = 1;
 
     /* normalize for time zone offset */
-    u->sec += (d->tzo * 60);
+    u->sec -= (d->tzo * 60);   /* changed from + to - (bug 153000) */
     d->tzo = 0;
 
     /* normalization */
index e5cc493..3bf48ac 100644 (file)
@@ -1017,17 +1017,8 @@ xsltCopyTree(xsltTransformContextPtr ctxt, xmlNodePtr node,
        if ((node->type == XML_ELEMENT_NODE) ||
            (node->type == XML_ATTRIBUTE_NODE)) {
            xmlNsPtr *nsList, *cur, ns;
-           if (node->ns != NULL)
-               copy->ns = xsltGetNamespace(ctxt, node, node->ns, copy);
-           else if ((insert->type == XML_ELEMENT_NODE) && (insert->ns != NULL)) {
-               xmlNsPtr defaultNs;
-
-               defaultNs = xmlSearchNs(insert->doc, insert, NULL);
-               if (defaultNs != NULL)
-                   xmlNewNs(copy, BAD_CAST "", NULL);
-           }
            /*
-            * must also add in any new namespaces in scope for the node
+            * must add in any new namespaces in scope for the node
             */
            nsList = xmlGetNsList(node->doc, node);
            if (nsList != NULL) {
@@ -1040,6 +1031,15 @@ xsltCopyTree(xsltTransformContextPtr ctxt, xmlNodePtr node,
                }
                xmlFree(nsList);
            }
+           if (node->ns != NULL)
+               copy->ns = xsltGetNamespace(ctxt, node, node->ns, copy);
+           else if ((insert->type == XML_ELEMENT_NODE) && (insert->ns != NULL)) {
+               xmlNsPtr defaultNs;
+
+               defaultNs = xmlSearchNs(insert->doc, insert, NULL);
+               if (defaultNs != NULL)
+                   xmlNewNs(copy, BAD_CAST "", NULL);
+           }
        }
        if (node->nsDef != NULL) {
            if (literal)
index 0671acf..39b3d9e 100644 (file)
@@ -26,4 +26,4 @@ result : 1999-12-31
 add    : 2000-01 + -P1D
 result : 1999-12-31
 add    : 1970-01-01T00:00:00-00:30 + -PT30S
-result : 1969-12-31T23:29:30Z
\ No newline at end of file
+result : 1970-01-01T00:29:30Z
\ No newline at end of file
index 4e2f570..38fe588 100644 (file)
@@ -1,2 +1,2 @@
 <?xml version="1.0" encoding="utf-8"?>
-<foo xmlns="http://example.org" xmlns:eg="http://example.org" eg:bar=""/>
+<foo xmlns:eg="http://example.org" xmlns="http://example.org" eg:bar=""/>