morten 01/10/25 08:48:12
Modified: java/src/org/apache/xalan/xsltc/compiler Stylesheet.java
java/src/org/apache/xalan/xsltc/dom DOMImpl.java
java/src/org/apache/xalan/xsltc/runtime TextOutput.java
Log:
Fixed the general handling of the XML namespace mapping.
PR: bugzilla 4331
Obtained from: n/a
Submitted by: [EMAIL PROTECTED]
Reviewed by: [EMAIL PROTECTED]
Revision Changes Path
1.25 +3 -2
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Stylesheet.java
Index: Stylesheet.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Stylesheet.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- Stylesheet.java 2001/10/25 10:23:32 1.24
+++ Stylesheet.java 2001/10/25 15:48:11 1.25
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: Stylesheet.java,v 1.24 2001/10/25 10:23:32 morten Exp $
+ * @(#)$Id: Stylesheet.java,v 1.25 2001/10/25 15:48:11 morten Exp $
*
* The Apache Software License, Version 1.1
*
@@ -306,7 +306,8 @@
_version = getAttribute("version");
- addPrefixMapping("xml", "xml"); // Make sure 'xml' maps to 'xml'
+ //addPrefixMapping("xml", "xml"); // Make sure 'xml' maps to 'xml'
+ addPrefixMapping("xml", "http://www.w3.org/XML/1998/namespace");
// Report and error if more than one stylesheet defined
final Stylesheet sheet = stable.addStylesheet(_name, this);
1.54 +9 -9
xml-xalan/java/src/org/apache/xalan/xsltc/dom/DOMImpl.java
Index: DOMImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/DOMImpl.java,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- DOMImpl.java 2001/10/19 09:14:16 1.53
+++ DOMImpl.java 2001/10/25 15:48:12 1.54
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: DOMImpl.java,v 1.53 2001/10/19 09:14:16 morten Exp $
+ * @(#)$Id: DOMImpl.java,v 1.54 2001/10/25 15:48:12 morten Exp $
*
* The Apache Software License, Version 1.1
*
@@ -144,6 +144,9 @@
private static NodeList EmptyNodeList;
private static NamedNodeMap EmptyNamedNodeMap;
+ private final static String XML_LANG_ATTRIBUTE =
+ "http://www.w3.org/XML/1998/namespace:@lang";
+
/**
* Define the origin of the document from which the tree was built
*/
@@ -2717,7 +2720,7 @@
* Returns a node' defined language for a node (if any)
*/
public String getLanguage(int node) {
- final Integer langType = (Integer)_types.get("xml:@lang");
+ final Integer langType = (Integer)_types.get(XML_LANG_ATTRIBUTE);
if (langType != null) {
final int type = langType.intValue();
while (node != DOM.NULL) {
@@ -3078,14 +3081,11 @@
if (qname.startsWith(XML_STRING)) {
if (qname.startsWith(XMLSPACE_STRING))
xmlSpaceDefine(attList.getValue(i), parent);
- namebuf.append("xml:");
}
- else {
- final String uri = attList.getURI(i);
- if ((uri != null) && (!uri.equals(EMPTYSTRING))) {
- namebuf.append(uri);
- namebuf.append(':');
- }
+ final String uri = attList.getURI(i);
+ if ((uri != null) && (!uri.equals(EMPTYSTRING))) {
+ namebuf.append(uri);
+ namebuf.append(':');
}
namebuf.append('@');
if (localname != null )
1.39 +2 -1
xml-xalan/java/src/org/apache/xalan/xsltc/runtime/TextOutput.java
Index: TextOutput.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/runtime/TextOutput.java,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- TextOutput.java 2001/10/16 10:46:56 1.38
+++ TextOutput.java 2001/10/25 15:48:12 1.39
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: TextOutput.java,v 1.38 2001/10/16 10:46:56 morten Exp $
+ * @(#)$Id: TextOutput.java,v 1.39 2001/10/25 15:48:12 morten Exp $
*
* The Apache Software License, Version 1.1
*
@@ -704,6 +704,7 @@
namespace(EMPTYSTRING, value);
else
namespace(name.substring(6),value);
+ return;
}
// Output as xml:<blah> attribute
_attributes.add(name, value);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]