Patent ID: 7216294

Claim:
A computer system for providing optimized markup language output sent to a requesting device in a single pass, the system comprising: a device adapter to provide a hierarchy of two or more server objects containing information related to the display of the content on the requesting device, wherein each server object has one or more style states; a device capabilities component coupled to a writer and configured to provide to the writer capabilities of the requesting device by extracting an identification from the request of the requesting device; a state-machine couple to the two or more server objects and configured to preserve a current style state and a desired style state, the state machine comprising: a tag stack having a first pushdown list in which information is stored about what markup language tags have been written to the requesting device; a style stack having a second pushdown list in which information is stored about markup language tags representing the desired style state; a current state register that stores markup language tags that represent the current style state; and the writer coupled to the state-machine and the device adapter, the writer configured to receive an object to be rendered, the writer configured to determine whether the object has any information to be written to the requesting device, if the object has information to be written, the writer configured to store the desired style state in the style stack, the writer configured to determine whether the current style state, in the current state register, matches the desired style state, in the style stack, if the current style state matches the desired style state, the writer configured to not write a markup language tag for the desired style state to the requesting device, if the current style state does not match the desired style state, the writer configured to output one or more markup language tags to the requesting device, to transition from the current state to the desired style state, wherein at least one unnecessary markup language tag is not written to the requesting device, the writer further determines whether the desired style state includes markup language tags that ignore current state markup language tags, if the desired style state includes markup language tags that ignore current style state tags, then performing steps: pushing the state-machine onto a state-machine stack, instantiating a second state-machine configured to preserve the desired style state, and if the desire style state includes markup language tags that ignore markup language tags have been closed, popping the state-machine from the state-machine stack.