Class BlockXml

java.lang.Object
com.codename1.wordprocessing.BlockXml

public final class BlockXml extends Object

The .cn1doc XML of a list of blocks, for formats that hold document text inside their own files. A slide's text box is a list of blocks, and .cn1slides stores it in exactly the vocabulary .cn1doc stores a document body in, so both read and write it the same way.

Not an end-user API: it works on the internal XML reader and writer of the office formats.

  • Method Details

    • write

      public static void write(com.codename1.impl.xml.XmlOut x, List<Block> blocks) throws IOException

      Writes blocks as .cn1doc elements.

      Parameters
      • x: the writer, inside an element of the caller's

      • blocks: the blocks

      Throws
      • IOException: when writing fails
      Throws:
      IOException
    • read

      public static boolean read(com.codename1.impl.xml.XmlScanner x, List<Block> out, Set<String> ids) throws IOException

      Reads the block whose start tag the scanner is on.

      Parameters
      • x: the scanner, on a start tag

      • out: receives the block

      • ids: the ids read so far, shared by everything in one file; a repeated id is an error

      Returns

      false when the element is not a block, and the caller should skip it

      Throws
      • IOException: when the block is damaged
      Throws:
      IOException