Hello,
I need to develop an automate to get prop of an element before an action and to set it after the action.
Before an action, it will search all P elements of the document that are before B elements. P is Paragraph (pgf).
Rbody
--B
--P (this one will not be good)
Rbody
--P (this one will be good)
--B
So, i want to get all the ID and prop of P elements that are before B elements.
I have tried a lot of things like go from P to P and on each P find the next sibling element and check if it's B element :
//fdk guide code + custom
F_ObjHandleT docId, pgfId, nsibId;
StringT b;
b=F_StrCopyString((StringT)"B");
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
pgfId = F_ApiGetId(FV_SessionId, docId, FP_FirstPgfInDoc);
while (pgfId)
{
nsibId = F_ApiGetId(docId, pgfId, FP_NextSiblingElement)
if(F_StrCmpN(F_ApiGetString(docId, nsibId , FP_Name), b, F_StrLen(b)==0)
{
F_Printf(NULL, "I'M VERY HAPPY\n");
}
pgfId = F_ApiGetId(docId, pgfId, FP_NextPgfInDoc);
}
it doesn't work, nsibId is 0.
it seems that i need to make a selection of the text but i'm not sure...
I don't well understand the logic to navigate through a document.
Do you know how to make this?
Thank you,
Alexandre
I need to develop an automate to get prop of an element before an action and to set it after the action.
Before an action, it will search all P elements of the document that are before B elements. P is Paragraph (pgf).
Rbody
--B
--P (this one will not be good)
Rbody
--P (this one will be good)
--B
So, i want to get all the ID and prop of P elements that are before B elements.
I have tried a lot of things like go from P to P and on each P find the next sibling element and check if it's B element :
//fdk guide code + custom
F_ObjHandleT docId, pgfId, nsibId;
StringT b;
b=F_StrCopyString((StringT)"B");
docId = F_ApiGetId(0, FV_SessionId, FP_ActiveDoc);
pgfId = F_ApiGetId(FV_SessionId, docId, FP_FirstPgfInDoc);
while (pgfId)
{
nsibId = F_ApiGetId(docId, pgfId, FP_NextSiblingElement)
if(F_StrCmpN(F_ApiGetString(docId, nsibId , FP_Name), b, F_StrLen(b)==0)
{
F_Printf(NULL, "I'M VERY HAPPY\n");
}
pgfId = F_ApiGetId(docId, pgfId, FP_NextPgfInDoc);
}
it doesn't work, nsibId is 0.
it seems that i need to make a selection of the text but i'm not sure...
I don't well understand the logic to navigate through a document.
Do you know how to make this?
Thank you,
Alexandre