Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
nsXMLContentSink.cpp File Reference
#include "nsCOMPtr.h"
#include "nsXMLContentSink.h"
#include "nsIParser.h"
#include "nsIUnicharInputStream.h"
#include "nsIDocument.h"
#include "nsIDOMDocument.h"
#include "nsIDOMDocumentType.h"
#include "nsIDOMDOMImplementation.h"
#include "nsIDOMNSDocument.h"
#include "nsIXMLContent.h"
#include "nsIScriptGlobalObject.h"
#include "nsIURI.h"
#include "nsNetUtil.h"
#include "nsIDocShell.h"
#include "nsIDocShellTreeItem.h"
#include "nsIContent.h"
#include "nsITextContent.h"
#include "nsIStyleSheetLinkingElement.h"
#include "nsPresContext.h"
#include "nsIPresShell.h"
#include "nsIViewManager.h"
#include "nsIDOMComment.h"
#include "nsIDOMCDATASection.h"
#include "nsDOMDocumentType.h"
#include "nsHTMLParts.h"
#include "nsVoidArray.h"
#include "nsCRT.h"
#include "nsICSSLoader.h"
#include "nsICSSStyleSheet.h"
#include "nsHTMLAtoms.h"
#include "nsContentUtils.h"
#include "nsLayoutAtoms.h"
#include "nsIScriptContext.h"
#include "nsINameSpaceManager.h"
#include "nsIServiceManager.h"
#include "nsIScriptSecurityManager.h"
#include "nsIContentViewer.h"
#include "prtime.h"
#include "prlog.h"
#include "prmem.h"
#include "nsParserUtils.h"
#include "nsRect.h"
#include "nsGenericElement.h"
#include "nsIWebNavigation.h"
#include "nsIScriptElement.h"
#include "nsIScriptLoader.h"
#include "nsStyleLinkElement.h"
#include "nsIImageLoadingContent.h"
#include "nsReadableUtils.h"
#include "nsUnicharUtils.h"
#include "nsICookieService.h"
#include "nsIPrompt.h"
#include "nsIDOMWindowInternal.h"
#include "nsIChannel.h"
#include "nsIPrincipal.h"
#include "nsXBLAtoms.h"
#include "nsXMLPrettyPrinter.h"
#include "nsNodeInfoManager.h"
#include "nsContentCreatorFunctions.h"
#include "nsIContentPolicy.h"
#include "nsContentPolicyUtils.h"
#include "nsIDOMProcessingInstruction.h"

Go to the source code of this file.

Defines

#define kXSLType   "text/xsl"
#define NS_ACCUMULATION_BUFFER_SIZE   4096

Functions

nsresult NS_NewXMLContentSink (nsIXMLContentSink **aResult, nsIDocument *aDoc, nsIURI *aURI, nsISupports *aContainer, nsIChannel *aChannel)
 NS_IMPL_ISUPPORTS_INHERITED4 (nsXMLContentSink, nsContentSink, nsIContentSink, nsIXMLContentSink, nsIExpatSink, nsITransformObserver) NS_IMETHODIMP nsXMLContentSink
static void CheckXSLTParamPI (nsIDOMProcessingInstruction *aPi, nsIDocumentTransformer *aProcessor, nsIDocument *aDocument)

Variables

static const char kLoadAsData [] = "loadAsData"

Define Documentation

#define kXSLType   "text/xsl"

Definition at line 106 of file nsXMLContentSink.cpp.

Definition at line 1406 of file nsXMLContentSink.cpp.


Function Documentation

static void CheckXSLTParamPI ( nsIDOMProcessingInstruction aPi,
nsIDocumentTransformer aProcessor,
nsIDocument aDocument 
) [static]

Definition at line 235 of file nsXMLContentSink.cpp.

{
  nsAutoString target, data;
  aPi->GetTarget(target);

  nsCOMPtr<nsIDocumentTransformer_1_8_BRANCH> proc = do_QueryInterface(aProcessor);

  // Check for namespace declarations
  if (target.EqualsLiteral("xslt-param-namespace")) {
    aPi->GetData(data);
    nsAutoString prefix, namespaceAttr;
    nsParserUtils::GetQuotedAttributeValue(data, nsHTMLAtoms::prefix,
                                           prefix, PR_TRUE);
    if (!prefix.IsEmpty() &&
        nsParserUtils::GetQuotedAttributeValue(data, nsHTMLAtoms::_namespace,
                                               namespaceAttr, PR_TRUE)) {
      proc->AddXSLTParamNamespace(prefix, namespaceAttr);
    }
  }

  // Check for actual parameters
  else if (target.EqualsLiteral("xslt-param")) {
    aPi->GetData(data);
    nsAutoString name, namespaceAttr, select, value;
    nsParserUtils::GetQuotedAttributeValue(data, nsHTMLAtoms::name,
                                           name, PR_TRUE);
    nsParserUtils::GetQuotedAttributeValue(data, nsHTMLAtoms::_namespace,
                                           namespaceAttr, PR_TRUE);
    if (!nsParserUtils::GetQuotedAttributeValue(data, nsHTMLAtoms::select,
                                                select, PR_TRUE)) {
      select.SetIsVoid(PR_TRUE);
    }
    if (!nsParserUtils::GetQuotedAttributeValue(data, nsHTMLAtoms::value, value,
                                                PR_TRUE)) {
      value.SetIsVoid(PR_TRUE);
    }
    if (!name.IsEmpty()) {
      nsCOMPtr<nsIDOMNode> doc = do_QueryInterface(aDocument);
      proc->AddXSLTParam(name, namespaceAttr, select, value, doc);
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 186 of file nsXMLContentSink.cpp.

{
  // Notify document that the load is beginning
  mDocument->BeginLoad();

  // Check for correct load-command for maybe prettyprinting
  if (mPrettyPrintXML) {
    nsCAutoString command;
    mParser->GetCommand(command);
    if (!command.EqualsLiteral("view")) {
      mPrettyPrintXML = PR_FALSE;
    }
  }
  
  return NS_OK;
}
nsresult NS_NewXMLContentSink ( nsIXMLContentSink **  aResult,
nsIDocument aDoc,
nsIURI aURI,
nsISupports *  aContainer,
nsIChannel aChannel 
)

Definition at line 122 of file nsXMLContentSink.cpp.

{
  NS_PRECONDITION(nsnull != aResult, "null ptr");
  if (nsnull == aResult) {
    return NS_ERROR_NULL_POINTER;
  }
  nsXMLContentSink* it;
  NS_NEWXPCOM(it, nsXMLContentSink);
  if (nsnull == it) {
    return NS_ERROR_OUT_OF_MEMORY;
  }
  
  nsCOMPtr<nsIXMLContentSink> kungFuDeathGrip = it;
  nsresult rv = it->Init(aDoc, aURI, aContainer, aChannel);
  NS_ENSURE_SUCCESS(rv, rv);
  
  return CallQueryInterface(it, aResult);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

const char kLoadAsData[] = "loadAsData" [static]

Definition at line 108 of file nsXMLContentSink.cpp.