nsIXMLContentSink.h (2151B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 #ifndef nsIXMLContentSink_h___ 7 #define nsIXMLContentSink_h___ 8 9 #include "nsIContentSink.h" 10 #include "nsISupports.h" 11 12 class nsIURI; 13 class nsIChannel; 14 namespace mozilla::dom { 15 class Document; 16 } // namespace mozilla::dom 17 18 #define NS_IXMLCONTENT_SINK_IID \ 19 {0x63fedea0, 0x9b0f, 0x4d64, {0x9b, 0xa5, 0x37, 0xc6, 0x99, 0x73, 0x29, 0x35}} 20 21 /** 22 * This interface represents a content sink for generic XML files. 23 * The goal of this sink is to deal with XML documents that do not 24 * have pre-built semantics, though it may also be implemented for 25 * cases in which semantics are hard-wired. 26 * 27 * The expectation is that the parser has already performed 28 * well-formedness and validity checking. 29 * 30 * XXX The expectation is that entity expansion will be done by the sink 31 * itself. This would require, however, that the sink has the ability 32 * to query the parser for entity replacement text. 33 * 34 * XXX This interface does not contain a mechanism for the sink to 35 * get specific schema/DTD information from the parser. This information 36 * may be necessary for entity expansion. It is also necessary for 37 * building the DOM portions that relate to the schema. 38 * 39 * XXX This interface does not deal with the presence of an external 40 * subset. It seems possible that this could be dealt with completely 41 * at the parser level. 42 */ 43 44 class nsIXMLContentSink : public nsIContentSink { 45 public: 46 NS_INLINE_DECL_STATIC_IID(NS_IXMLCONTENT_SINK_IID) 47 virtual bool IsPrettyPrintXML() const { return false; } 48 virtual bool IsPrettyPrintHasSpecialRoot() const { return false; } 49 }; 50 51 nsresult NS_NewXMLContentSink(nsIXMLContentSink** aInstancePtrResult, 52 mozilla::dom::Document* aDoc, nsIURI* aURL, 53 nsISupports* aContainer, nsIChannel* aChannel); 54 55 #endif // nsIXMLContentSink_h___