mkwan 2002/10/03 12:08:44
Modified: java/src/org/apache/xalan/templates Constants.java
ElemTemplateElement.java OutputProperties.java
output_html.properties output_text.properties
output_xml.properties
Log:
Use one namespace for all extensions (Bugzilla 9959)
Use the new namespace uri "http://xml.apache.org/xalan" instead of
"http://xml.apache.org/xslt" for xsl:output extension attributes.
Revision Changes Path
1.16 +9 -2
xml-xalan/java/src/org/apache/xalan/templates/Constants.java
Index: Constants.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/Constants.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- Constants.java 6 Sep 2002 16:17:46 -0000 1.15
+++ Constants.java 3 Oct 2002 19:08:43 -0000 1.16
@@ -102,12 +102,19 @@
S_VENDORURL = "http://xml.apache.org";
/** S_BUILTIN_EXTENSIONS_URL is a mnemonic for the XML Namespace
- *(http://xml.apache.org/xslt) predefined to signify Xalan's
+ *(http://xml.apache.org/xalan) predefined to signify Xalan's
* built-in XSLT Extensions. When used in stylesheets, this is often
* bound to the "xalan:" prefix.
*/
public static final String
- S_BUILTIN_EXTENSIONS_URL = "http://xml.apache.org/xslt";
+ S_BUILTIN_EXTENSIONS_URL = "http://xml.apache.org/xalan";
+
+ /**
+ * The old built-in extension url. It is still supported for
+ * backward compatibility.
+ */
+ public static final String
+ S_BUILTIN_OLD_EXTENSIONS_URL = "http://xml.apache.org/xslt";
/**
* Xalan extension namespaces.
1.54 +2 -1
xml-xalan/java/src/org/apache/xalan/templates/ElemTemplateElement.java
Index: ElemTemplateElement.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemTemplateElement.java,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- ElemTemplateElement.java 10 Jun 2002 21:34:40 -0000 1.53
+++ ElemTemplateElement.java 3 Oct 2002 19:08:44 -0000 1.54
@@ -1058,7 +1058,8 @@
{
if (uri.equals(Constants.S_XSLNAMESPACEURL)
|| getStylesheet().containsExtensionElementURI(uri)
- || uri.equals(Constants.S_BUILTIN_EXTENSIONS_URL))
+ || uri.equals(Constants.S_BUILTIN_EXTENSIONS_URL)
+ || uri.equals(Constants.S_BUILTIN_OLD_EXTENSIONS_URL))
return true;
if (containsExcludeResultPrefix(prefix, uri))
1.22 +14 -0
xml-xalan/java/src/org/apache/xalan/templates/OutputProperties.java
Index: OutputProperties.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/OutputProperties.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- OutputProperties.java 13 Sep 2002 17:50:24 -0000 1.21
+++ OutputProperties.java 3 Oct 2002 19:08:44 -0000 1.22
@@ -143,6 +143,14 @@
"{"+Constants.S_BUILTIN_EXTENSIONS_URL+"}";
/**
+ * The old built-in extension namespace
+ */
+ static final String S_BUILTIN_OLD_EXTENSIONS_UNIVERSAL=
+ "{"+Constants.S_BUILTIN_OLD_EXTENSIONS_URL+"}";
+
+ static final int S_BUILTIN_OLD_EXTENSIONS_UNIVERSAL_LEN =
S_BUILTIN_OLD_EXTENSIONS_UNIVERSAL.length();
+
+ /**
* Fix up a string in an output properties file according to
* the rules of [EMAIL PROTECTED] #loadPropertiesFile}.
*
@@ -418,6 +426,10 @@
{
setMethodDefaults(value);
}
+
+ if (key.startsWith(S_BUILTIN_OLD_EXTENSIONS_UNIVERSAL))
+ key = S_BUILTIN_EXTENSIONS_UNIVERSAL +
key.substring(S_BUILTIN_OLD_EXTENSIONS_UNIVERSAL_LEN);
+
m_properties.put(key, value);
}
@@ -446,6 +458,8 @@
*/
public String getProperty(String key)
{
+ if (key.startsWith(S_BUILTIN_OLD_EXTENSIONS_UNIVERSAL))
+ key = S_BUILTIN_EXTENSIONS_UNIVERSAL +
key.substring(S_BUILTIN_OLD_EXTENSIONS_UNIVERSAL_LEN);
return m_properties.getProperty(key);
}
1.9 +6 -6
xml-xalan/java/src/org/apache/xalan/templates/output_html.properties
Index: output_html.properties
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/output_html.properties,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- output_html.properties 10 Oct 2001 18:44:34 -0000 1.8
+++ output_html.properties 3 Oct 2002 19:08:44 -0000 1.9
@@ -13,13 +13,13 @@
# assigning a xalan namespace. For example:
# <xsl:stylesheet version="1.0"
# xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-# xmlns:xalan="http://xml.apache.org/xslt">
+# xmlns:xalan="http://xml.apache.org/xalan">
# <xsl:output method="html" encoding="UTF-8"
# xalan:content-handler="MyContentHandler"/>
# ...
# Note that the colon after the protocol needs to be escaped.
-{http\u003a//xml.apache.org/xslt}indent-amount=0
-{http\u003a//xml.apache.org/xslt}content-handler=org.apache.xalan.serialize.SerializerToHTML
-{http\u003a//xml.apache.org/xslt}entities=org/apache/xalan/serialize/HTMLEntities.res
-{http\u003a//xml.apache.org/xslt}use-url-escaping=yes
-{http\u003a//xml.apache.org/xslt}omit-meta-tag=no
+{http\u003a//xml.apache.org/xalan}indent-amount=0
+{http\u003a//xml.apache.org/xalan}content-handler=org.apache.xalan.serialize.SerializerToHTML
+{http\u003a//xml.apache.org/xalan}entities=org/apache/xalan/serialize/HTMLEntities.res
+{http\u003a//xml.apache.org/xalan}use-url-escaping=yes
+{http\u003a//xml.apache.org/xalan}omit-meta-tag=no
1.5 +2 -2
xml-xalan/java/src/org/apache/xalan/templates/output_text.properties
Index: output_text.properties
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/output_text.properties,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- output_text.properties 2 Jan 2001 03:36:47 -0000 1.4
+++ output_text.properties 3 Oct 2002 19:08:44 -0000 1.5
@@ -10,9 +10,9 @@
# assigning a xalan namespace. For example:
# <xsl:stylesheet version="1.0"
# xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-# xmlns:xalan="http://xml.apache.org/xslt">
+# xmlns:xalan="http://xml.apache.org/xalan">
# <xsl:output method="html" encoding="UTF-8"
# xalan:content-handler="MyContentHandler"/>
# ...
# Note that the colon after the protocol needs to be escaped.
-{http\u003a//xml.apache.org/xslt}content-handler=org.apache.xalan.serialize.SerializerToText
\ No newline at end of file
+{http\u003a//xml.apache.org/xalan}content-handler=org.apache.xalan.serialize.SerializerToText
\ No newline at end of file
1.4 +4 -4
xml-xalan/java/src/org/apache/xalan/templates/output_xml.properties
Index: output_xml.properties
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/output_xml.properties,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- output_xml.properties 10 Oct 2001 18:44:34 -0000 1.3
+++ output_xml.properties 3 Oct 2002 19:08:44 -0000 1.4
@@ -16,12 +16,12 @@
# assigning a xalan namespace. For example:
# <xsl:stylesheet version="1.0"
# xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-# xmlns:xalan="http://xml.apache.org/xslt">
+# xmlns:xalan="http://xml.apache.org/xalan">
# <xsl:output method="html" encoding="UTF-8"
# xalan:content-handler="MyContentHandler"/>
# ...
# Note that the colon after the protocol needs to be escaped.
-{http\u003a//xml.apache.org/xslt}indent-amount=0
-{http\u003a//xml.apache.org/xslt}content-handler=org.apache.xalan.serialize.SerializerToXML
-{http\u003a//xml.apache.org/xslt}entities=org/apache/xalan/serialize/XMLEntities.res
+{http\u003a//xml.apache.org/xalan}indent-amount=0
+{http\u003a//xml.apache.org/xalan}content-handler=org.apache.xalan.serialize.SerializerToXML
+{http\u003a//xml.apache.org/xalan}entities=org/apache/xalan/serialize/XMLEntities.res
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]