Highlighted

Inspecting Xml Structure on Selection (IXmlNodeTarget)

Community Beginner ,
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

55

Likes

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

Inspecting Xml Structure on Selection (IXmlNodeTarget)

Community Beginner ,
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

56

Likes

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
Jul 28, 2020 0
Advisor ,
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 …

Likes

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
Reply
Loading...
Jul 28, 2020 1
Community Beginner ,
Aug 03, 2020

Copy link to clipboard

Copied

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.

Likes

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
Reply
Loading...
Aug 03, 2020 0