Adding a new parameter, aMode, to nsIContentSink::AddDocTypeDecl.

git-svn-id: svn://10.0.0.236/trunk@41447 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
nisheeth%netscape.com
1999-07-28 06:56:05 +00:00
parent f2c7500d89
commit 4aa16e828e
35 changed files with 201 additions and 84 deletions

View File

@@ -173,7 +173,7 @@ public:
NS_IMETHOD NotifyError(const nsParserError* aError);
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
// nsIHTMLContentSink
NS_IMETHOD BeginContext(PRInt32 aID);
@@ -2181,7 +2181,7 @@ nsresult HTMLContentSink::AddProcessingInstruction(const nsIParserNode& aNode) {
*/
NS_IMETHODIMP
HTMLContentSink::AddDocTypeDecl(const nsIParserNode& aNode)
HTMLContentSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
return NS_OK;
}

View File

@@ -66,7 +66,7 @@ public:
NS_IMETHOD NotifyError(const nsParserError* aError);
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
// nsIHTMLContentSink
NS_IMETHOD BeginContext(PRInt32 aID);
@@ -499,7 +499,7 @@ nsHTMLFragmentContentSink::AddProcessingInstruction(const nsIParserNode& aNode)
*/
NS_IMETHODIMP
nsHTMLFragmentContentSink::AddDocTypeDecl(const nsIParserNode& aNode)
nsHTMLFragmentContentSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
return NS_OK;
}

View File

@@ -67,16 +67,6 @@ public:
*/
NS_IMETHOD AddXMLDecl(const nsIParserNode& aNode)=0;
/**
* This method is called by the parser when it encounters
* a document type declaration.
*
* XXX Should the parser also part the internal subset?
*
* @param nsIParserNode reference to parser node interface
*/
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode)=0;
/**
* This method is called by the parser when it encounters
* character data - either regular CDATA or a marked CDATA

View File

@@ -1364,7 +1364,7 @@ nsXMLContentSink::AddProcessingInstruction(const nsIParserNode& aNode)
NS_IMETHODIMP
nsXMLContentSink::AddDocTypeDecl(const nsIParserNode& aNode)
nsXMLContentSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
printf("nsXMLContentSink::AddDocTypeDecl\n");
return NS_OK;

View File

@@ -78,10 +78,10 @@ public:
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD AddCDATASection(const nsIParserNode& aNode);
NS_IMETHOD NotifyError(const nsParserError* aError);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
// nsIXMLContentSink
NS_IMETHOD AddXMLDecl(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
NS_IMETHOD AddXMLDecl(const nsIParserNode& aNode);
NS_IMETHOD AddCharacterData(const nsIParserNode& aNode);
NS_IMETHOD AddUnparsedEntity(const nsIParserNode& aNode);
NS_IMETHOD AddNotation(const nsIParserNode& aNode);

View File

@@ -173,6 +173,14 @@ nsXSLContentSink::NotifyError(const nsParserError* aError)
return result;
}
/*
NS_IMETHODIMP
nsXSLContentSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
// We'll use nsXMLContentSink::AddDocTypeDecl() for now...
}
*/
// nsIXMLContentSink
@@ -184,14 +192,6 @@ nsXSLContentSink::AddXMLDecl(const nsIParserNode& aNode)
}
*/
/*
NS_IMETHODIMP
nsXSLContentSink::AddDocTypeDecl(const nsIParserNode& aNode)
{
// We'll use nsXMLContentSink::AddDocTypeDecl() for now...
}
*/
/*
NS_IMETHODIMP
nsXSLContentSink::AddCharacterData(const nsIParserNode& aNode)

View File

@@ -51,10 +51,10 @@ public:
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD NotifyError(const nsParserError* aError);
//NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
// nsIXMLContentSink
//NS_IMETHOD AddXMLDecl(const nsIParserNode& aNode);
//NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
//NS_IMETHOD AddXMLDecl(const nsIParserNode& aNode);
//NS_IMETHOD AddCharacterData(const nsIParserNode& aNode);
//NS_IMETHOD AddUnparsedEntity(const nsIParserNode& aNode);
//NS_IMETHOD AddNotation(const nsIParserNode& aNode);

View File

@@ -74,7 +74,7 @@ public:
NS_IMETHOD AddLeaf(const nsIParserNode& aNode);
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
NS_IMETHOD WillBuildModel(void) { return NS_OK; }
NS_IMETHOD DidBuildModel(PRInt32 aQualityLevel) { return NS_OK; }
NS_IMETHOD WillInterrupt(void) { return NS_OK; }
@@ -295,7 +295,7 @@ NS_IMETHODIMP RobotSink::AddProcessingInstruction(const nsIParserNode& aNode) {
*/
NS_IMETHODIMP
RobotSink::AddDocTypeDecl(const nsIParserNode& aNode)
RobotSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
return NS_OK;
}

