neilg 2002/07/26 07:16:59
Modified: java/src/org/apache/xml/serialize HTMLSerializer.java
Log:
static mutability fix. Now the XHTMLNamespace member has a sensible value, and a
method is provided so that this can be overridden by an application on a per-instance
basis.
Revision Changes Path
1.20 +12 -5 xml-xerces/java/src/org/apache/xml/serialize/HTMLSerializer.java
Index: HTMLSerializer.java
===================================================================
RCS file:
/home/cvs/xml-xerces/java/src/org/apache/xml/serialize/HTMLSerializer.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- HTMLSerializer.java 9 Jul 2002 20:48:59 -0000 1.19
+++ HTMLSerializer.java 26 Jul 2002 14:16:59 -0000 1.20
@@ -140,9 +140,10 @@
private boolean _xhtml;
- public static final String XHTMLNamespace = "";
-
+ public static final String XHTMLNamespace = "http://www.w3.org/1999/xhtml";
+ // for users to override XHTMLNamespace if need be.
+ private String fUserXHTMLNamespace = null;
/**
@@ -217,6 +218,10 @@
super.setOutputFormat( format != null ? format : new OutputFormat(
Method.HTML, "ISO-8859-1", false ) );
}
+ // Set value for alternate XHTML namespace.
+ public void setXHTMLNamespace(String newNamespace) {
+ fUserXHTMLNamespace = newNamespace;
+ } // setXHTMLNamespace(String)
//-----------------------------------------//
// SAX content handler serializing methods //
@@ -278,7 +283,8 @@
if ( namespaceURI == null )
htmlName = rawName;
else {
- if ( namespaceURI.equals( XHTMLNamespace ) )
+ if ( namespaceURI.equals( XHTMLNamespace ) ||
+ (fUserXHTMLNamespace != null &&
fUserXHTMLNamespace.equals(namespaceURI)) )
htmlName = localName;
else
htmlName = null;
@@ -420,7 +426,8 @@
if ( state.namespaceURI == null )
htmlName = state.rawName;
else {
- if ( state.namespaceURI.equals( XHTMLNamespace ) )
+ if ( state.namespaceURI.equals( XHTMLNamespace ) ||
+ (fUserXHTMLNamespace != null &&
fUserXHTMLNamespace.equals(state.namespaceURI)) )
htmlName = state.localName;
else
htmlName = null;
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]