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

How to get the text content from XMLReference?

Enthusiast ,
Dec 02, 2016 Dec 02, 2016

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

TOPICS
SDK
588
Translate
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

correct answers 1 Correct answer

Advocate , Dec 04, 2016 Dec 04, 2016

1. Get TextRange of XMLReference

  - Use XMLContentIterator

2. Replace text of the TextRange

  - Use ITextModelCmds::ReplaceCmd

Translate
Advocate ,
Dec 04, 2016 Dec 04, 2016

1. Get TextRange of XMLReference

  - Use XMLContentIterator

2. Replace text of the TextRange

  - Use ITextModelCmds::ReplaceCmd

Translate
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
Enthusiast ,
Dec 08, 2016 Dec 08, 2016
LATEST

Hi Norio,

Sorry for the late reply.

It works, thanks.

Translate
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