微软 XML 核心解析服务器的一部分源代码。
属微软公开发表。
谁说微软不开源,呵呵
// ===========================================================================
// Implementation of server-side object that gathers XML data and
// processes it by combining with the appropriate XSL transform.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
#pragma once
#include "PIParse.h"
// ===========================================================================
// CLASS: CXMLServerDocument
//
// Server-side object that accumulates XML, then transforms it via request-
// specific XSL.
class CResponseOrStream;
class ATL_NO_VTABLE CXMLServerDocument :
public CComObjectRootEx
public CComCoClass
public IDispatchImpl
{
public:
DECLARE_REGISTRY_RESOURCEID(IDR_XMLSERVERDOCUMENT)
DECLARE_PROTECT_FINAL_CONSTRUCT()
BEGIN_COM_MAP(CXMLServerDocument)
COM_INTERFACE_ENTRY(IXMLServerDocument)
COM_INTERFACE_ENTRY(IDispatch)
END_COM_MAP()
public:
CXMLServerDocument();
HRESULT SetErrorToLastCOMError(wchar_t *pwszURL);
// IXMLServerDocument
STDMETHOD(put_URL)(/*[in]*/ BSTR bstrURL);
STDMETHOD(put_UserAgent)(/*[in]*/ BSTR bstrUserAgent);
STDMETHOD(put_ServerConfigFile)(/*[in]*/ BSTR bstrServerConfigFile);
STDMETHOD(put_SingleXSLFile)(/*[in]*/ BSTR bstrSingleXSLFile);
STDMETHOD(put_ServerSupportFunctions)(
/*[in]*/ IXMLServerDocumentSupportFunctions *supportFunctions);
STDMETHOD(Transform)(IDispatch * pdispResponse);
STDMETHOD(TransformEx)(IUnknown *pIncomingXMLStream,
IUnknown *punkOutput);
STDMETHOD(HandleError)(IUnknown * punkOutput);
STDMETHOD(Load)(BSTR bstrFileName);
STDMETHOD(Write)(BSTR bstrText);
STDMETHOD(End)();
STDMETHOD(Flush)();
STDMETHOD(Clear)();
STDMETHOD(WriteLine)(BSTR bstrLine);
// Errors may be set on this object by other classes. (Note that
// these incoming BSTRs can just be wchar_t*'s.)
STDMETHOD(SetError)(BSTR errorString,
BSTR errorURL,
BSTR errorHTTPCode);
STDMETHOD(ClearError());
private:
HRESULT EnsureXMLDocumentObject(bool bAcquireStream);
HRESULT EnsureAspServerObject();
HRESULT WriteToXML(BSTR bstrLine, bool bAddCR);
HRESULT WriteIdentityXML(CResponseOrStream & responseOrStream);
HRESULT LoadMasterConfig(CComBSTR & bstrSpecialPIAttrib);
HRESULT GetServerConfig(IXMLDOMDocument **pServerConfig);
HRESULT GetDoctype();
HRESULT InitializeBrowserCapAndAttribs();
HRESULT ExtractStylesheets(IXMLDOMDocument *pServerConfig,
CComBSTR arrStylesheets[],
short *pNumStylesheets);
HRESULT PullStylesheetsFromDeviceInfo(IXMLDOMNode *pServerConfig,
CComBSTR arrStylesheets[],
short *pNumStylesheets);
HRESULT ApplyStylesheets(CResponseOrStream & responseOrStream,
CComBSTR arrStylesheets[],
short numStylesheets);
HRESULT LoadXMLFromRelativeLoc(BSTR localName,
BSTR pathName,
bool isConfigXML,
IXMLDOMDocument **ppXMLDoc,
IXSLTemplate **ppXSLTemplate);
HRESULT VerifyEncodingAndCharset(UINT *puiCP);
HRESULT GrabFromBrowserCap(wchar_t *pwszAttrib,
wchar_t *pwszDefault,
CComBSTR & destination);
private:
CComBSTR m_bstrURL;
CComBSTR m_bstrURLServerConfig;
CComBSTR m_bstrURLDirectory;
CComBSTR m_bstrConfigDirectory;
CComBSTR m_bstrContentType;
CComBSTR m_bstrDoctypeName;
CComBSTR m_bstrEncoding;
CComBSTR m_bstrCharset;
CComBSTR m_bstrErrorDescrip;
CComBSTR m_bstrErrorURL;
CComBSTR m_bstrErrorHTTPCode;
CComBSTR m_bstrUserAgent;
CComBSTR m_bstrSingleXSLStylesheetFile;
CComPtr
CComPtr
CComPtr
CComPtr
CComPtr
CComPtr
CComPtr
PIParseInfo m_piParseInfo;
bool m_bInErrorHandling;
bool m_bResponseEndCalled;
bool m_bServerConfigSetExplicitly;
bool m_bForbidDriveSpecification;
bool m_bBrowserCapsInitialized;
};
其他微软 XML 核心解析服务器源代码清单
StdAfx.h Main location for include files
XmlServerDoc.{h,cpp,rgs} Main logic for stylesheet selection and XSL processing.
PreProcess.{h,cpp} Convert PASP file into ASP file
ASPPreProcessor.{h,cpp,rgs} Request broker for preprocessing tasks, also determines whether preprocessing is necessary.
ProcessingStream.h Post-processing
Xmlcache.{h,cpp}, hashtable.{h,cpp} Implements simple in-memory cache for XML documents (and IXSLTemplates)
Utils.{h,cpp} Utilities for: XML, ASP, error handling, string operations, debugging
Charset.{h,cpp} Utilities for character set and encoding issues.
PIParse.{h,cpp} Simple class for parsing XML processing instructions.
IncludeFile*.{h,cpp} Support for the PASP include file functionality.
相关视频
相关阅读 Windows错误代码大全 Windows错误代码查询激活windows有什么用Mac QQ和Windows QQ聊天记录怎么合并 Mac QQ和Windows QQ聊天记录Windows 10自动更新怎么关闭 如何关闭Windows 10自动更新windows 10 rs4快速预览版17017下载错误问题Win10秋季创意者更新16291更新了什么 win10 16291更新内容windows10秋季创意者更新时间 windows10秋季创意者更新内容kb3150513补丁更新了什么 Windows 10补丁kb3150513是什么
热门文章 网约车是什么意思 网约库克出柜会对苹果造成Windows 9发布时间曝光10款经典老数码相机推
最新文章
居民医保个人账户取消致敬改革开放40年,展
直通现场!2018雁栖湖企业家论坛开幕在即从伟大时代走向光明未来——2018企业家雁栖2018性能最好的手机前十位 2018性能最好手机小鸣单车一审宣判 小鸣单车押金退不了怎么办
人气排行 重装win7系统后键盘鼠标怎么都不能用怎么办2018性能最好的手机前十位 2018性能最好手机呵男人什么意思 呵男人表情包 呵男人呵女人6家共享单车倒闭是哪六家 6家共享单车倒闭什最全的nba历史得分榜和nba历史得分排名微信小程序是什么 微信小程序怎么申请单反相机什么牌子好?单反相机入门推荐支付宝转账限额多少钱 支付宝为什么限额
查看所有0条评论>>