1 /*
2 * Copyright (c) 2006, 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 * $Id: AbstractTranslet.java,v 1.6 2006/06/19 19:49:03 spericas Exp $
22 */
23
24 package com.sun.org.apache.xalan.internal.xsltc.runtime;
25
26 import com.sun.org.apache.xalan.internal.XalanConstants;
27 import com.sun.org.apache.xalan.internal.utils.FactoryImpl;
28 import com.sun.org.apache.xalan.internal.xsltc.DOM;
29 import com.sun.org.apache.xalan.internal.xsltc.DOMCache;
30 import com.sun.org.apache.xalan.internal.xsltc.DOMEnhancedForDTM;
31 import com.sun.org.apache.xalan.internal.xsltc.Translet;
32 import com.sun.org.apache.xalan.internal.xsltc.TransletException;
33 import com.sun.org.apache.xalan.internal.xsltc.dom.DOMAdapter;
34 import com.sun.org.apache.xalan.internal.xsltc.dom.KeyIndex;
35 import com.sun.org.apache.xalan.internal.xsltc.runtime.output.TransletOutputHandlerFactory;
36 import com.sun.org.apache.xml.internal.dtm.DTM;
37 import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
38 import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
39 import com.sun.org.apache.xml.internal.serializer.ToStream;
40 import java.io.BufferedOutputStream;
41 import java.io.File;
42 import java.io.FileOutputStream;
668 }
669 }
670
671 /**
672 * Transfer the output settings to the output post-processor
673 */
674 protected void transferOutputSettings(SerializationHandler handler) {
675 if (_method != null) {
676 if (_method.equals("xml")) {
677 if (_standalone != null) {
678 handler.setStandalone(_standalone);
679 }
680 if (_omitHeader) {
681 handler.setOmitXMLDeclaration(true);
682 }
683 handler.setCdataSectionElements(_cdata);
684 if (_version != null) {
685 handler.setVersion(_version);
686 }
687 handler.setIndent(_indent);
688 handler.setIndentAmount(_indentamount);
689 if (_doctypeSystem != null) {
690 handler.setDoctype(_doctypeSystem, _doctypePublic);
691 }
692 handler.setIsStandalone(_isStandalone);
693 }
694 else if (_method.equals("html")) {
695 handler.setIndent(_indent);
696 handler.setDoctype(_doctypeSystem, _doctypePublic);
697 if (_mediaType != null) {
698 handler.setMediaType(_mediaType);
699 }
700 }
701 }
702 else {
703 handler.setCdataSectionElements(_cdata);
704 if (_version != null) {
705 handler.setVersion(_version);
706 }
707 if (_standalone != null) {
|
1 /*
2 * Copyright (c) 2006, 2016, 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 package com.sun.org.apache.xalan.internal.xsltc.runtime;
22
23 import com.sun.org.apache.xalan.internal.XalanConstants;
24 import com.sun.org.apache.xalan.internal.utils.FactoryImpl;
25 import com.sun.org.apache.xalan.internal.xsltc.DOM;
26 import com.sun.org.apache.xalan.internal.xsltc.DOMCache;
27 import com.sun.org.apache.xalan.internal.xsltc.DOMEnhancedForDTM;
28 import com.sun.org.apache.xalan.internal.xsltc.Translet;
29 import com.sun.org.apache.xalan.internal.xsltc.TransletException;
30 import com.sun.org.apache.xalan.internal.xsltc.dom.DOMAdapter;
31 import com.sun.org.apache.xalan.internal.xsltc.dom.KeyIndex;
32 import com.sun.org.apache.xalan.internal.xsltc.runtime.output.TransletOutputHandlerFactory;
33 import com.sun.org.apache.xml.internal.dtm.DTM;
34 import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
35 import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
36 import com.sun.org.apache.xml.internal.serializer.ToStream;
37 import java.io.BufferedOutputStream;
38 import java.io.File;
39 import java.io.FileOutputStream;
665 }
666 }
667
668 /**
669 * Transfer the output settings to the output post-processor
670 */
671 protected void transferOutputSettings(SerializationHandler handler) {
672 if (_method != null) {
673 if (_method.equals("xml")) {
674 if (_standalone != null) {
675 handler.setStandalone(_standalone);
676 }
677 if (_omitHeader) {
678 handler.setOmitXMLDeclaration(true);
679 }
680 handler.setCdataSectionElements(_cdata);
681 if (_version != null) {
682 handler.setVersion(_version);
683 }
684 handler.setIndent(_indent);
685 if (_indentamount >= 0)
686 handler.setIndentAmount(_indentamount);
687 if (_doctypeSystem != null) {
688 handler.setDoctype(_doctypeSystem, _doctypePublic);
689 }
690 handler.setIsStandalone(_isStandalone);
691 }
692 else if (_method.equals("html")) {
693 handler.setIndent(_indent);
694 handler.setDoctype(_doctypeSystem, _doctypePublic);
695 if (_mediaType != null) {
696 handler.setMediaType(_mediaType);
697 }
698 }
699 }
700 else {
701 handler.setCdataSectionElements(_cdata);
702 if (_version != null) {
703 handler.setVersion(_version);
704 }
705 if (_standalone != null) {
|