示例#1
0
TAG_METHOD_IMPL(CElementParser, OnComplexType)
{
    TRACE_PARSE_ENTRY();

    CElement * pCurr = GetElement();
    if (pCurr != NULL)
    {
        CComplexType * pElem = pCurr->AddComplexType();
        if (pElem != NULL)
        {
            SetXSDElementInfo(pElem, pCurr, GetLocator());

            CAutoPtr<CComplexTypeParser> p( new CComplexTypeParser(GetReader(), this, GetLevel(), pElem) );
            if (p != NULL)
            {
                if (g_ParserList.AddHead(p) != NULL)
                {
                    return p.Detach()->GetAttributes(pAttributes);
                }
            }
        }
    }

    EmitErrorHr(E_OUTOFMEMORY);
    return E_FAIL;
}
示例#2
0
TAG_METHOD_IMPL(CWSDLOperationParser, OnHttpOperation)
{
	TRACE_PARSE_ENTRY();

	CWSDLPortTypeOperation * pCurr = GetOperation();
	if (pCurr != NULL)
	{
		CHttpOperation *pOperation = pCurr->AddHttpOperation();
		if (pOperation != NULL)
		{
			CStringW strLocation;
			if (S_OK == GetAttribute(pAttributes, L"location", sizeof("location")-1, strLocation))
			{
				if (SUCCEEDED(pOperation->SetLocation(strLocation)))
				{
					return SkipElement();
				}
			}
			OnMissingAttribute(TRUE, L"location", sizeof("location")-1, L"", 0);
		}
	}

	EmitErrorHr(E_OUTOFMEMORY);

	return E_FAIL;
}
示例#3
0
TAG_METHOD_IMPL(CWSDLBindingParser, OnOperation)
{
	TRACE_PARSE_ENTRY();
	
	CWSDLBinding * pCurr = GetBinding();
	if (pCurr != NULL)
	{
		CAutoPtr<CWSDLPortTypeOperation> spElem;
		spElem.Attach( new CWSDLPortTypeOperation );

		if (spElem != NULL)
		{
			SetXMLElementInfo(spElem, pCurr, GetLocator());

			CAutoPtr<CWSDLOperationParser> p( new CWSDLOperationParser(GetReader(), this, GetLevel(), spElem) );
			if (p)
			{
				if (g_ParserList.AddHead(p) != NULL)
				{
					if (SUCCEEDED(p.Detach()->GetAttributes(pAttributes)))
					{
						if (pCurr->AddOperation(spElem) != NULL)
						{
							spElem.Detach();
							return S_OK;
						}
					}
				}
			}
		}
	}

	EmitErrorHr(E_OUTOFMEMORY);
	return E_FAIL;
}
示例#4
0
TAG_METHOD_IMPL(CWSDLBindingParser, OnHttpBinding)
{
	TRACE_PARSE_ENTRY();

	CWSDLBinding * pCurr = GetBinding();
	if (pCurr != NULL)
	{
		CHttpBinding *pBinding = pCurr->AddHttpBinding();
		if (pBinding != NULL)
		{
			SetXMLElementInfo(pBinding, pCurr, GetLocator());

			CStringW strVerb;
			if (S_OK == GetAttribute(pAttributes, L"verb", sizeof("verb")-1, strVerb))
			{
				if (SUCCEEDED(pBinding->SetVerb(strVerb)))
				{
					return SkipElement();
				}
			}
		}
	}

	EmitErrorHr(E_OUTOFMEMORY);

	return E_FAIL;
}
示例#5
0
ATTR_METHOD_IMPL(CElementParser, OnMaxOccurs)
{
    TRACE_PARSE_ENTRY();

    if (cchValue==sizeof("unbounded")-1 && !wcsncmp(wszValue, L"unbounded", cchValue))
    {
        CElement * pCurr = GetElement();
        if (pCurr != NULL)
        {
            pCurr->SetMaxOccurs(MAXOCCURS_UNBOUNDED);
            return S_OK;
        }
        return E_FAIL;
    }

    int nMaxOccurs = 0;
    nMaxOccurs = _wtoi(wszValue);
    if (nMaxOccurs >= 0)
    {
        //
        // maxOccurs must be >= 0
        //

        CElement * pCurr = GetElement();
        if (pCurr != NULL)
        {
            pCurr->SetMaxOccurs(nMaxOccurs);
            return S_OK;
        }
    }

    EmitInvalidValue("maxOccurs", wszValue);

    return E_FAIL;
}
示例#6
0
TAG_METHOD_IMPL(CWSDLOperationParser, OnFault)
{
	TRACE_PARSE_ENTRY();

	CWSDLPortTypeOperation * pCurr = GetOperation();
	if (pCurr != NULL)
	{
		CWSDLPortTypeFault * pElem = pCurr->AddFault();
		if (pElem != NULL)
		{
			SetXMLElementInfo(pElem, pCurr, GetLocator());
			CAutoPtr<CWSDLOperationIOParser> p( new CWSDLOperationIOParser(GetReader(), this, GetLevel(), pElem) );
			if (p != NULL)
			{
				if (g_ParserList.AddHead(p) != NULL)
				{
					return p.Detach()->GetAttributes(pAttributes);
				}
			}
		}
	}

	EmitErrorHr(E_OUTOFMEMORY);

	return E_FAIL;
}
示例#7
0
TAG_METHOD_IMPL(CComplexTypeParser, OnAll)
{
	TRACE_PARSE_ENTRY();

	DisableReset();

	return S_OK;
}
示例#8
0
TAG_METHOD_IMPL(CComplexTypeParser, OnEnumeration)
{
	TRACE_PARSE_ENTRY();

	MarkUnsupported(wszQName, cchQName);
	EmitSkip(wszNamespaceUri, wszLocalName);

	return SkipElement();
}
示例#9
0
TAG_METHOD_IMPL(CSchemaParser, OnRedefine)
{
	TRACE_PARSE_ENTRY();

	MarkUnsupported(wszQName, cchQName);
	EmitSkip(wszNamespaceUri, wszLocalName);

	return SkipElement();
}
示例#10
0
TAG_METHOD_IMPL(CSchemaParser, OnImport)
{
	TRACE_PARSE_ENTRY();

	//
	// TODO: do imports here (or delay?)
	//

	return SkipElement();
}
示例#11
0
ATTR_METHOD_IMPL(CElementParser, OnArrayType)
{
    TRACE_PARSE_ENTRY();

    CElement *pCurr = GetElement();
    if (pCurr != NULL)
    {
        return pCurr->SetArrayType(wszValue, cchValue);
    }

    return E_FAIL;
}
示例#12
0
ATTR_METHOD_IMPL(CComplexTypeParser, OnFinal)
{
	TRACE_PARSE_ENTRY();

	CComplexType * pCurr = GetComplexType();
	if (pCurr != NULL && pCurr->GetElementType() == XSD_COMPLEXTYPE)
	{
		MarkUnsupported(wszQName, cchQName);
	}

	return S_OK;
}
示例#13
0
ATTR_METHOD_IMPL(CComplexTypeParser, OnBase)
{
	TRACE_PARSE_ENTRY();

	CComplexType * pCurr = GetComplexType();
	if (pCurr != NULL)
	{
		return pCurr->SetBase(wszValue, cchValue);
	}

	return E_FAIL;
}
示例#14
0
ATTR_METHOD_IMPL(CElementParser, OnSizeIs)
{
    TRACE_PARSE_ENTRY();

    CElement *pCurr = GetElement();
    if (pCurr != NULL)
    {
        return pCurr->SetSizeIs(wszValue, cchValue);
    }

    EmitError(IDS_SDL_INTERNAL);
    return E_FAIL;
}
示例#15
0
ATTR_METHOD_IMPL(CContentParser, OnID)
{
	TRACE_PARSE_ENTRY();

	CContent *pCurr = GetContent();
	if (pCurr != NULL)
	{
		return pCurr->SetID(wszValue, cchValue);
	}

	EmitErrorHr(E_OUTOFMEMORY);
	return E_FAIL;
}
示例#16
0
ATTR_METHOD_IMPL(CWSDLBindingParser, OnType)
{
	TRACE_PARSE_ENTRY();

	CWSDLBinding * pCurr = GetBinding();
	if (pCurr != NULL)
	{
		return pCurr->SetType(wszValue, cchValue);
	}

	EmitError(IDS_SDL_INTERNAL);

	return E_FAIL;
}
示例#17
0
ATTR_METHOD_IMPL(CWSDLMessageParser, OnName)
{
	TRACE_PARSE_ENTRY();

	CWSDLMessage *pCurr = GetMessage();
	if (pCurr != NULL)
	{
		return pCurr->SetName(wszValue, cchValue);
	}

	EmitError(IDS_SDL_INTERNAL);

	return E_FAIL;
}
示例#18
0
ATTR_METHOD_IMPL(CWSDLOperationParser, OnName)
{
	TRACE_PARSE_ENTRY();

	CWSDLPortTypeOperation * pCurr = GetOperation();
	if (pCurr != NULL)
	{
		return pCurr->SetName(wszValue, cchValue);
	}

	EmitError(IDS_SDL_INTERNAL);

	return E_FAIL;
}
示例#19
0
ATTR_METHOD_IMPL(CSchemaParser, OnTargetNamespace)
{
	TRACE_PARSE_ENTRY();

	CSchema * pCurr = GetSchema();
	if (pCurr != NULL)
	{
		return pCurr->SetTargetNamespace(wszValue, cchValue);
	}

	EmitError(IDS_SDL_INTERNAL);

	return E_FAIL;
}
示例#20
0
ATTR_METHOD_IMPL(CWSDLServiceParser, OnName)
{
	TRACE_PARSE_ENTRY();

	CWSDLService * pCurr = GetService();
	if (pCurr != NULL)
	{
		return pCurr->SetName(wszValue, cchValue);
	}

	EmitErrorHr(E_OUTOFMEMORY);

	return E_FAIL;
}
示例#21
0
ATTR_METHOD_IMPL(CComplexTypeParser, OnContent)
{
	TRACE_PARSE_ENTRY();

	CComplexType * pCurr = GetComplexType();
	if (pCurr != NULL)
	{
		HRESULT hr = S_OK;
		if (pCurr->GetElementType() == XSD_COMPLEXTYPE)
		{
			hr = pCurr->SetContentType(wszValue, cchValue);
		}
		return hr;
	}

	return E_FAIL;
}
示例#22
0
ATTR_METHOD_IMPL(CContentParser, OnMixed)
{
	TRACE_PARSE_ENTRY();

	CContent *pCurr = GetContent();
	if (pCurr != NULL)
	{
		if (SUCCEEDED(pCurr->SetMixed(wszValue, cchValue)))
		{
			return S_OK;
		}
		EmitInvalidValue("mixed", wszValue);
	}

	EmitErrorHr(E_OUTOFMEMORY);

	return E_FAIL;
}
示例#23
0
TAG_METHOD_IMPL(CWSDLOperationParser, OnSoapOperation)
{
	TRACE_PARSE_ENTRY();

	CWSDLPortTypeOperation * pCurr = GetOperation();
	if (pCurr != NULL)
	{
		CSoapOperation *pOperation = pCurr->AddSoapOperation();
		if (pOperation != NULL)
		{
			CStringW strSoapAction;
			if (S_OK == GetAttribute(pAttributes, L"soapAction", sizeof("soapAction")-1, strSoapAction))
			{
				pOperation->SetSoapAction(strSoapAction);
			}

			const wchar_t *wszStyle;
			int cchStyle;
			HRESULT hr = S_OK;
			if (S_OK == GetAttribute(pAttributes, L"style", sizeof("style")-1, &wszStyle, &cchStyle))
			{
				hr = pOperation->SetStyle(wszStyle, cchStyle);
				if (FAILED(hr))
				{
					EmitInvalidValue("style", wszStyle);
				}
			}

			if (SUCCEEDED(hr))
			{
				return SkipElement();
			}
			else
			{
				OnMissingAttribute(TRUE, L"style", sizeof("style")-1, L"", 0);
			}
		}

	}

	EmitErrorHr(E_OUTOFMEMORY);

	return E_FAIL;
}
示例#24
0
TAG_METHOD_IMPL(CContentParser, OnExtension)
{
	TRACE_PARSE_ENTRY();
	
	int nLine = 0;
	int nCol = 0;
	GetLocator()->getLineNumber(&nLine);
	GetLocator()->getColumnNumber(&nCol);
	
	CContent *pCurr = GetContent();
	if (pCurr != NULL)
	{
		EmitFileError(IDS_SDL_BASE_EXTENSION,
			(LPCWSTR) pCurr->GetParentDocument()->GetDocumentUri(),
			nLine, nCol, 0);
	}

	return E_FAIL;
}
示例#25
0
TAG_METHOD_IMPL(CComplexTypeParser, OnSimpleContent)
{
	TRACE_PARSE_ENTRY();

/*
	CComplexType *pCurr = GetComplexType();

	if (pCurr != NULL)
	{
		if (pCurr->GetElementType() == XSD_COMPLEXTYPE)
		{
			CContent *pElem = pCurr->AddContent();
			pElem->SetParentDocument(pCurr->GetParentDocument());
			pElem->SetParentElement(pCurr);
			pElem->SetElementType(XSD_SIMPLECONTENT);

			CContentParser * p = new CContentParser(GetReader(), this, GetLevel(), pElem);
			if (p != NULL)
			{
				if (g_ParserList.AddHead(p) != NULL)
				{
					return p->GetAttributes(pAttributes);
				}
			}
		}
		else
		{
			return OnUnrecognizedTag(wszNamespaceUri, 
				cchNamespaceUri, wszLocalName, cchLocalName, 
				wszQName, cchQName, pAttributes);
		}
	}

	EmitErrorHr(E_OUTOFMEMORY);

	return E_FAIL;
*/

	MarkUnsupported(wszQName, cchQName);
	EmitSkip(wszNamespaceUri, wszLocalName);
	return SkipElement();
}
示例#26
0
TAG_METHOD_IMPL(CWSDLBindingParser, OnSoapBinding)
{
	TRACE_PARSE_ENTRY();

	CWSDLBinding * pCurr = GetBinding();
	if (pCurr != NULL)
	{
		CSoapBinding *pBinding = pCurr->AddSoapBinding();
		if (pBinding != NULL)
		{
			SetXMLElementInfo(pBinding, pCurr, GetLocator());

			CStringW strTransport;
			if (S_OK == GetAttribute(pAttributes, L"transport", sizeof("transport")-1, strTransport))
			{
				pBinding->SetTransport(strTransport);
			}

			const wchar_t *wszStyle;
			int cchStyle;
			HRESULT hr = S_OK;
			if (S_OK == GetAttribute(pAttributes, L"style", sizeof("style")-1, &wszStyle, &cchStyle))
			{
				hr = pBinding->SetStyle(wszStyle, cchStyle);
				if (FAILED(hr))
				{
					EmitInvalidValue("style", wszStyle);
				}
			}

			if (SUCCEEDED(hr))
			{
				return SkipElement();
			}
		}

	}

	EmitErrorHr(E_OUTOFMEMORY);

	return E_FAIL;
}
示例#27
0
TAG_METHOD_IMPL(CWSDLMessageParser, OnPart)
{
	TRACE_PARSE_ENTRY();

	CWSDLMessage *pCurr = GetMessage();
	if (pCurr != NULL)
	{
		CWSDLMessagePart *pPart = pCurr->AddPart();
		if (pPart != NULL)
		{
			SetXMLElementInfo(pPart, pCurr, GetLocator());

			CStringW strName;
			if (S_OK == GetAttribute(pAttributes, L"name", sizeof("name")-1, strName))
			{
				pPart->SetName(strName);
				
				CStringW strElement;
				if (S_OK == GetAttribute(pAttributes, L"element", sizeof("element")-1, strElement))
				{
					pPart->SetElement(strElement);
				}
				CStringW strType;
				if (S_OK == GetAttribute(pAttributes, L"type", sizeof("type")-1, strType))
				{
					pPart->SetType(strType);
				}
//				else
//				{
//					OnMissingAttribute(TRUE, L"element", sizeof("element")-1, L"", 0);
//				}

				return SkipElement();
			}
			OnMissingAttribute(TRUE, L"name", sizeof("name")-1, L"", 0);
		}
	}

	EmitErrorHr(E_OUTOFMEMORY);

	return E_FAIL;
}
示例#28
0
TAG_METHOD_IMPL(CSchemaParser, OnAttribute)
{
	TRACE_PARSE_ENTRY();
/*
	// TODO: investigate supporting this stuff
	CSchema *pCurr = GetSchema();

	if (pCurr != NULL)
	{
		CAttribute *pElem = pCurr->AddAttribute();
		if (pElem != NULL)
		{
			pElem->SetParentDocument(pCurr->GetParentDocument());
			pElem->SetParentElement(pCurr);

			CAutoPtr<CAttributeParser> p( new CAttributeParser(GetReader(), this, GetLevel(), pElem) );
			if (p != NULL)
			{
				if (g_ParserList.AddHead(p) != NULL)
				{
					p.Detach();
					return p->GetAttributes(pAttributes);
				}
			}
		}
	}

	EmitErrorHr(E_OUTOFMEMORY);

	return E_FAIL;
*/

	MarkUnsupported(wszQName, cchQName);
	EmitSkip(wszNamespaceUri, wszLocalName);

	//
	// TODO: investigate supporting this
	//

	return SkipElement();
}
示例#29
0
TAG_METHOD_IMPL(CComplexTypeParser, OnChoice)
{
	TRACE_PARSE_ENTRY();

	MarkUnsupported(wszQName, cchQName);
	EmitString(wszNamespaceUri, wszLocalName);

	CComplexType *pCurr = GetComplexType();
	if (pCurr != NULL)
	{
		if (pCurr->GetElementType() == XSD_COMPLEXTYPE)
		{
			pCurr->SetElementType(XSD_UNSUPPORTED);
			return SkipElement();
		}
		return E_FAIL;
	}

	EmitError(IDS_SDL_INTERNAL);
	return E_FAIL;
}
示例#30
0
ATTR_METHOD_IMPL(CElementParser, OnNillable)
{
    TRACE_PARSE_ENTRY();

    CElement * pCurr = GetElement();
    if (pCurr != NULL)
    {
        bool bVal;
        HRESULT hr = GetBooleanValue(&bVal, wszValue, cchValue);
        if (SUCCEEDED(hr))
        {
            pCurr->SetNullable(bVal);
            return S_OK;
        }

        EmitInvalidValue("nillable", wszValue);
    }

    EmitErrorHr(E_OUTOFMEMORY);
    return E_FAIL;
}