Git Product home page Git Product logo

Comments (5)

AnharMiah avatar AnharMiah commented on July 29, 2024 2

thanks @svanteschubert I really appreciate your time on this!

I've solved this specific case in a different way today:

In the original document, I simply placed a single bullet point list like:

  • <FOO>

then I iterated over all lists in that document looking for an item that matched <FOO>, once it matched I simply appended the list items and removed the first entry!

from odftoolkit.

svanteschubert avatar svanteschubert commented on July 29, 2024 1

from odftoolkit.

svanteschubert avatar svanteschubert commented on July 29, 2024 1

Oliver Rau suggested you use org.odftoolkit.odfdom.incubator.search.TextStyleNavigation you create it with a pattern and receive a TextSelection, where you can call getElement() to receive the DOM node.

This is not our code, but I will enhance it to use JDK Iterator & Iterable interfaces.
Oliver did it this way:
final TextNavigation search = new TextNavigation(FIELD_PATTERN, inputDocument);
while (search.hasNext()) {
// search for the next selection
final TextSelection item = (TextSelection) search.nextSelection();

Looking at the code of TextStyleNavigation hasNext seems to search for the next item and is not idempotent:

@OverRide
public boolean hasNext() {
mCurrentSelectedItem = findnext(mCurrentSelectedItem);
return (mCurrentSelectedItem != null);
}

Let me fix this all on the 1.0.0_SNAPSHOT branch soon, but you may already start working.. ;-)

from odftoolkit.

svanteschubert avatar svanteschubert commented on July 29, 2024

from odftoolkit.

AnharMiah avatar AnharMiah commented on July 29, 2024

hi @svanteschubert thanks for the feedback! I highly appreciate it!

I'll have a look at ODFDOM module, do you think its possible to essentially insert things like bullet points, tables etc at certain predefined place holders throughout the document?

Any further pointers would be super appreciated!

from odftoolkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.