< prev index next >

src/java.xml/share/classes/com/sun/org/apache/xml/internal/serialize/HTMLSerializer.java

Print this page


   1 /*
   2  * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
   3  */
   4 /*
   5  * Licensed to the Apache Software Foundation (ASF) under one or more
   6  * contributor license agreements.  See the NOTICE file distributed with
   7  * this work for additional information regarding copyright ownership.
   8  * The ASF licenses this file to You under the Apache License, Version 2.0
   9  * (the "License"); you may not use this file except in compliance with
  10  * the License.  You may obtain a copy of the License at
  11  *
  12  *      http://www.apache.org/licenses/LICENSE-2.0
  13  *
  14  * Unless required by applicable law or agreed to in writing, software
  15  * distributed under the License is distributed on an "AS IS" BASIS,
  16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17  * See the License for the specific language governing permissions and
  18  * limitations under the License.
  19  */
  20 
  21 
  22 // Sep 14, 2000:


  75  * the serializer will potentially break long text lines at space
  76  * boundaries, indent lines, and serialize elements on separate
  77  * lines. Line terminators will be regarded as spaces, and
  78  * spaces at beginning of line will be stripped.
  79  * <p>
  80  * XHTML is slightly different than HTML:
  81  * <ul>
  82  * <li>Element/attribute names are lower case and case matters
  83  * <li>Attributes must specify value, even if empty string
  84  * <li>Empty elements must have '/' in empty tag
  85  * <li>Contents of SCRIPT and STYLE elements serialized as CDATA
  86  * </ul>
  87  *
  88  * @deprecated This class was deprecated in Xerces 2.6.2. It is
  89  * recommended that new applications use JAXP's Transformation API
  90  * for XML (TrAX) for serializing HTML. See the Xerces documentation
  91  * for more information.
  92  * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
  93  * @see Serializer
  94  */

  95 public class HTMLSerializer
  96     extends BaseMarkupSerializer
  97 {
  98 
  99 
 100     /**
 101      * True if serializing in XHTML format.
 102      */
 103     private boolean _xhtml;
 104 
 105 
 106     public static final String XHTMLNamespace = "http://www.w3.org/1999/xhtml";
 107 
 108     // for users to override XHTMLNamespace if need be.
 109     private String fUserXHTMLNamespace = null;
 110 
 111 
 112     /**
 113      * Constructs a new HTML/XHTML serializer depending on the value of
 114      * <tt>xhtml</tt>. The serializer cannot be used without calling


   1 /*
   2  * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved.
   3  */
   4 /*
   5  * Licensed to the Apache Software Foundation (ASF) under one or more
   6  * contributor license agreements.  See the NOTICE file distributed with
   7  * this work for additional information regarding copyright ownership.
   8  * The ASF licenses this file to You under the Apache License, Version 2.0
   9  * (the "License"); you may not use this file except in compliance with
  10  * the License.  You may obtain a copy of the License at
  11  *
  12  *      http://www.apache.org/licenses/LICENSE-2.0
  13  *
  14  * Unless required by applicable law or agreed to in writing, software
  15  * distributed under the License is distributed on an "AS IS" BASIS,
  16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17  * See the License for the specific language governing permissions and
  18  * limitations under the License.
  19  */
  20 
  21 
  22 // Sep 14, 2000:


  75  * the serializer will potentially break long text lines at space
  76  * boundaries, indent lines, and serialize elements on separate
  77  * lines. Line terminators will be regarded as spaces, and
  78  * spaces at beginning of line will be stripped.
  79  * <p>
  80  * XHTML is slightly different than HTML:
  81  * <ul>
  82  * <li>Element/attribute names are lower case and case matters
  83  * <li>Attributes must specify value, even if empty string
  84  * <li>Empty elements must have '/' in empty tag
  85  * <li>Contents of SCRIPT and STYLE elements serialized as CDATA
  86  * </ul>
  87  *
  88  * @deprecated This class was deprecated in Xerces 2.6.2. It is
  89  * recommended that new applications use JAXP's Transformation API
  90  * for XML (TrAX) for serializing HTML. See the Xerces documentation
  91  * for more information.
  92  * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
  93  * @see Serializer
  94  */
  95 @Deprecated
  96 public class HTMLSerializer
  97     extends BaseMarkupSerializer
  98 {
  99 
 100 
 101     /**
 102      * True if serializing in XHTML format.
 103      */
 104     private boolean _xhtml;
 105 
 106 
 107     public static final String XHTMLNamespace = "http://www.w3.org/1999/xhtml";
 108 
 109     // for users to override XHTMLNamespace if need be.
 110     private String fUserXHTMLNamespace = null;
 111 
 112 
 113     /**
 114      * Constructs a new HTML/XHTML serializer depending on the value of
 115      * <tt>xhtml</tt>. The serializer cannot be used without calling


< prev index next >