#include "cconsolestream.h"
#include "cfilestream.h"
using namespace P6R;
using namespace P6EXAMPLES;
namespace {
{
if(
P6SUCCEEDED(err = cpFileInit->initialize(pszFilepath))) {
}
}
return err;
}
{
}
}
return err;
}
{
}
}
return err;
}
{
"<?xml version='1.0' encoding='UTF-8' ?>" \
"<catalog>" \
"<item>" \
" <name SKU='ABTEY837364'>Reynolds Ouzo Comp Integrated Fork</name>" \
" <price>199</price>" \
"</item>" \
"<item>" \
" <price>299</price>" \
" <name SKU='Z123647ydhgetr'>Easton EC-90 SLX Fork</name>" \
"</item>" \
"<item>" \
" <price>499</price>" \
" <name SKU='JDHEWU73736dhdhfgv'>Look HSC-5 SL Fork</name>" \
"</item>" \
"</catalog>";
cpStr->
strlen( pXML, 100000, &bufSize );
cpStream = NULL;
{
err = cpXPath->
eval( cpDOM, NULL, NULL, &result );
if (NULL == result.
pNodeSet)
return eFail;
{
cpSort = NULL;
}
count = 0;
{
{
switch( count ) {
case 0:
retval = -1;
err = cpStr->
wstrncmp(
P6CTEXT(
"Easton EC-90 SLX Fork"), pString, 21, &retval );
if (0 != retval) {
pConsole->
writeStdout(
"Expected [ Easton EC-90 SLX Fork ] but got [ %1$ ]\n",&args[0],1,NULL);
return eFail;
}
break;
case 1:
retval = -1;
err = cpStr->
wstrncmp(
P6CTEXT(
"Look HSC-5 SL Fork"), pString, 18, &retval );
if (0 != retval) {
pConsole->
writeStdout(
"Expected [ Look HSC-5 SL Fork ] but got [ %1$ ]\n",&args[0],1,NULL);
return eFail;
}
break;
case 2:
retval = -1;
err = cpStr->
wstrncmp(
P6CTEXT(
"Reynolds Ouzo Comp Integrated Fork"), pString, 34, &retval );
if (0 != retval) {
pConsole->
writeStdout(
"Expected [ Reynolds Ouzo Comp Integrated Fork ] but got [ %1$ ]\n",&args[0],1,NULL);
return eFail;
}
break;
}
}
count++;
}
if (eEndOfRecord == err) return eOk;
}
pConsole->
writeStdout(
"ERROR: Example failed with [ %1$ ]\n", &args[0], 1, NULL );
}
return err;
}
}
int main(int argc,char *argv[])
{
err = runDOM( cpConsole, cpDebugStream );
cpConsole->
writeStdout(
"runDOM result: [ %1$ ]\n",&args[0],1,NULL);
cpConsole = NULL;
}
else printf("ERROR: Failed to retrieve console interface [ %x ]\n", err );
}
else printf("ERROR: Failed to initialize the loader [ %x ]\n", err );
}
else printf( "ERROR: Failed to create CConsoleStream [ %x ]\n", err );
return err;
}