Exemplo n.º 1
0
static HRESULT WINAPI dom_pi_put_data(
    IXMLDOMProcessingInstruction *iface,
    BSTR data)
{
    dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
    HRESULT hr = E_FAIL;
    VARIANT val;
    BSTR sTarget;
    static WCHAR szXML[] = {'x','m','l',0};

    TRACE("%p %s\n", This, debugstr_w(data) );

    /* Cannot set data to a PI node whose target is 'xml' */
    hr = dom_pi_get_nodeName(iface, &sTarget);
    if(hr == S_OK)
    {
        if(lstrcmpW( sTarget, szXML) == 0)
        {
            SysFreeString(sTarget);
            return E_FAIL;
        }

        SysFreeString(sTarget);
    }

    V_VT(&val) = VT_BSTR;
    V_BSTR(&val) = data;

    hr = IXMLDOMNode_put_nodeValue( This->node, val );

    return hr;
}
Exemplo n.º 2
0
Arquivo: pi.c Projeto: mikekap/wine
static HRESULT WINAPI dom_pi_put_nodeValue(
    IXMLDOMProcessingInstruction *iface,
    VARIANT value)
{
    dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
    BSTR sTarget;
    HRESULT hr;

    TRACE("(%p)->(v%d)\n", This, V_VT(&value));

    /* Cannot set data to a PI node whose target is 'xml' */
    hr = dom_pi_get_nodeName(iface, &sTarget);
    if(hr == S_OK)
    {
        static const WCHAR xmlW[] = {'x','m','l',0};
        if(lstrcmpW( sTarget, xmlW) == 0)
        {
            SysFreeString(sTarget);
            return E_FAIL;
        }

        SysFreeString(sTarget);
    }

    return node_put_value(&This->node, &value);
}
Exemplo n.º 3
0
static HRESULT WINAPI dom_pi_put_nodeValue(
    IXMLDOMProcessingInstruction *iface,
    VARIANT var1 )
{
    dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
    BSTR sTarget;
    static WCHAR szXML[] = {'x','m','l',0};
    HRESULT hr;

    TRACE("%p\n", This );

    /* Cannot set data to a PI node whose target is 'xml' */
    hr = dom_pi_get_nodeName(iface, &sTarget);
    if(hr == S_OK)
    {
        if(lstrcmpW( sTarget, szXML) == 0)
        {
            SysFreeString(sTarget);
            return E_FAIL;
        }

        SysFreeString(sTarget);
    }

    return IXMLDOMNode_put_nodeValue( This->node, var1 );
}
Exemplo n.º 4
0
static HRESULT WINAPI dom_pi_put_data(
    IXMLDOMProcessingInstruction *iface,
    BSTR data)
{
    dom_pi *This = impl_from_IXMLDOMProcessingInstruction( iface );
    HRESULT hr;
    VARIANT val;
    BSTR sTarget;

    TRACE("(%p)->(%s)\n", This, debugstr_w(data) );

    /* Cannot set data to a PI node whose target is 'xml' */
    hr = dom_pi_get_nodeName(iface, &sTarget);
    if(hr == S_OK)
    {
        static const WCHAR xmlW[] = {'x','m','l',0};
        if(lstrcmpW( sTarget, xmlW) == 0)
        {
            SysFreeString(sTarget);
            return E_FAIL;
        }

        SysFreeString(sTarget);
    }

    V_VT(&val) = VT_BSTR;
    V_BSTR(&val) = data;

    return IXMLDOMProcessingInstruction_put_nodeValue( iface, val );
}