getnodevalue always return null( node is text ) -----------------------------------------------
Key: XERCESC-1766
URL: https://issues.apache.org/jira/browse/XERCESC-1766
Project: Xerces-C++
Issue Type: Bug
Components: DOM
Affects Versions: 2.7.0
Environment: WINDOWS XP
VS2003
MFC
Reporter: Alex
Fix For: 2.7.0
here is the period of code
CXmlParser::InitXmlPlatForm();
if ( GetXmlParser()->CreateDomParser() )
{
GetXmlParser()->GetParser()->Parser( strXmlPath );
DOMNodeList* pNodeList = NULL;
try
{
pNodeList = GetXmlParser()->GetNodeListByTagName(
"File");
}
catch (CException* e)
{
return;
}
if ( pNodeList)
{
XMLSize_t nNode = pNodeList->getLength();
for (XMLSize_t i = 0; i < nNode; i++ )
{
DOMNode* pNode = pNodeList->item( i );
if ( pNode->getNodeType() ==
DOMNode::ELEMENT_NODE )
{
DOMElement* pElement =
(DOMElement*)(pNode);
DOMNode* p = pElement->getFirstChild();
if (p->getNodeType() ==
DOMNode::TEXT_NODE)
{
DOMText* pNodeText = (DOMText*)p;
AfxMessageBox(
XMLString::transcode(pNodeText->getNodeValue() ) );
int k = 0;
}
}
}
}
}
CXmlParser::TerminateXmlPlatForm();
return;
Here is the xml
<?xml version="1.0" encoding="gb2312"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="CommonFile Search"
ProjectGUID="{8B7C2C4F-A5C9-4448-9D0D-FAFEDC3C0C37}"
Keyword="MFCProj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
UseOfMFC="2"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\include"
PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
TreatWChar_tAsBuiltInType="FALSE"
RuntimeTypeInfo="TRUE"
UsePrecompiledHeader="3"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="4"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="xerces-c_2D.lib"
LinkIncremental="2"
AdditionalLibraryDirectories="..\lib"
GenerateDebugInformation="TRUE"
SubSystem="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="FALSE"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
UseOfMFC="2"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="..\include"
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;PLATFORM_WIN32"
MinimalRebuild="FALSE"
RuntimeLibrary="2"
TreatWChar_tAsBuiltInType="FALSE"
RuntimeTypeInfo="TRUE"
UsePrecompiledHeader="3"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="xerces-c_2.lib"
LinkIncremental="1"
AdditionalLibraryDirectories="..\lib"
GenerateDebugInformation="TRUE"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="FALSE"/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
AdditionalIncludeDirectories="$(IntDir)"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath=".\CommonFile Search.cpp">
</File>
<File
RelativePath=".\CommonFile SearchDlg.cpp">
</File>
<File
RelativePath=".\Control.cpp">
</File>
<File
RelativePath=".\stdafx.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"/>
</FileConfiguration>
</File>
<File
RelativePath=".\XmlParser.cpp">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
<File
RelativePath=".\CommonFile Search.h">
</File>
<File
RelativePath=".\CommonFile SearchDlg.h">
</File>
<File
RelativePath=".\Control.h">
</File>
<File
RelativePath=".\Resource.h">
</File>
<File
RelativePath=".\stdafx.h">
</File>
<File
RelativePath=".\XmlParser.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
<File
RelativePath=".\res\CommonFile Search.ico">
</File>
<File
RelativePath=".\CommonFile Search.rc">
</File>
<File
RelativePath=".\res\CommonFile Search.rc2">
</File>
</Filter>
<File
RelativePath=".\res\CommonFile Search.manifest">
</File>
<File
RelativePath=".\ReadMe.txt">
</File>
</Files>
<Globals>
<Global
Name="RESOURCE_FILE"
Value="CommonFile Search.rc"/>
</Globals>
</VisualStudioProject>
I have searched on this site and look other related issue and tried the
solution provided by those but it still does'n work
It always return null, I have no idea
please help me
all the app created by vs2003 has the default setting except for setting treat
wchar_t type as bulid in type as false so I can compile the code successfully
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