View File

@@ -1146,7 +1146,7 @@ nsHTMLContentSinkStream::AddProcessingInstruction(const nsIParserNode& aNode){
*/
NS_IMETHODIMP
nsHTMLContentSinkStream::AddDocTypeDecl(const nsIParserNode& aNode)
nsHTMLContentSinkStream::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
#ifdef VERBOSE_DEBUG
DebugDump("<",aNode.GetText(),(mNodeStackPos)*2);

View File

@@ -97,7 +97,7 @@ class nsHTMLContentSinkStream : public nsIHTMLContentSink {
NS_IMETHOD NotifyError(const nsParserError* aError);
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
/*******************************************************************
* The following methods are inherited from nsIHTMLContentSink.

View File

@@ -49,7 +49,7 @@ public:
NS_IMETHOD NotifyError(const nsParserError* aError);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
// nsIHTMLContentSink
NS_IMETHOD SetTitle(const nsString& aValue);
@@ -517,7 +517,7 @@ nsHTMLNullSink::AddProcessingInstruction(const nsIParserNode& aNode){
*/
NS_IMETHODIMP
nsHTMLNullSink::AddDocTypeDecl(const nsIParserNode& aNode)
nsHTMLNullSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
#ifdef VERBOSE_DEBUG
DebugDump("<",aNode.GetText(),(mNodeStackPos)*2);

View File

@@ -595,7 +595,7 @@ nsHTMLToTXTSinkStream::AddProcessingInstruction(const nsIParserNode& aNode){
*/
NS_IMETHODIMP
nsHTMLToTXTSinkStream::AddDocTypeDecl(const nsIParserNode& aNode)
nsHTMLToTXTSinkStream::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
return NS_OK;
}

View File

@@ -86,7 +86,7 @@ class nsHTMLToTXTSinkStream : public nsIHTMLContentSink
NS_IMETHOD NotifyError(const nsParserError* aError);
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
/*******************************************************************
* The following methods are inherited from nsIHTMLContentSink.

View File

@@ -142,7 +142,7 @@ public:
*
* @param nsIParserNode reference to parser node interface
*/
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode)=0;
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)=0;
/**
* This gets called by the parser if it hits an unrecoverable

View File

@@ -85,7 +85,7 @@ public:
NS_IMETHOD NotifyError(const nsParserError* aError);
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
// nsIHTMLContentSink
NS_IMETHOD SetTitle(const nsString& aValue);
@@ -288,7 +288,7 @@ nsLoggingSink::AddProcessingInstruction(const nsIParserNode& aNode){
*/
NS_IMETHODIMP
nsLoggingSink::AddDocTypeDecl(const nsIParserNode& aNode)
nsLoggingSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
#ifdef VERBOSE_DEBUG
DebugDump("<",aNode.GetText(),(mNodeStackPos)*2);

View File

@@ -574,7 +574,7 @@ NS_IMETHODIMP CWellFormedDTD::HandleToken(CToken* aToken,nsIParser* aParser) {
}
break;
case eToken_doctypeDecl:
result = mSink->AddDocTypeDecl(theNode);
result = mSink->AddDocTypeDecl(theNode, 0);
break;
case eToken_style:
case eToken_skippedcontent:

View File

@@ -173,7 +173,7 @@ public:
NS_IMETHOD NotifyError(const nsParserError* aError);
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
// nsIHTMLContentSink
NS_IMETHOD BeginContext(PRInt32 aID);
@@ -2181,7 +2181,7 @@ nsresult HTMLContentSink::AddProcessingInstruction(const nsIParserNode& aNode) {
*/
NS_IMETHODIMP
HTMLContentSink::AddDocTypeDecl(const nsIParserNode& aNode)
HTMLContentSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
return NS_OK;
}

View File

@@ -66,7 +66,7 @@ public:
NS_IMETHOD NotifyError(const nsParserError* aError);
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
// nsIHTMLContentSink
NS_IMETHOD BeginContext(PRInt32 aID);
@@ -499,7 +499,7 @@ nsHTMLFragmentContentSink::AddProcessingInstruction(const nsIParserNode& aNode)
*/
NS_IMETHODIMP
nsHTMLFragmentContentSink::AddDocTypeDecl(const nsIParserNode& aNode)
nsHTMLFragmentContentSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
return NS_OK;
}

View File

@@ -67,16 +67,6 @@ public:
*/
NS_IMETHOD AddXMLDecl(const nsIParserNode& aNode)=0;
/**
* This method is called by the parser when it encounters
* a document type declaration.
*
* XXX Should the parser also part the internal subset?
*
* @param nsIParserNode reference to parser node interface
*/
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode)=0;
/**
* This method is called by the parser when it encounters
* character data - either regular CDATA or a marked CDATA

View File

@@ -1364,7 +1364,7 @@ nsXMLContentSink::AddProcessingInstruction(const nsIParserNode& aNode)
NS_IMETHODIMP
nsXMLContentSink::AddDocTypeDecl(const nsIParserNode& aNode)
nsXMLContentSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
printf("nsXMLContentSink::AddDocTypeDecl\n");
return NS_OK;

View File

@@ -78,10 +78,10 @@ public:
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD AddCDATASection(const nsIParserNode& aNode);
NS_IMETHOD NotifyError(const nsParserError* aError);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
// nsIXMLContentSink
NS_IMETHOD AddXMLDecl(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
NS_IMETHOD AddXMLDecl(const nsIParserNode& aNode);
NS_IMETHOD AddCharacterData(const nsIParserNode& aNode);
NS_IMETHOD AddUnparsedEntity(const nsIParserNode& aNode);
NS_IMETHOD AddNotation(const nsIParserNode& aNode);

View File

@@ -173,6 +173,14 @@ nsXSLContentSink::NotifyError(const nsParserError* aError)
return result;
}
/*
NS_IMETHODIMP
nsXSLContentSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
// We'll use nsXMLContentSink::AddDocTypeDecl() for now...
}
*/
// nsIXMLContentSink
@@ -184,14 +192,6 @@ nsXSLContentSink::AddXMLDecl(const nsIParserNode& aNode)
}
*/
/*
NS_IMETHODIMP
nsXSLContentSink::AddDocTypeDecl(const nsIParserNode& aNode)
{
// We'll use nsXMLContentSink::AddDocTypeDecl() for now...
}
*/
/*
NS_IMETHODIMP
nsXSLContentSink::AddCharacterData(const nsIParserNode& aNode)

View File

@@ -51,10 +51,10 @@ public:
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD NotifyError(const nsParserError* aError);
//NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
// nsIXMLContentSink
//NS_IMETHOD AddXMLDecl(const nsIParserNode& aNode);
//NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
//NS_IMETHOD AddXMLDecl(const nsIParserNode& aNode);
//NS_IMETHOD AddCharacterData(const nsIParserNode& aNode);
//NS_IMETHOD AddUnparsedEntity(const nsIParserNode& aNode);
//NS_IMETHOD AddNotation(const nsIParserNode& aNode);

View File

@@ -74,7 +74,7 @@ public:
NS_IMETHOD AddLeaf(const nsIParserNode& aNode);
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
NS_IMETHOD WillBuildModel(void) { return NS_OK; }
NS_IMETHOD DidBuildModel(PRInt32 aQualityLevel) { return NS_OK; }
NS_IMETHOD WillInterrupt(void) { return NS_OK; }
@@ -295,7 +295,7 @@ NS_IMETHODIMP RobotSink::AddProcessingInstruction(const nsIParserNode& aNode) {
*/
NS_IMETHODIMP
RobotSink::AddDocTypeDecl(const nsIParserNode& aNode)
RobotSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
return NS_OK;
}

View File

