# US 2013/0254239 A1 · Storage of a Document Using Multiple Representations

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2013/0254239 A1
- Document ID: US20130254239A1
- Status: Published application
- Kind: A1
- Application number: 13/872,047
- Filed: 2013-04-26
- Published: 2013-09-26
- Earliest claimed: 2011-01-18
- Assignees: Apple Inc.
- Applicants: Apple Inc.
- Inventors: Philip Andrew Mansfield; Michael Robert Levy
- Web page: https://patentgrep.com/patent/US20130254239A1

## CPC

- G06F 16/211: {Schema design and management}
- G06F 40/117: Tagging; Marking up (details of markup languages G06F40/143); Designating a block; Setting of attributes (style sheets, e.g. eXtensible Stylesheet Language Transformation [XSLT], G06F40/154)
- G06F 40/126: Character encoding
- G06F 40/143: Markup, e.g. Standard Generalized Markup Language [SGML] or Document Type Definition [DTD]
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Some embodiments provide a method for storing a document. The method stores a content stream representation of the document that includes an ordered stream of code representations for primitive elements of the document. Each code representation of a primitive element has an index that indicates the order in the content stream of the primitive element representation. The method stores an object representation of the document that includes a set of object nodes arranged in a tree structure. Each object node references a range of indices in the content stream.

## Claims

### Claim at position 1

1-18. (canceled)

### Claim 19

A non-transitory machine readable medium storing a program for execution by at least one processing unit, the program comprising sets of instructions for:
receiving a document having a first format, the document stored as a stream representation comprising an ordered content stream and an object representation comprising a set of object nodes arranged in a tree structure, the object nodes referencing ranges of indices in the content stream; and
converting an identified range of the document into a new format by recursively traversing the tree structure to identify nodes referencing indexes within the identified range and converting the nodes to the new format.

### Claim 20 (depends on 19)

The non-transitory machine readable medium of claim 19, wherein the object nodes represent document structures.

### Claim 21 (depends on 19)

The non-transitory machine readable medium of claim 19, wherein the set of instructions for converting comprises a set of instructions for:
receiving an object node that references a range within the identified range:
outputting an initial output associated with the object node;
when the object node is a parent of at least one object node, recursively traversing any child object nodes of the received object node;
when the object node is not a parent of any object nodes, outputting content from the content stream at the range referenced by the object node; and
upon returning from any recursive traversal of child nodes, outputting a final output associated with the object node.

### Claim 22 (depends on 21)

The non-transitory machine readable medium of claim 21, wherein the new format is an HyperText Markup Language (HTML) format, and the initial and final outputs comprise HTML tags.

### Claim 23 (depends on 21)

The non-transitory machine readable medium of claim 21, wherein the object representation is a first object representation, wherein the document is further stored as a second, different object representation comprising a second set of object nodes arranged in a second tree structure, the object nodes in the second object representation also referencing ranges of indices in the content stream.

### Claim 24 (depends on 23)

The non-transitory machine readable medium of claim 23, wherein the second tree structure is a style tree structure, wherein the set of instructions for converting further comprises a set of instructions for transforming the outputted content according to nodes in the style tree.

### Claim 25 (depends on 19)

The non-transitory machine readable medium of claim 19, wherein the program further comprises a set of instructions for receiving a selection of a structure in the document to be converted into the new format, the selection comprising a plurality of non-overlapping ranges of indices in the content stream.

### Claim 26 (depends on 25)

The non-transitory machine readable medium of claim 25, wherein the plurality of non-overlapping ranges is the identified range for conversion.

### Claim 27

A method for converting a document into a different format, the method comprising:
receiving a document having a first format, the document stored as a stream representation comprising an ordered content stream and an object representation comprising a set of object nodes arranged in a tree structure, the object nodes referencing ranges of indices in the content stream; and
converting an identified range of the document into a new format by recursively traversing the tree structure to identify nodes referencing indexes within the identified range and converting the nodes to the new format.

### Claim 28 (depends on 27)

The method of claim 27, wherein the object nodes represent document structures.

### Claim 29 (depends on 27)

The method of claim 27, wherein converting the identified range of the document into the new format further comprises:
receiving an object node that references a range within the identified range:
outputting an initial output associated with the object node;
when the object node is a parent of at least one object node, recursively traversing any child object nodes of the received object node;
when the object node is not a parent of any object nodes, outputting content from the content stream at the range referenced by the object node; and
upon returning from any recursive traversal of child nodes, outputting a final output associated with the object node.

### Claim 30 (depends on 29)

The method of claim 29, wherein the new format is an HyperText Markup Language (HTML) format, and the initial and final outputs comprise HTML tags.

### Claim 31 (depends on 29)

The method of claim 29, wherein the range of indices of any parent object node is the union of the ranges of indices of its child object nodes.

### Claim 32 (depends on 29)

The method of claim 29, wherein the range of indices of any parent object node contains the union of the ranges of indices of its child object nodes.

### Claim 33 (depends on 29)

The method of claim 29, wherein the range of indices for any two sibling object nodes are disjoint.

### Claim 34 (depends on 29)

The method of claim 29, wherein the new format is designated based on a user selection.

### Claim 35 (depends on 29)

The method of claim 29, wherein outputting the content from the content stream comprises transforming the content based on styling requirements defined by a style tree of the document.

### Claim 36

A non-transitory machine readable medium storing a program for execution by at least one processing unit, the program comprising sets of instructions for:
receiving a document comprising a plurality of primitive elements;
identifying an order for the primitive elements in the document;
storing a stream representation of the document, the stream representation comprising indexed representations of the primitive elements in the identified order; and
storing an object representation of the document, the object representation comprising a hierarchically-arranged set of object nodes that reference ranges of indices in the stream representation.

### Claim 37 (depends on 36)

The non-transitory machine readable medium of claim 36, wherein each object node represents a structure in the document, wherein the program further comprises sets of instructions for:
receiving a selection of a structure in the document;
traversing through the hierarchically arranged set of object nodes to identify the object node for the selected structure; and
identifying, in the stream representation, the primitive elements represented at the range referenced by the identified object node.

### Claim 38 (depends on 37)

The non-transitory machine readable medium of claim 37, wherein the program further comprises a set of instructions for displaying the document with the selected word highlighted.

### Claim 39 (depends on 37)

The non-transitory machine readable medium of claim 37, wherein the selected structure is a word.

### Claim 40 (depends on 36)

The non-transitory machine readable medium of claim 36, wherein each object node represents a structure in the document, wherein the program further comprises sets of instructions for:
receiving a search request for a particular type of structure that includes a particular set of primitive elements;
traversing the hierarchically arranged set of object nodes to identify object nodes representing the particular type of structure;
comparing, for each identified object node, the primitive elements represented in the stream at the range reference by the object node with the particular set of primitive elements, until a matching object node is found.

### Claim 41 (depends on 40)

The non-transitory machine readable medium of claim 40, wherein the program further comprises a set of instructions for displaying a portion of the document associated with the structure represented by the matching object node.
