basanta007
02-26-2009, 12:42 AM
I have the following xml file structure and need to read the testname,outcome,info,resultname and outcome value. These values are write to a txt file.
I am relatively new to VC++, and want to use the MSXML parser, to read the xml file and write this value in a txt file.
<?xml version="1.0" encoding="UTF-8" ?>
- <tests outcome="PASS">
- <test name="MAIN_DOCUMENT" outcome="PASS">
- <result name="META_HTTP_EQUIV-2" outcome="WARN">
<info>WARN: A matching HTTP response header (content-type) exists but its value differs from the content attribute value</info>
</result>
</test>
<test name="AUTO_REFRESH" outcome="PASS" />
- <test name="CACHING" outcome="PASS">
- <result name="CACHING-5" outcome="WARN">
<info>WARN: The "Expires" header contains a date in the past</info>
</result>
</test>
<test name="CHARACTER_ENCODING_SUPPORT" outcome="PASS" />
- <test name="CONTENT_FORMAT_SUPPORT" outcome="PASS">
- <result name="CONTENT_FORMAT_SUPPORT-2" outcome="WARN">
<info>WARN: The document is served as "application/vnd.wap.xhtml+xml" instead of the recommended "application/xhtml+xml"</info>
</result>
</test>
- <test name="DEFAULT_INPUT_MODE" outcome="PASS">
- <result name="DEFAULT_INPUT_MODE-2" outcome="WARN">
<info>WARN: There is no inputmode attribute on this text entry element</info>
<code><input class="textinput" id="query" maxlength="2048" name="q" size="20" type="text" value=""/></code>
</result>
</test>
<test name="EXTERNAL_RESOURCES" outcome="PASS" />
- <test name="GRAPHICS_FOR_SPACING" outcome="PASS">
- <result name="GRAPHICS_FOR_SPACING-1" outcome="WARN">
<info>WARN: There is a small fully transparent image</info>
</result>
</test>
<test name="IMAGE_MAPS" outcome="PASS" />
<test name="IMAGES_SPECIFY_SIZE" outcome="PASS" />
- <test name="LINK_TARGET_FORMAT" outcome="PASS">
- <result name="LINK_TARGET_FORMAT-2" outcome="WARN">
<info>WARN: The linked resource http://services.google.com/surveys/mobile_search is served with a character encoding ("") that may not be appropriate for a mobile device</info>
</result>
- <result name="LINK_TARGET_FORMAT-2" outcome="WARN">
<info>WARN: The linked resource http://www.google.co.in/webhp?hl=en&output=html is served with a character encoding (iso-8859-1) that may not be appropriate for a mobile device</info>
</result>
</test>
Please share some source code to achive this goal.
Thanks,
Basanta007
I am relatively new to VC++, and want to use the MSXML parser, to read the xml file and write this value in a txt file.
<?xml version="1.0" encoding="UTF-8" ?>
- <tests outcome="PASS">
- <test name="MAIN_DOCUMENT" outcome="PASS">
- <result name="META_HTTP_EQUIV-2" outcome="WARN">
<info>WARN: A matching HTTP response header (content-type) exists but its value differs from the content attribute value</info>
</result>
</test>
<test name="AUTO_REFRESH" outcome="PASS" />
- <test name="CACHING" outcome="PASS">
- <result name="CACHING-5" outcome="WARN">
<info>WARN: The "Expires" header contains a date in the past</info>
</result>
</test>
<test name="CHARACTER_ENCODING_SUPPORT" outcome="PASS" />
- <test name="CONTENT_FORMAT_SUPPORT" outcome="PASS">
- <result name="CONTENT_FORMAT_SUPPORT-2" outcome="WARN">
<info>WARN: The document is served as "application/vnd.wap.xhtml+xml" instead of the recommended "application/xhtml+xml"</info>
</result>
</test>
- <test name="DEFAULT_INPUT_MODE" outcome="PASS">
- <result name="DEFAULT_INPUT_MODE-2" outcome="WARN">
<info>WARN: There is no inputmode attribute on this text entry element</info>
<code><input class="textinput" id="query" maxlength="2048" name="q" size="20" type="text" value=""/></code>
</result>
</test>
<test name="EXTERNAL_RESOURCES" outcome="PASS" />
- <test name="GRAPHICS_FOR_SPACING" outcome="PASS">
- <result name="GRAPHICS_FOR_SPACING-1" outcome="WARN">
<info>WARN: There is a small fully transparent image</info>
</result>
</test>
<test name="IMAGE_MAPS" outcome="PASS" />
<test name="IMAGES_SPECIFY_SIZE" outcome="PASS" />
- <test name="LINK_TARGET_FORMAT" outcome="PASS">
- <result name="LINK_TARGET_FORMAT-2" outcome="WARN">
<info>WARN: The linked resource http://services.google.com/surveys/mobile_search is served with a character encoding ("") that may not be appropriate for a mobile device</info>
</result>
- <result name="LINK_TARGET_FORMAT-2" outcome="WARN">
<info>WARN: The linked resource http://www.google.co.in/webhp?hl=en&output=html is served with a character encoding (iso-8859-1) that may not be appropriate for a mobile device</info>
</result>
</test>
Please share some source code to achive this goal.
Thanks,
Basanta007