Copy link to clipboard
Copied
Hi All,
How to get the text content from XMLReference? and insert text in an element using XMLReference? I Get the XMLReference using the below code.
IDocument *doc = Utils<ILayoutUIUtils>()->GetFrontDocument();
UIDRef docref = ::GetUIDRef(doc);
K2Vector<WideString> xPaths;
xPaths.push_back(WideString("//qlink[@ref-type]"));
IDataBase *db = docref.GetDataBase();
InterfacePtr<IIDXMLElement> rootElement(Utils<IXMLUtils>()->QueryRootElement(db));
HitMatches matches;
Utils<IXMLParserUtils>()->EvaluateXPathsForElement(xPaths, rootElement, matches, 0);
std::map<XMLReference, K2Vector<int32>>::const_iterator iterator = matches.begin();
std::map<XMLReference, K2Vector<int32>>::const_iterator iterator_end = matches.end();
while(iterator != iterator_end)
{
UIDRef xmluidref = iterator->first.GetUIDRef();
XMLReference xmlref = iterator->first;
}
Regards,
Chinna
1. Get TextRange of XMLReference
- Use XMLContentIterator
2. Replace text of the TextRange
- Use ITextModelCmds::ReplaceCmd
Copy link to clipboard
Copied
1. Get TextRange of XMLReference
- Use XMLContentIterator
2. Replace text of the TextRange
- Use ITextModelCmds::ReplaceCmd
Copy link to clipboard
Copied
Hi Norio,
Sorry for the late reply.
It works, thanks.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more