• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Inspecting Xml Structure on Selection (IXmlNodeTarget)

Community Beginner ,
Jul 28, 2020 Jul 28, 2020

Copy link to clipboard

Copied

Hello,

After i could successfully get XmlNodeTarget on user selection as the below 

InterfacePtr<IXMLNodeTarget> xmlNodeTarget(runnableContext, UseDefaultIID());

if(xmlNodeTarget) {
snpInspectSelectionXML.Inspect(xmlNodeTarget -> GetAllNodeList ());
}

the code is not executable or debuggable on the inspect functions:

void SnpInspectSelectionXML::Inspect(const K2Vector<XMLReference>& elements)
{
do {

K2Vector<XMLReference>::const_iterator iter;
for (iter = elements.begin(); iter != elements.end(); iter++) {
XMLReference nextXMLRef = *iter;
this->Inspect(nextXMLRef);

}

} while (kFalse);

}

/*
*/
void SnpInspectSelectionXML::Inspect(const XMLReference& xmlRef)
{
do {
InterfacePtr<IIDXMLElement> element(xmlRef.Instantiate());
if (!element) {
break;
}
} while (kFalse);

}

 

Can i please know why or what conditions i miss to make code executable on inspect functions?

 

Many Thanks.

TOPICS
SDK

Views

164

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jul 28, 2020 Jul 28, 2020

Copy link to clipboard

Copied

That InterfacePtr<> in the first line is an object which mainly holds a pointer (in member variable fFace).

When in the debugger, open the object and see whether the contained pointer fFace is NULL.

In that case your "if(xmlNodeTarget)" fails and the method never executes.

Add an appropriate "else … alert … ".

Maybe you attempt to access the target at the selection ASB instead of the CSB?

For details, see the programming guide …

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 03, 2020 Aug 03, 2020

Copy link to clipboard

Copied

LATEST

Thanks for your reply, i am not in ASB and the execution pass the if statement successfully, the problem in the body of the Inspect method only, not executable and not debuggable, i read all the documentation and i didnt find any related information for what i am facing, i had to move the inspect body logic after the if statement directly and it worked so far, what i cant understand why its fail to call the inspect function after the If statement.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines