Patent Publication Number: US-2011078552-A1

Title: Transclusion Process

Description:
BACKGROUND 
     Herein, related art is described for expository purposes. Related art labeled “prior art”, if any, is admitted prior art; related art not labeled “prior art” is not admitted prior art. 
     Documents can be composed collaboratively in whole or in part by including sections from other “source” documents. For example, a contract document may require portions of a company&#39;s standard terms and conditions that might be described in another set of documents. To avoid duplication, the contract may be originally constructed by copying appropriate portions of the terms and conditions or by inserting a directive to include those sections. At some stage, the document is processed to draw in all those pieces. If the document is dynamic (for example, the contract is being negotiated), it may be that the terms and conditions required will alter and the inclusion will have to be reprocessed. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWING 
         FIG. 1  is a schematic diagram of a document processing system. 
     
    
    
     DETAILED DESCRIPTION 
     In document processing system AP 1 , shown in  FIG. 1 , location references to sources of elements of a document are stored as XML (or other mark-up language) attributes. The references can be used by a transclusion processor for including an element from a source document into a target document so that the copy in the target document can be dynamically updated to reflect changes in the source element. Within XML, attributes attached to elements are considered to be an extensible dimension that does not conflict with the major structure and semantic meaning of the document, expressed as elements, children and text components. Since the location reference is in the form of a mark-up language attribute, sources are readily identified in a manner that does not affect presentation or other document processing not involving transclusion. 
     Document processing system AP 1  includes data-processing hardware  10  and computer-readable storage media  12 , as shown in  FIG. 1 . Hardware  10  can include integrated-circuit processors, network and other communications devices, and input-output devices. Media  12  is encoded with code  14 , which can include both instructions and data. In particular, code  14  defines a transclusion processor  16 , which is realized through an interaction of program instructions and hardware  10 . In addition, code  14  can define one or more documents such as a transcluding document D 1 , a source document D 2 , a transcluded document D 3 , and an updated transcluded document D 4 . Documents D 1 , D 3 , and D 4  are alternatively referred to herein as versions of a single target document. 
     Transclusion processor  16  transforms physical states of media  12  by creating, deleting, and modifying physical encodings of documents in accordance with a process PR 1 , flow charted in  FIG. 1 . At process segment P 1 , in response to a transclusion command, transclusion processor  16  reads a directive in a transcluding document (a document that includes transclusion directives). The command can be to execute a single transclusion directive or all transclusion directives in a document. For example, transcluding document D 1  includes an element E 11 , e.g., content that is original to document D 1 , and a directive D 12  to transclude an element E 22  from source document D 2 . 
     The following is an example of a transclusion directive. &lt;tc:transclude source=“X.xml” part=“.//h1” process=“greedy”/&gt; where: tc: is bound to some transclusion-reserved namespace; source points to a document from which content is to be transcluded, in this case another document X.xml, which presumably is accessible from the context of the document in focus; part describes some parts of that document required—in this case .//h1 which for this example is taken to be an XPath expression—one that would select all the ‘heading 1’ elements within the document; and process is some declaration on how this directive should be (re)processed, including when this directive itself (or content it has brought in) may be transcluded. 
     Process segment P 2  involves retrieving a source-locating reference from the directive. In general, a directive will include a sequence of one or more references to elements to be transcluded. These may be from a single document or from multiple document. For each source document, the reference specifies a uniform resource locator (URL) (or other network location) and a part expression indicating a location within a document at which the desired element can be found. For example, directive D 12  specifies a reference R 12  that includes a uniform resource locator (URL) to source document D 2  and a part expression that indicates a location within document D 2  at which element E 22  can be found. 
     At process segment P 3 , transclusion processor  16  collects the source document. The transcluding document and the transclusion processor can be on one or more local (from the perspective of the user) computers, while the source document can be located remote location accessed over the Internet or other network. In such a case, a local copy of the source document can be made so that it can be more readily reviewed and searched. The copy can be exact or a version constructed to facilitate reviewing or searching. 
     At process segment P 4 , transclusion processor  16  collects the element within the collected document that matches the part expression of the reference. If the directive being processed refers to several elements of one or more documents, these elements are collected in the order specified in the reference. The element(s) can be collected from the source document (e.g., if process segment P 3  is omitted), or from the local copy. 
     A collected element may have attributes such as font characteristics or document structure attributes (chapter heading, subheading, etc.). For example, element E 22  of document D 2  has a set of attributes A 22 , one of which is attribute A 23 . Also, the source document may have elements that are not collected; for example, source document D 2  includes an element E 21  that is not collected at process segment P 4 . 
     At process segment P 5 , a reference to the source is added as an attribute to the collected element. If more than one element is collected, a reference can be added to each collected element. For example, the added reference can specify a URL and a part expression, e.g., XPath, uniquely identifying the source of the collected element. For example, the added reference can be an additional attribute of attributes A 22  of element E 22 . 
     At process segment P 6 , the collected element is written to the transcluded document, which is basically the transcluding document with the transclusion elements replacing directives. The transcluded document can be created and then the element can be written; alternatively, the element can be written to the document as it is generated. 
     Accordingly, transcluded document D 3  includes element E 31 , which is a copy of element E 11  of transcluding document Dl. In addition, transcluded document D 3  includes element E 32 , which is the copy of source element E 22  that replaces directive D 12 . Transcluded element E 32  includes a set of attributes A 32 , one of which is attribute A 33  corresponding to attribute A 22  of element E 22 . In addition, attributes A 32  of element E 32  include a reference attribute R 32 , specifying a URL and part expression pointing to element E 22  of document D 2 . 
     Process PR 1  can also be used to update a transcluded document so that existing elements are replaced by updated versions of elements in the source document. In response to an update command, process segment P 2  can involve retrieving a provenance reference in a transcluded document. For example, reference R 32  can be read from element E 32  of transcluded document D 3 . Process segments P 3 -P 6  can then be executed to yield an updated transcluded document. In this case, updated document D 4  includes an element E 41 , corresponding to element E 31  of document D 3 , and element E 42 , corresponding to an updated version of element E 22  of source document D 2 . In this case, a set of attributes A 42 , including attribute A 43  and reference R 42 , correspond to attributes A 32 , including attribute A 33  and reference R 32 . Process PR 1  through process segment P 4  can also be used to retrieve the source without updating a document. 
     The source element can itself be transcluded from a second source document. In other words, if the element being transcluded is already marked with these attributes, their original values are concatenated with the new ones to produce sequence-valued ones (e.g. X.xml#.//h1; B.xml#div[@class=‘appendix’]—in which some of the heading elements in X.xml had actually come from the appendix of a document B.xml). For another example, attribute A 22  can be a reference to a second source document. In such a case, references to both the first and second source documents can be included with a transcluded element. For example, attribute A 33  can be a reference to a second source document just as reference R 32  is a reference to a source document D 2 . Process PR 1  provides for collecting or updating an element for the source of the source as well as from the source itself. 
     In some cases, process PR 1  may fail to locate a source document or an element within a source document that is found. For example, a directive may point to a contract provision that has not been prepared or source of a transcluded element may have been deleted. In such cases, there is no element to which to attach a provenance reference. Instead, the unfulfilled reference can be attached to the document, e.g., as part of the header or other data structure, along with a pointer to the location in the transcluded document that the element would have been had it been found. This makes it possible for the desired element to be sought and found in a later transclusion operation if it has reappeared in the source. 
     Each provenance attribute, e.g., references R 32  and R 42  can have an associated identity value that can be used to tie a transclusion to log or database of transclusion actions. Such a log or database can indicate a date and time and a user for each transclusion. 
     A transcluded document may then be stored or processed by other tools. For most processing there is no difference at all between elements that have been transcluded (or indeed multiply transcluded) and those that are not—only the presence of the transclusion marking attributes would indicate and transclusion-ignorant tools, behaving as good XML citizens, will retain functionally correct behavior. 
     For tools that are transclusion-aware (principally systems to refresh and update interlinked document sets, allow users to explore source provenance and so forth and editors of XML documents) there is complete information on the result document to: 1) find the ultimate original source document for an element; 2) to view that source, or alter that element in its original source view and/or modify any of the intermediate transclusion directives; 3) examine or change both the ‘name’ of the document transcluded or the description of the parts required and do this at any level; 4) delete a transclusion directive completely; and 5) reconstruct the original source document containing only the outermost elements and the topmost transclusion directives. 
     Herein a “document” is a file that includes content to be displayed or otherwise presented to a user. Examples include text files, word processing documents, spreadsheets, images, video, etc. Herein, “transclusion” refers to a dynamically updateable inclusion of an element from a source (typically involving a reference to the source that can be used to update the target document to reflect an update to the source). Herein, a “system” is any set of elements that interact to yield a result that is greater than the sum of the parts. Examples of systems include mechanical machines, electronic devices, and media encoded with programs of computer-executable instructions. “Referring” herein denotes “specifying a location”. A “provenance reference”, herein, is a source or locating reference to the source of an element. A “mark-up language attribute” is an attribute as defined by an associated mark-up language such as XML or HTML. 
     In system API, transclusion can be used as a systematic, uniform and complete method for the composition of documents, without the majority of processing tools having to be aware at all of the existence of such a mechanism. Complete source provenance is attached to the transcluded content in such a way that further (good-citizen) XML processing of those documents does not destroy the provenance on final results and tools that need to be aware of such provenance (such as view-based editors or auditing systems) can still operate correctly. The disclosed transclusion processor can also be used as a reverse channel to edit a source document from a target document. The described and other variations upon and modifications to the illustrated embodiment are provided for by the subject matter defined in the following claims.