Hi,
While i read text value from Text node I am getting the text value, however we are getting values from <w:instrText> also which is not required for us. we required only w:t value. Kindly do the needful. Thanks in advance.
Our code:
else if (o instanceof Text) {
Text textNode = (Text) o;
String textContent = textNode.getValue();
if (ACEUtil.containsValidData(textContent)) {
prevNodeType = "Text";
}
}
what this code does is:
While iterating TraverseUtil, we have been trying to read the values from RunIns, RunDel and Text. But while reading text we have been using Text textNode = (Text) obj; then textNoge.getValue().
Sample xml:
<w:r w:rsidR="0005316A" w:rsidRPr="00536F9C">
<w:rPr>
<w:rStyle w:val="au"/>
<w:color w:val="auto"/>
<w:sz w:val="24"/>
<w:szCs w:val="24"/>
<w:u w:val="thick" w:color="FF0000"/>
<w:vertAlign w:val="superscript"/>
</w:rPr>
<w:t>,</w:t>
</w:r>
<w:proofErr w:type="gramEnd"/>
<w:r w:rsidR="003A5909" w:rsidRPr="00536F9C">
<w:fldChar w:fldCharType="begin"/>
</w:r>
<w:r w:rsidR="003A5909" w:rsidRPr="00536F9C">
<w:instrText xml:space="preserve"> HYPERLINK "orcid:0000-0001-5497-4482" \o "orcid:0000-0001-5497-4482" </w:instrText>
</w:r>