none
xml encoding isn't showing up in DOM processing instruction RRS feed

  • Question

  • I'm not seeing the xml encoding show up in the xml header tag, when I specify it in the IXMLDOMDocument::createProcessingInstruction() method.  The exception is when I specify "UTF-16".  All others I've tried do not show up.  The only thing that I can guess at is UTF-8 is the default and the encodings I've specified are not supported, so it doesn't actually put any encoding specification in the xml header tag.  Here are some examples to illustrate my problem:

    Ex1:
    The line of code:
    m_pXMLDom->createProcessingInstruction( L"xml", L"version='1.0' encoding='UCS-2'", &pInstruction );

    xml header tag:
    <?xml version="1.0"?>


    Ex2:
    The line of code:
    m_pXMLDom->createProcessingInstruction( L"xml", L"version='1.0' encoding='UTF-16'", &pInstruction );

    xml header tag:
    <?xml version="1.0" encoding="UTF-16"?>


    Ex3:
    The line of code:
    m_pXMLDom->createProcessingInstruction( L"xml", L"version='1.0' encoding='UTF-8'", &pInstruction );

    xml header tag:
    <?xml version="1.0"?>


    Ex4:
    The line of code:
    m_pXMLDom->createProcessingInstruction( L"xml", L"version='1.0' encoding='windows-1252'", &pInstruction );

    xml header tag:
    <?xml version="1.0"?>


    Any ideas?  Thanks in advance.
    Mickey
    Friday, March 14, 2008 3:55 PM