IP Library › Granted Patent US 7,992,088
Granted Patent B2
US 7,992,088 · App. 10/095,737 · Granted Aug 2, 2011

Method and system for copy and paste technology for stylesheet editing

Assignee: International Business Machines Corporation
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,992,088
App. No.
10/095,737
Granted
Aug 2, 2011
Kind
B2
Abstract

A method (and structure) for editing elements of a first document based on elements of a second document, wherein the elements of the first have a template structure with each template including at least one match condition, the match condition being an expression in the template that describes a subset of nodes that are matched in a tree structure, and wherein the elements of the second document have a tree structure to which this matching is applicable, including comparing a first user-selected fragment of an element from the second document with a second user-selected fragment of an element from the second document to determine if a match condition exists that describes the relation between templates in the first document for which the match condition matches the two user-selected fragments of the second document and permitting at least one of a plurality of predefined editing operations on the first document if such a match condition exists.

Claims (106)

1. A computer-implemented method of editing elements of a first document based on elements of a second document, said elements of said first document having a template structure, each said template comprising at least one match condition, said match condition being an expression in said template that describes a subset of nodes that are matched in a tree structure, said second document containing a tree structure to which said matching is applicable, comprising:

comparing a first selected fragment of an element from said first document with a second selected fragment of an element from said second document to determine if a match condition exists that describes the relation between templates in said first document, said match condition matching said first selected fragment and said second selected fragment;

upon said match condition existing, receiving a predefined editing operation from a user; and

performing the predefined editing operation by modifying the template structure of the elements of the first document, wherein the performing comprises:

responsive to receiving a copy operation from the user, determining if the first selected fragment is a template rule with a match attribute;

if the first selected fragment is a template rule with a match attribute, storing in a cut buffer a apply-templates rule with a select attribute and an origin match condition describing the second selected fragment;

if the first selected fragment is not a template rule with a match attribute, storing in a cut buffer a copy of the first selected fragment and an origin match condition describing the second selected fragment.

2. A computer having an editor for editing elements of a first document based on elements of a second document, said elements of said first document having a template structure, each said template comprising at least one match condition, said match condition being an expression in said template that describes a subset of nodes that are matched in a tree structure, said second document containing a tree structure to which said matching is applicable, said editor comprising:

an input module for receiving a first selected fragment from said first document and a second selected fragment from said second document;

a comparator for comparing a first selected fragment of an element from said second document with a second selected fragment of an element from said second document to determine if a match condition exists that describes the relation between templates in said first document, said match condition matching said first selected fragment and said second selected fragment;

an input module for receiving a predefined editing operations from a user upon said match condition existing; and

an enabling module for performing the predefined editing operation by modifying the template structure of the elements of the first document, wherein

said enabling module further

determines if the first selected fragment is a template rule with a match attribute responsive to the input module receiving a copy operation from the user;

stores in a cut buffer a apply-templates rule with a select attribute and an origin match condition describing the second selected fragment stores if the first selected fragment is a template rule with a match attribute; and

stores in a cut buffer a copy of the first selected fragment and an origin match condition describing the second selected fragment if the first selected fragment is not a template rule with a match attribute.

3. A computer program product including computer-readable storage medium having stored therein computer usable program code for editing elements of a first document based on elements of a second document, said elements of said first document having a template structure, each said template comprising at least one match condition, said match condition being an expression in said template that describes a subset of nodes that are matched in a tree structure, said second document containing a tree structure to which said matching is applicable, the computer usable program code, which when executed by a computer hardware device, causing the computer hardware device to perform

comparing a first selected fragment of an element from said first document with a second selected fragment of an element from said second document to determine if a match condition exists that describes the relation between templates in said first document, said match condition matching said first selected fragment and said second selected fragment;

upon said match condition existing, receiving a predefined editing operation from a user; and

performing the predefined editing operation by modifying the template structure of the elements of the first document

determining if the first selected fragment is a template rule with a match attribute responsive to the input module receiving a copy operation from the user;

storing in a cut buffer a apply-templates rule with a select attribute and an origin match condition describing the second selected fragment stores if the first selected fragment is a template rule with a match attribute; and

storing in a cut buffer a copy of the first selected fragment and an origin match condition describing the second selected fragment if the first selected fragment is not a template rule with a match attribute.

4. A computer-implemented method for editing a stylesheet, the stylesheet including rules, each rule having a stylesheet match condition, comprising:

receiving a selection of a first template fragment of the stylesheet, the first template fragment having a first stylesheet match condition;

receiving a selection of a first source node from a source document;

storing, in a cut buffer of a computer hardware device, a copy of the first template fragment,

storing, in the cut buffer, an origin match condition describing the first source node, and

upon the first stylesheet match condition matching the origin match condition

performing a predefined editing operation upon the stylesheet, wherein

the source document includes a tree structure having a plurality of nodes.

5. The method of claim 4 , wherein

the predefined editing operation includes removing, from the stylesheet, the first template fragment.

6. The method of claim 5 , further comprising

receiving a selection of a second template fragment of the stylesheet, the second template fragment having a second stylesheet match condition;

receiving a selection of a second source node from a source document;

upon the second stylesheet match condition matching a second origin match condition describing the second source node

