summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam M. Brack <wbrack@src.gnome.org>2004-09-19 00:14:04 +0000
committerWilliam M. Brack <wbrack@src.gnome.org>2004-09-19 00:14:04 +0000
commit304a87beae980faedbc2a22ce3498c3791d8dd39 (patch)
tree111d23ee5169eec41f603d1c416dc412bbeeb686
parent0c2bd2e660a3bdd4a443a51132b65db272819acd (diff)
downloadlibxslt-304a87beae980faedbc2a22ce3498c3791d8dd39.tar.gz
libxslt-304a87beae980faedbc2a22ce3498c3791d8dd39.tar.bz2
libxslt-304a87beae980faedbc2a22ce3498c3791d8dd39.zip
fixed problem with timezone offset (bug 153000) changed regression test
* 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
-rw-r--r--ChangeLog15
-rw-r--r--libexslt/date.c2
-rw-r--r--libxslt/transform.c20
-rw-r--r--tests/exslt/date/add.1.out2
-rw-r--r--tests/general/bug-104.out2
5 files changed, 28 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 87ae6ed1..e6d5e075 100644
--- 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
diff --git a/libexslt/date.c b/libexslt/date.c
index 8863fa79..3cf81604 100644
--- a/libexslt/date.c
+++ b/libexslt/date.c
@@ -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 */
diff --git a/libxslt/transform.c b/libxslt/transform.c
index e5cc4930..3bf48acb 100644
--- a/libxslt/transform.c
+++ b/libxslt/transform.c
@@ -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)
diff --git a/tests/exslt/date/add.1.out b/tests/exslt/date/add.1.out
index 0671acfb..39b3d9e4 100644
--- a/tests/exslt/date/add.1.out
+++ b/tests/exslt/date/add.1.out
@@ -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
diff --git a/tests/general/bug-104.out b/tests/general/bug-104.out
index 4e2f5707..38fe588b 100644
--- a/tests/general/bug-104.out
+++ b/tests/general/bug-104.out
@@ -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=""/>