(12) United States Patent ao) Patent No.: Us 7,313,758 B2
Kozlov (45) Date of Patent: Dec. 25,2007
(54) MARKUP-LANGUAGE DOCUMENT
FORMATTING IN MEMORY-CONSTRAINED
(75) Inventor: Dmitri Kozlov, Lane Cove (AU)
(73) Assignee: Canon Kabushiki Kaisha, Tokyo (JP)
( * ) Notice: Subject to any disclaimer, the term of this patent is extended or adjusted under 35 U.S.C. 154(b) by 303 days.
(21) Appl. No.: 10/421,770
(22) Filed: Apr. 24, 2003
(65) Prior Publication Data
US 2003/0221168 Al Nov. 27, 2003
(30) Foreign Application Priority Data
Apr. 24, 2002 (AU) PS 1947
(51) Int. CI.
(52) U.S. CI 715/513; 715/509; 715/517
(58) Field of Classification Search 715/513,
715/517, 509, 510 See application file for complete search history.
(56) References Cited
U.S. PATENT DOCUMENTS
5,708,806 A 1/1998 DeRose et al 707/104.1
5,860,073 A 1/1999 Ferrel et al 715/522
6,230,173 Bl 5/2001 Ferrel et al 715/513
6,639,611 Bl * 10/2003 Leduc 715/764
6,675,351 Bl * 1/2004 Leduc 715/503
Methods (600, 700, 900), apparatuses and computer program products are disclosed for parsing and formatting a document encoded using a markup language in a memoryconstrained environment. The structure (100) of the document is represented by a tree having one or more nodes (nl-nlO). One method (600) includes the steps of, for a current one of the nodes, freeing memory occupied by any previously formatted one of the nodes upon which formatting of the current node, according to a set of formatting rules, is independent; and building a partial document tree (500) using the current node and remaining previously formatted nodes upon which formatting of the current node, according to the set of formatting rules, is dependent. Another method includes the steps of obtaining information about one or more nodes of the document using a lookahead parser, and formatting the one or more nodes using the obtained information.
18 Claims, 9 Drawing Sheets