inserting, into the stylesheet and at a location of the second template fragment, a third template fragment configured to create a second result node corresponding to a first result node created by the first template fragment, wherein

the first result node is created by transforming the first source node with the first template fragment, and

the second result node is created by transforming the second source node with the third template fragment.

7. The method of claim 4 , further comprising

receiving a selection of a second template fragment of the stylesheet, the second template fragment having a second stylesheet match condition;

receiving a selection of a second source node from a source document;

upon the second stylesheet match condition matching a second origin match condition describing the second source node

inserting, into the stylesheet and at a location of the second template fragment, a third template fragment configured to create a second result node corresponding to a first result node created by the first template fragment, wherein

the first result node is created by transforming the first source node with the first template fragment, and

the second result node is created by transforming the second source node with the third template fragment.

8. The method of claim 4 , wherein

the source document comprises eXtensible Mark-up Language (XML) and

the stylesheet is an eXtensible Style Language Transformations (XSLT) stylesheet comprising a tree structure of XML transformation rules.

9. A computer hardware device for editing a stylesheet, the stylesheet including rules, each rule having a stylesheet match condition, comprising:

a memory;

a processor configured to perform:

receiving a selection of a first template fragment of the stylesheet, the first template fragment having a first stylesheet match condition;

receiving a selection of a first source node from a source document;

storing, in a cut buffer of the memory, a copy of the first template fragment,

storing, in the cut buffer, an origin match condition describing the first source node, and

upon the first stylesheet match condition matching the origin match condition

performing a predefined editing operation upon the stylesheet, wherein

the source document includes a tree structure having a plurality of nodes.

10. The computer hardware device of claim 9 , wherein

the predefined editing operation includes removing, from the stylesheet, the first template fragment.

11. The computer hardware device of claim 10 , wherein the processor is further configured to perform

receiving a selection of a second template fragment of the stylesheet, the second template fragment having a second stylesheet match condition;

receiving a selection of a second source node from a source document;

upon the second stylesheet match condition matching a second origin match condition describing the second source node

inserting, into the stylesheet and at a location of the second template fragment, a third template fragment configured to create a second result node corresponding to a first result node created by the first template fragment, wherein

the first result node is created by transforming the first source node with the first template fragment, and

the second result node is created by transforming the second source node with the third template fragment.

12. The computer hardware device of claim 9 , wherein the processor is further configured to perform

receiving a selection of a second template fragment of the stylesheet, the second template fragment having a second stylesheet match condition;

receiving a selection of a second source node from a source document;

upon the second stylesheet match condition matching a second origin match condition describing the second source node

inserting, into the stylesheet and at a location of the second template fragment, a third template fragment configured to create a second result node corresponding to a first result node created by the first template fragment, wherein

the first result node is created by transforming the first source node with the first template fragment, and

the second result node is created by transforming the second source node with the third template fragment.

13. The computer hardware device of claim 9 , wherein

the source document comprises eXtensible Mark-up Language (XML) and

the stylesheet is an eXtensible Style Language Transformations (XSLT) stylesheet comprising a tree structure of XML transformation rules.

14. A computer program product including computer-readable storage medium having stored therein computer usable program code for editing a stylesheet, the stylesheet including rules, each rule having a stylesheet match condition, the computer usable program code, which when executed by a computer hardware device, causing the computer hardware device to perform:

receiving a selection of a first template fragment of the stylesheet, the first template fragment having a first stylesheet match condition;

receiving a selection of a first source node from a source document;

storing, in a cut buffer of a computer hardware device, a copy of the first template fragment,

storing, in the cut buffer, an origin match condition describing the first source node, and

upon the first stylesheet match condition matching the origin match condition

performing a predefined editing operation upon the stylesheet, wherein

the source document includes a tree structure having a plurality of nodes.

15. The computer program product of claim 14 , wherein

the predefined editing operation includes removing, from the stylesheet, the first template fragment.

16. The computer program product of claim 15 , further comprising

receiving a selection of a second template fragment of the stylesheet, the second template fragment having a second stylesheet match condition;

receiving a selection of a second source node from a source document;

upon the second stylesheet match condition matching a second origin match condition describing the second source node

inserting, into the stylesheet and at a location of the second template fragment, a third template fragment configured to create a second result node corresponding to a first result node created by the first template fragment, wherein

the first result node is created by transforming the first source node with the first template fragment, and

the second result node is created by transforming the second source node with the third template fragment.

17. The computer program product of claim 14 , further comprising

receiving a selection of a second template fragment of the stylesheet, the second template fragment having a second stylesheet match condition;

receiving a selection of a second source node from a source document;

upon the second stylesheet match condition matching a second origin match condition describing the second source node

inserting, into the stylesheet and at a location of the second template fragment, a third template fragment configured to create a second result node corresponding to a first result node created by the first template fragment, wherein

the first result node is created by transforming the first source node with the first template fragment, and

the second result node is created by transforming the second source node with the third template fragment.

18. The computer program product of claim 14 , wherein

the source document comprises eXtensible Mark-up Language (XML) and

the stylesheet is an eXtensible Style Language Transformations (XSLT) stylesheet comprising a tree structure of XML transformation rules.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 6, 2002
From: ROSE, KRISTOFFER H.
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 012870/0764 →
Continuity (1)
Related Publication 20030177449A1 · Sep 18, 2003