diff --git a/ChangeLog b/ChangeLog
index 57eb514612470ad6097d3300d9d8a173caf8710f_Q2hhbmdlTG9n..875be67981ae9139c29543fa0ad76a6fdca2d6d0_Q2hhbmdlTG9n 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu Nov 14 15:10:13 CET 2002 Daniel Veillard <daniel@veillard.com>
+
+	* libxslt/transform.c: applied patch from Brian McCauley fixing #95493 
+	* doc/xsltproc.xml: fixing #95510 missing description of --writesubtree
+	* README: fix the bug page URL
+
 Thu Nov 14 10:03:12 CET 2002 Daniel Veillard <daniel@veillard.com>
 
 	* libxslt/functions.c: make sure the fixup for key() reported
diff --git a/README b/README
index 57eb514612470ad6097d3300d9d8a173caf8710f_UkVBRE1F..875be67981ae9139c29543fa0ad76a6fdca2d6d0_UkVBRE1F 100644
--- a/README
+++ b/README
@@ -7,7 +7,7 @@
 This code is released under the MIT Licence see the Copyright file.
  
 To report bugs, follow the instructions at:
-  http://xmlsoft.org/XSLT/bug.html
+  http://xmlsoft.org/XSLT/bugs.html
 
 A mailing-list xslt@gnome.org is available, to subscribe:
     http://mail.gnome.org/mailman/listinfo/xslt
diff --git a/doc/xsltproc.xml b/doc/xsltproc.xml
index 57eb514612470ad6097d3300d9d8a173caf8710f_ZG9jL3hzbHRwcm9jLnhtbA==..875be67981ae9139c29543fa0ad76a6fdca2d6d0_ZG9jL3hzbHRwcm9jLnhtbA== 100644
--- a/doc/xsltproc.xml
+++ b/doc/xsltproc.xml
@@ -52,6 +52,7 @@
 	<arg>--dumpextensions</arg>
 	<arg>--nowrite</arg>
 	<arg>--nomkdir</arg>
+	<arg>--writesubtree</arg>
       </group>
       <arg><option><replaceable>stylesheet</replaceable></option></arg>
       <arg><replaceable>file1</replaceable></arg>
@@ -318,6 +319,16 @@
 	</listitem>
       </varlistentry>
     
+      <varlistentry>
+	<term>
+      <option>--writesubtree</option> <replaceable>path</replaceable></term>
+	<listitem>
+	  <simpara>Allow file write only within the
+	  <replaceable>path</replaceable> subtree.
+    </simpara>
+	</listitem>
+      </varlistentry>
+    
     
     </variablelist>
   </refsect1>
diff --git a/libxslt/transform.c b/libxslt/transform.c
index 57eb514612470ad6097d3300d9d8a173caf8710f_bGlieHNsdC90cmFuc2Zvcm0uYw==..875be67981ae9139c29543fa0ad76a6fdca2d6d0_bGlieHNsdC90cmFuc2Zvcm0uYw== 100644
--- a/libxslt/transform.c
+++ b/libxslt/transform.c
@@ -1372,4 +1372,6 @@
                 xmlNsPtr ns, ret;
 
                 for (i = 0; i < ctxt->templ->inheritedNsNr; i++) {
+		    const xmlChar *URI = NULL;
+		    xsltStylesheetPtr style;
                     ns = ctxt->templ->inheritedNs[i];
@@ -1375,27 +1377,26 @@
                     ns = ctxt->templ->inheritedNs[i];
-                    if (ctxt->style->nsAliases != NULL) {
-                        const xmlChar *URI;
-
-                        URI = (const xmlChar *)
-                            xmlHashLookup(ctxt->style->nsAliases,
-                                          ns->href);
-                        if (URI == NULL) {
-                            ret = xmlSearchNs(copy->doc, copy, ns->prefix);
-                            if ((ret == NULL) ||
-                                (!xmlStrEqual(ret->href, ns->href)))
-                                xmlNewNs(copy, ns->href, ns->prefix);
-                        } else if (!xmlStrEqual(URI, XSLT_NAMESPACE)) {
-                            ret = xmlSearchNs(copy->doc, copy, ns->prefix);
-                            if ((ret == NULL) ||
-                                (!xmlStrEqual(ret->href, URI)))
-                                xmlNewNs(copy, URI, ns->prefix);
-                        }
-                    } else {
-                        ret = xmlSearchNs(copy->doc, copy, ns->prefix);
-                        if ((ret == NULL) ||
-                            (!xmlStrEqual(ret->href, ns->href)))
-                            xmlNewNs(copy, ns->href, ns->prefix);
-                    }
+		    style = ctxt->style;
+		    while (style != NULL) {
+		      if (style->nsAliases != NULL)
+			URI = (const xmlChar *) 
+			  xmlHashLookup(style->nsAliases, ns->href);
+		      if (URI != NULL)
+			break;
+		      
+		      style = xsltNextImport(style);
+		    }
+
+		    if (URI == NULL) {
+		      ret = xmlSearchNs(copy->doc, copy, ns->prefix);
+		      if ((ret == NULL) ||
+			  (!xmlStrEqual(ret->href, ns->href)))
+			xmlNewNs(copy, ns->href, ns->prefix);
+		    } else if (!xmlStrEqual(URI, XSLT_NAMESPACE)) {
+		      ret = xmlSearchNs(copy->doc, copy, ns->prefix);
+		      if ((ret == NULL) ||
+			  (!xmlStrEqual(ret->href, URI)))
+			xmlNewNs(copy, URI, ns->prefix);
+		    }
                 }
 		if (copy->ns != NULL) {
 		    /*