@@ -1146,7 +1146,7 @@ nsHTMLContentSinkStream::AddProcessingInstruction(const nsIParserNode& aNode){
*/
NS_IMETHODIMP
nsHTMLContentSinkStream::AddDocTypeDecl(const nsIParserNode& aNode)
nsHTMLContentSinkStream::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
#ifdef VERBOSE_DEBUG
DebugDump("<",aNode.GetText(),(mNodeStackPos)*2);

View File

@@ -97,7 +97,7 @@ class nsHTMLContentSinkStream : public nsIHTMLContentSink {
NS_IMETHOD NotifyError(const nsParserError* aError);
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
/*******************************************************************
* The following methods are inherited from nsIHTMLContentSink.

View File

@@ -49,7 +49,7 @@ public:
NS_IMETHOD NotifyError(const nsParserError* aError);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
// nsIHTMLContentSink
NS_IMETHOD SetTitle(const nsString& aValue);
@@ -517,7 +517,7 @@ nsHTMLNullSink::AddProcessingInstruction(const nsIParserNode& aNode){
*/
NS_IMETHODIMP
nsHTMLNullSink::AddDocTypeDecl(const nsIParserNode& aNode)
nsHTMLNullSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
#ifdef VERBOSE_DEBUG
DebugDump("<",aNode.GetText(),(mNodeStackPos)*2);

View File

@@ -595,7 +595,7 @@ nsHTMLToTXTSinkStream::AddProcessingInstruction(const nsIParserNode& aNode){
*/
NS_IMETHODIMP
nsHTMLToTXTSinkStream::AddDocTypeDecl(const nsIParserNode& aNode)
nsHTMLToTXTSinkStream::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
return NS_OK;
}

View File

@@ -86,7 +86,7 @@ class nsHTMLToTXTSinkStream : public nsIHTMLContentSink
NS_IMETHOD NotifyError(const nsParserError* aError);
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
/*******************************************************************
* The following methods are inherited from nsIHTMLContentSink.

View File

@@ -142,7 +142,7 @@ public:
*
* @param nsIParserNode reference to parser node interface
*/
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode)=0;
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)=0;
/**
* This gets called by the parser if it hits an unrecoverable

View File

@@ -85,7 +85,7 @@ public:
NS_IMETHOD NotifyError(const nsParserError* aError);
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
// nsIHTMLContentSink
NS_IMETHOD SetTitle(const nsString& aValue);
@@ -288,7 +288,7 @@ nsLoggingSink::AddProcessingInstruction(const nsIParserNode& aNode){
*/
NS_IMETHODIMP
nsLoggingSink::AddDocTypeDecl(const nsIParserNode& aNode)
nsLoggingSink::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
#ifdef VERBOSE_DEBUG
DebugDump("<",aNode.GetText(),(mNodeStackPos)*2);

View File

@@ -574,7 +574,7 @@ NS_IMETHODIMP CWellFormedDTD::HandleToken(CToken* aToken,nsIParser* aParser) {
}
break;
case eToken_doctypeDecl:
result = mSink->AddDocTypeDecl(theNode);
result = mSink->AddDocTypeDecl(theNode, 0);
break;
case eToken_style:
case eToken_skippedcontent:

View File

