00001 /* 00002 * Copyright (c) 2000, 2020, Oracle and/or its affiliates. 00003 * 00004 * Licensed under the Universal Permissive License v 1.0 as shown at 00005 * http://oss.oracle.com/licenses/upl. 00006 */ 00007 #ifndef COH_XML_DOCUMENT_HPP 00008 #define COH_XML_DOCUMENT_HPP 00009 00010 #include "coherence/lang.ns" 00011 00012 #include "coherence/run/xml/XmlElement.hpp" 00013 00014 COH_OPEN_NAMESPACE3(coherence,run,xml) 00015 00016 00017 /** 00018 * An interface for XML document access. The XmlDocumnet interface represents 00019 * the document as both the root element (through the underlying XmlElement 00020 * interface) and the properties specific to a document, such as DOCTYPE. 00021 * 00022 * @author js 2007.12.13 00023 */ 00024 class COH_EXPORT XmlDocument 00025 : public interface_spec<XmlDocument, 00026 implements<XmlElement> > 00027 { 00028 // ----- XmlDocument interface ------------------------------------------ 00029 00030 public: 00031 /** 00032 * Get the URI of the DTD (DOCTYPE) for the document. This is referred 00033 * to as the System Identifier by the XML specification. 00034 * 00035 * For example: 00036 * http://java.sun.com/j2ee/dtds/web-app_2_2.dtd 00037 * 00038 * @return the document type URI 00039 */ 00040 virtual String::View getDtdUri() const = 0; 00041 00042 /** 00043 * Set the URI of the DTD (DOCTYPE) for the document. This is referred 00044 * to as the System Identifier by the XML specification. 00045 * 00046 * @param vsUri the document type URI 00047 */ 00048 virtual void setDtdUri(String::View vsUri) = 0; 00049 00050 /** 00051 * Get the public identifier of the DTD (DOCTYPE) for the document. 00052 * 00053 * For example: 00054 * -//Sun Microsystems, Inc.//DTD Web Application 1.2//EN 00055 * 00056 * @return the DTD public identifier 00057 */ 00058 virtual String::View getDtdName() const = 0; 00059 00060 /** 00061 * Set the public identifier of the DTD (DOCTYPE) for the document. 00062 * 00063 * @param vsName the DTD public identifier 00064 */ 00065 virtual void setDtdName(String::View vsName) = 0; 00066 00067 /** 00068 * Get the encoding string for the XML document. Documents that are 00069 * parsed may or may not have the encoding string from the persistent 00070 * form of the document. 00071 * 00072 * @return the encoding set for the document 00073 */ 00074 virtual String::View getEncoding() const = 0; 00075 00076 /** 00077 * Set the encoding string for the XML document. 00078 * 00079 * @param vsEncoding the encoding that the document will use 00080 */ 00081 virtual void setEncoding(String::View vsEncoding) = 0; 00082 00083 /** 00084 * Get the XML comment that appears outside of the root element. This 00085 * differs from the comment property of this object, which refers to 00086 * the comment within the root element. 00087 * 00088 * @return the document comment 00089 */ 00090 virtual String::View getDocumentComment() const = 0; 00091 00092 /** 00093 * Set the XML comment that appears outside of the root element. This 00094 * differs from the Comment property of this object, which refers to 00095 * the comment within the root element. 00096 * 00097 * @param vsComment the document comment 00098 */ 00099 virtual void setDocumentComment(String::View vsComment) = 0; 00100 00101 /** 00102 * @return the document as a string 00103 */ 00104 virtual String::View getXml() const = 0; 00105 }; 00106 00107 COH_CLOSE_NAMESPACE3 00108 00109 #endif // COH_XML_DOCUMENT_HPP