TextContentIterator return processing instructions?
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 10
- Joined: Tue May 27, 2014 10:00 am
TextContentIterator return processing instructions?
Hi,
I'm using Oxygen Author 16.1, build 2015012213 with code like this:
Other than the text, I also get back this:
obviously it comes from the PI in my XML:
Is the TextContentIterator supposed to return PIs? I'd like to have the text without PIs.
Regards
Daniel
I'm using Oxygen Author 16.1, build 2015012213 with code like this:
Code: Select all
AuthorDocumentController docController = authorEditorPage.getDocumentController();
AuthorDocument authorDocumentNode = docController.getAuthorDocumentNode();
TextContentIterator textContentIterator =
docController.getTextContentIterator(0, docController.getAuthorDocumentNode().getEndOffset());
while (textContentIterator.hasNext()) {
System.out.println(textContentIterator.next().getText());
}
Code: Select all
xml-stylesheet type="text/css" href="/lt/rules.css" title="..."
obviously it comes from the PI in my XML:
Code: Select all
<?xml-stylesheet type="text/css" href="/lt/rules.css" title="..."?>
Is the TextContentIterator supposed to return PIs? I'd like to have the text without PIs.
Regards
Daniel
-
- Posts: 1016
- Joined: Wed Nov 16, 2005 11:11 am
Re: TextContentIterator return processing instructions?
Post by alex_jitianu »
Hello Daniel,
You can check the context node and skip PIs like this:
Best regards,
Alex
You can check the context node and skip PIs like this:
Code: Select all
TextContext next = textContentIterator.next();
AuthorNode nodeAtOffset = docController.getNodeAtOffset(next.getTextEndOffset());
if (nodeAtOffset.getType() != AuthorNode.NODE_TYPE_PI) {
System.out.println(next.getText());
}
Alex
Return to “SDK-API, Frameworks - Document Types”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service