You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by bu...@apache.org on 2003/04/21 20:13:17 UTC

DO NOT REPLY [Bug 19197] New: - XMLString::findAny does not weem to work

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19197>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19197

XMLString::findAny does not weem to work

           Summary: XMLString::findAny does not weem to work
           Product: Xerces-C++
           Version: 2.2.0
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Utilities
        AssignedTo: xerces-c-dev@xml.apache.org
        ReportedBy: twhead@t-online.de


As an XML beginner I tried just modifying the example SAX2COUNT to search for
a string in the characters handler. I added:

#include <xercesc/util/XMLString.hpp>

to SAX2CountHandlers.cpp and 

    XMLCh	    *pXMLMatchString;    	 
	XMLCh		*pindex;
	
	pXMLMatchString = XMLString::transcode  ("Four");  

	pindex = XMLString::findAny  ((XMLCh* const) chars, (const XMLCh* const) 
pXMLMatchString);
	if (pindex == 0) {
		cout << "Substring  Four NOT found" << endl;
	}
	else {
		cout << "Substring  Four matched" << endl;
	}

	XMLString::release (&pXMLMatchString);  

to the characters method.

Using the program (compiled with MSVC 6.0 SP3) with the example file 
personal-schema.xml I had 16 matches and 2 mismatches.
I think there should only be 4 occurences.
The methods:
    startsWithI
    endsWith
    compareString
produce the expected results as does convering the chars parameter to a C string 
and using strstr.
Is there a bug or am I doing something silly?

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org