@@ -162,10 +162,10 @@ public:
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD NotifyError(const nsParserError* aError);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
// nsIXMLContentSink
NS_IMETHOD AddXMLDecl(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
NS_IMETHOD AddXMLDecl(const nsIParserNode& aNode);
NS_IMETHOD AddCharacterData(const nsIParserNode& aNode);
NS_IMETHOD AddUnparsedEntity(const nsIParserNode& aNode);
NS_IMETHOD AddNotation(const nsIParserNode& aNode);
@@ -634,7 +634,7 @@ RDFContentSinkImpl::AddProcessingInstruction(const nsIParserNode& aNode)
}
NS_IMETHODIMP
RDFContentSinkImpl::AddDocTypeDecl(const nsIParserNode& aNode)
RDFContentSinkImpl::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
// XXX We'll ignore it for now
PR_LOG(gLog, PR_LOG_ALWAYS,

View File

@@ -0,0 +1,137 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*/
/*
*/
#ifndef nsRDFContentSink_h__
#define nsRDFContentSink_h__
#include "nsIRDFContentSink.h"
class nsIURI;
class nsVoidArray;
class nsIRDFResource;
class nsIRDFDataSource;
class nsIRDFService;
class nsINameSpaceManager;
typedef enum {
eRDFContentSinkState_InProlog,
eRDFContentSinkState_InDocumentElement,
eRDFContentSinkState_InDescriptionElement,
eRDFContentSinkState_InContainerElement,
eRDFContentSinkState_InPropertyElement,
eRDFContentSinkState_InMemberElement,
eRDFContentSinkState_InEpilog
} RDFContentSinkState;
class RDFContentSinkImpl : public nsIRDFContentSink
{
public:
RDFContentSinkImpl();
virtual ~RDFContentSinkImpl();
// nsISupports
NS_DECL_ISUPPORTS
// nsIContentSink
NS_IMETHOD WillBuildModel(void);
NS_IMETHOD DidBuildModel(PRInt32 aQualityLevel);
NS_IMETHOD WillInterrupt(void);
NS_IMETHOD WillResume(void);
NS_IMETHOD SetParser(nsIParser* aParser);
NS_IMETHOD OpenContainer(const nsIParserNode& aNode);
NS_IMETHOD CloseContainer(const nsIParserNode& aNode);
NS_IMETHOD AddLeaf(const nsIParserNode& aNode);
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD NotifyError(nsresult aErrorResult);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
// nsIXMLContentSink
NS_IMETHOD AddXMLDecl(const nsIParserNode& aNode);
NS_IMETHOD AddCharacterData(const nsIParserNode& aNode);
NS_IMETHOD AddUnparsedEntity(const nsIParserNode& aNode);
NS_IMETHOD AddNotation(const nsIParserNode& aNode);
NS_IMETHOD AddEntityReference(const nsIParserNode& aNode);
// nsIRDFContentSink
NS_IMETHOD SetDataSource(nsIRDFDataSource* ds);
NS_IMETHOD GetDataSource(nsIRDFDataSource*& ds);
NS_IMETHOD Init(nsIURI* aURL, nsINameSpaceManager* aNameSpaceManager);
protected:
// Text management
nsresult FlushText(PRBool aCreateTextNode=PR_TRUE,
PRBool* aDidFlush=nsnull);
PRUnichar* mText;
PRInt32 mTextLength;
PRInt32 mTextSize;
PRBool mConstrainSize;
// namespace management
void PushNameSpacesFrom(const nsIParserNode& aNode);
nsIAtom* CutNameSpacePrefix(nsString& aString);
PRInt32 GetNameSpaceID(nsIAtom* aPrefix);
void GetNameSpaceURI(PRInt32 aID, nsString& aURI);
void PopNameSpaces();
nsINameSpaceManager* mNameSpaceManager;
nsVoidArray* mNameSpaceStack;
PRInt32 mRDFNameSpaceID;
void SplitQualifiedName(const nsString& aQualifiedName,
PRInt32& rNameSpaceID,
nsString& rProperty);
// RDF-specific parsing
nsresult GetIdAboutAttribute(const nsIParserNode& aNode, nsString& rResource);
nsresult GetResourceAttribute(const nsIParserNode& aNode, nsString& rResource);
nsresult AddProperties(const nsIParserNode& aNode, nsIRDFResource* aSubject);
virtual nsresult OpenRDF(const nsIParserNode& aNode);
virtual nsresult OpenObject(const nsIParserNode& aNode);
virtual nsresult OpenProperty(const nsIParserNode& aNode);
virtual nsresult OpenMember(const nsIParserNode& aNode);
virtual nsresult OpenValue(const nsIParserNode& aNode);
// Miscellaneous RDF junk
nsIRDFService* mRDFService;
nsIRDFDataSource* mDataSource;
RDFContentSinkState mState;
// content stack management
PRInt32 PushContext(nsIRDFResource *aContext, RDFContentSinkState aState);
nsresult PopContext(nsIRDFResource*& rContext, RDFContentSinkState& rState);
nsIRDFResource* GetContextElement(PRInt32 ancestor = 0);
nsVoidArray* mContextStack;
nsIURI* mDocumentURL;
PRUint32 mGenSym; // for generating anonymous resources
};
#endif // nsRDFContentSink_h__

View File

@@ -164,10 +164,10 @@ public:
NS_IMETHOD AddComment(const nsIParserNode& aNode);
NS_IMETHOD AddProcessingInstruction(const nsIParserNode& aNode);
NS_IMETHOD NotifyError(const nsParserError* aError);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode=0);
// nsIXMLContentSink
NS_IMETHOD AddXMLDecl(const nsIParserNode& aNode);
NS_IMETHOD AddDocTypeDecl(const nsIParserNode& aNode);
NS_IMETHOD AddXMLDecl(const nsIParserNode& aNode);
NS_IMETHOD AddCharacterData(const nsIParserNode& aNode);
NS_IMETHOD AddUnparsedEntity(const nsIParserNode& aNode);
NS_IMETHOD AddNotation(const nsIParserNode& aNode);
@@ -968,7 +968,7 @@ XULContentSinkImpl::AddProcessingInstruction(const nsIParserNode& aNode)
}
NS_IMETHODIMP
XULContentSinkImpl::AddDocTypeDecl(const nsIParserNode& aNode)
XULContentSinkImpl::AddDocTypeDecl(const nsIParserNode& aNode, PRInt32 aMode)
{
PR_LOG(gLog, PR_LOG_WARNING,
("xul: ignoring doctype decl at line %d", aNode.GetSourceLineNumber()));