# Patent

## Title
Structured-document path-language expression methods and systems

## Abstract

Systems and methods for building and/or simplifying structured-document path-language expressions are described. One of these systems or methods enables a user to graphically select structured-document path-language functions and addresses. With these addresses and functions, a structured-document path-language expression can be built without a user having to fully understand or type in syntax for the expression. Another of these systems or methods simplifies structured-document path-language address and function syntax. This simplification can aid a user in building and easily understanding a structured-document path-language expression.

## Background
TECHNICAL FIELD
This invention relates to structured-document path-language expression methods and systems.
BACKGROUND
Extensible markup language (XML) is increasingly becoming the preferred format for electronic documents. XML is a tag-based hierarchical language that is extremely rich in terms of the information that it can be used to represent. For example, XML can be used to represent information spanning the spectrum from semi-structured information (such as one would find in a word processing document) to generally structured information (such as that which is contained in a table). For more information on XML, the reader is referred to the XML 1.0 Second Edition Specification which is the work of and currently available from the W3C (World Wide Web consortium).
To locate and process data in XML documents, another language, called the XML Path Language (“XPath”), can be used. XPath includes an addressing syntax for locating nodes in an XML document's hierarchical structure and functions performable on or with the nodes. XPath is a W3C standard. For more information, the reader is referred to the W3C's website, where information about XPath is currently located.
Using XPath, however, can be tedious and require a significant understanding of XPath and XML. To write XPath expressions, for instance, a user often needs lengthy training in how the XPath syntax is constructed and which functions it can perform. Even with this training, writing XPath expressions can be tedious and time consuming. XPath is also unforgiving; a small syntactical error, like a period or comma out of place, can make an XPath expression fail. If the expression fails, XPath is often not helpful in showing the user how to fix the error.
Assume, for example, that a user wishes to write an XPath expression to add the data in two of the “cost” nodes listed below. The namespaces listed below represent names for hierarchically arranged nodes of an XML document.
NS1:myfields

    
    
        NS1:items
        
            NS1:item
            
                NS1:quantity
                NS1:price
                NS1:cost
            
            
            NS1:item
            
                NS1:quantity
                NS1:price
                NS1:cost
            
            
            NS1:item
            
                NS1:quantity
                NS1:price
                NS1:cost
            
            
            NS1:item
            
                NS1:quantity
                NS1:price
                NS1:cost
            
            
        
        
    
    


If the user understands XML and XPath, he or she can write the XPath expression by: 1) determining what syntax is needed to address the first cost node; 2) typing in that syntax; 3) determining what syntax is needed to perform the function of addition; 4) typing in that syntax; 5) determining what syntax is needed to address the third node; and 6) typing in that syntax.
Thus, to construct an XPath expression that can add data within the first and third “cost” nodes, the user has to determine the syntax to address the first cost node and type it in:
/NS1:myfields/NS1:items/NS1:item/NS1:cost[1]
Next, the user has to determine the syntax for the function of addition, which is the “+” symbol. While this symbol is intuitive, many other XPath functions are not intuitive and so can require training to understand. The user then types the “+” symbol in:
/NS1:myfields/NS1:items/NS1:item/NS1:cost[1]+
Next, the user must determine the syntax to address the third cost node and type it in:
/NS1:myfields/NS1:items/NS1:item/NS1:cost[1]+/NS1:myfields/NS1/items /NS1:item/NS1:cost[3]
As this example shows, writing even a simple XPath expression can require training in XML and XPath, and can be tedious and time consuming as well. Also, even a small error in an XPath expression's syntax can cause the expression to fail, potentially requiring the user to find and fix the error or retype the expression.
Given the foregoing, there is a need for a user-friendly and/or non-technical way to create XPath expressions.
SUMMARY
Systems and methods (“tools”) for building and/or simplifying path-language expressions for structured documents are described. In at least some embodiments, these tools enable a user to graphically select structured-document path-language functions and addresses. With these addresses and functions, a structured-document path-language expression can be built without a user having to fully understand or type in syntax for the expression.
In at least some embodiments, the tools can also simplify structured-document path-language address and function syntax. This simplification can aid a user in building and easily understanding a structured-document path-language expression.



BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 illustrates an exemplary architecture having an exemplary electronic document and path application.
FIG. 2 sets forth a flow diagram of an exemplary process for building a structured-document path-language expression.
FIG. 3 illustrates an exemplary electronic form and an exemplary function selection window.
FIG. 4 illustrates an exemplary electronic form and an exemplary function presentation window.
FIG. 5 illustrates two exemplary representations of an electronic document: an electronic form; and a hierarchical schema.
FIG. 6 illustrates an exemplary electronic form and an exemplary address and function window having an exemplary minimally logical form of an XPath addressing syntax.
FIG. 7 illustrates the address and function window of FIG. 6 having an exemplary minimally logical form for a second XPath addressing syntax.



The same numbers are used throughout the disclosure and figures to reference like components and features.
DETAILED DESCRIPTION
Overview
Systems and methods (“tools”) for building and/or simplifying structured-document path-language expressions are described below. In at least some embodiments, these tools can enable a user to select parts of a hierarchically structured electronic document though a user interface. The tools then generate an addressing syntax for the selected parts. By so doing, a user is able to add addressing syntax for the selected parts without having to understand or type in the addressing syntax.
In at least some embodiments, the tools can also present addressing syntax to the user in a simplified form, such as with an abbreviation of the syntax or with symbols. This enables users who may not understand path-language addressing syntax to understand what parts of an electronic document they have selected.
In at least some embodiments, the tools can also enable a user to select functions for a structured-document path-language expression to perform, such as from a window in a user interface. The tools then generate a proper syntax for the selected function. This function syntax can be presented to the user in simplified or modified form to further enable a user to understand the path-language expression being built.
Exemplary Architecture
Referring to FIG. 1, an exemplary architecture 100 is shown comprising a computing device 102 having a processor 104 and computer-readable media 106 in communication with a display 108. The processor is capable of accessing and/or executing the computer-readable media. The computer-readable media comprises a hierarchically structured electronic document 110 and a path application 112 having a user interface 114 and an engine 116. The path application is shown comprising the user interface and the engine, though each of these can be separate and operate separately.
The path application is capable of generating and/or modifying structured-document path-language addresses, functions, and expressions. The user interface is capable of presenting and receiving information to and from a user, such as through the display 108 and various user-input devices, such as a keyboard or mouse (not shown). The engine is capable of simplifying the path-language syntax, such as address and function syntax.
This architecture and its components are shown to aid in discussing the tools but are not intended to limit their applicability.
Generating Structured-Document Path-Language Expressions
Referring to FIG. 2, an exemplary process 200 for building a structured-document path-language expression is shown. The process 200 is illustrated as a series of blocks representing individual operations or acts performed by path application 112, user interface 114, and/or engine 116. This process may be implemented in any suitable hardware, software, firmware, or combination thereof. In the case of software and firmware, these processes represent computer-readable media having sets of operations implemented as computer-executable instructions.
At block 202, user interface 114 enables selection of one or more structured-document path-language functions. In this embodiment, the user interface enables selection of functions first, though enabling selection of parts of an electronic document first or concurrently with selection of functions can also be performed. The user interface can provide many functions and explanations about what operations each function can perform. It can also enable users to select a function without having to type in the syntax for that function.
As an example, consider FIG. 3. There, an electronic form 302, which is a hypertext-machine-language (HTML) rendering of electronic document 110, and a function selection window 304 are shown. This electronic form shows one type of electronic form that may be used, though other types of forms enabling electronic entry of information can also be used. In the illustrated embodiment, the electronic document is a hierarchically structured document written in XML (eXtensible Markup Language) and the functions provided are useable with XML Path Language (XPath). Other path languages useable with electronic documents having a structure may also be used.
The electronic form, entitled “Expense Report”, provides one way in which to view and select parts of electronic document 110. Selecting parts of the electronic document through the electronic form is discussed below.
Function selection window 304 provides a graphical user interface enabling a user to quickly and easily select an XPath function. In this illustration, the function selection window shows a few of many possible functions that can be selected, in this case, functions that average (“avg”), concatenate (“concat”), return false as a Boolean (“false”), return a maximum value (“max”), return a minimum value (“min”), return the current date and time (“now”), return a position (“position”), add values and return that sum (“sum”), return the current date (“today”), and return true as a Boolean (“true”).
The function selection window can present functions to a user in a syntactically incomplete or simplified form. By so doing, a user can view functions without having to know details about the syntax for that function or having to type it in. Also, the function selection window can provide information about the functions helpful to instruct the user as to which operation the functions can perform. In the illustrated embodiment, for instance, the function selection window provides explanation information 306 about the highlighted average function 308.
Returning to FIG. 2, at block 204, the user interface receives selection of a structured-document path-language function. In the ongoing example, a selection of an XPath “sum” function is received through function selection window 304. In another embodiment, a structured-document path-language function can be received in another manner, such as by being typed into another embodiment of the user interface. This is helpful in permitting a user to manually type in a function in those situations where the user is familiar and comfortable with that function.
At block 206, the user interface presents a structured-document path-language function. This structured-document path-language function can show the actual syntax of that function for the path language or can be an alteration, a simplification, and/or a symbol representing that function.
As an example, consider FIG. 4. There, a function presentation window 402 is shown. In this example, this window presents the selected “sum” function in a simplified, textual representation 404. This representation can be familiar and easy for a user to understand, which in some cases makes the textual representation of greater or lesser length than the actual syntax of that function. The function presentation window can also enable a user to select another interface for inserting fields or groups (also called “nodes” or “parts” of an electronic document), with text 406 (“double click to insert field”) or selection button 408.
Returning to FIG. 2, at block 208, the user interface enables selection of one or more parts of a hierarchically structured electronic document. The user interface can enable graphical selection of parts of an electronic document through various representations of that electronic document, such as through an HTML rendering of the electronic document or through its logical structure.
As an example, consider FIG. 5. There, two representations of electronic document 110 are shown: the electronic form 302; and a hierarchical schema 502 showing nodes of the electronic document. The hierarchical schema is shown as part of node-selection window 504. A user can select parts of the electronic document by selecting nodes of the hierarchical schema or fields of the electronic form. Path application 112 (FIG. 1) can determine which part of the electronic document is selected by selection of fields or nodes. In the illustrated embodiment, fields shown in the electronic form map to nodes of the hierarchical schema, allowing either to be selected.
Returning to FIG. 2, block 210, the user interface receives selection of part of a hierarchically structured electronic document. Referring again to FIG. 5, a user “cost” node selection is received. In this illustrated embodiment, the cost node is selected by the user clicking a pointer (like with a mouse) on a “cost” icon 506 of hierarchical schema 502, though other selection manners can also be used. Receipt of the same “cost” node can also be received by the user selecting cost data-entry field 508, which maps to the cost node.
At block 212, the user interface or path application 112 generates and/or sends a structured-document path-language address for a part of a hierarchically structured electronic document. By so doing, the path application can create a structured-document path-language addressing syntax for selected parts of an electronic document without a user having to understand or type in the addressing syntax.
At block 214, engine 116 receives a structured-document path-language address for a hierarchically structured electronic document. This address can be a machine-readable and complete syntax for addressing one or more parts of an electronic document. In the ongoing embodiment, the engine receives a full, XPath address for the “cost” node selected by the user at block 210. This XPath address can be textually shown as:
/NS1:ExpenseReport/NS1Expenses/NS1:Expense/NS1:cost
At block 216, the engine simplifies a structured-document path-language address. The engine can simplify the addressing syntax or otherwise enable it to be presented in a more human-understandable or readable form. In one embodiment, the engine simplifies the structured-document path-language address by abbreviating it, such as by removing all of the text from left to right of the address, until the engine encounters a non-unique namespace. If, for instance, the structured-document path-language address is A/B/C/D/E and A, B, C, and D are unique, the engine can remove A/B/C/D/ and leave just E. If, also for instance, there is one A, one B, two Cs, each having one D and one E, the engine can remove A/B/ and leave C/D/E.
In another embodiment, the engine simplifies an address to its minimally logical textual form. In the illustrated embodiment, the minimally logical form is “cost”. The addressing syntax before “cost” is not needed for a user to understand which node of electronic document 110 to which “cost” refers. In other embodiments of an electronic document, however, the minimally logical form may be longer or not the last textual piece (e.g., the last namespace “NS1:cost”).
For example, if electronic document 110 comprises multiple expense nodes, each having date, description, category, and cost nodes, the full XPath address could be:
/NS1ExpenseReport/NS1:Expenses/NS1:Expense[1]/NS1:cost[1]
The minimally logical form for the full address would then address the expense node as well. This form is: “Expense[1] . . . cost”. The “[1]” behind after cost is not needed because there is only one cost node subordinate to the “Expense[1]” node.
Also, for example, if the electronic document further comprises multiple cost nodes for the selected expense node, the full XPath address could be:
/NS1:ExpenseReport/NS1:Expenses/NS1:Expense[1]/NS1:cost[1]
But, the minimally logical form is instead: “Expense[1] . . . cost[1]”, which indicates which of multiple cost nodes is being addressed.
Other forms can also be generated by the engine, such as text that is not as abbreviated as much as the above minimally logical forms.
At block 218, the engine sends a simplified address to a user interface, such as user interface 114.
At block 220, user interface 114 presents a simplified structured-document path-language address. This address can be an easier-to-read or understand form of the actual address, such as an abbreviation of the actual address. It can also be a symbol representing the node, such as an icon representing the node being addressed. By so doing, the path application enables users who may not understand structured-document path-language addressing syntax to understand what parts of an electronic document they have selected.
Referring to FIG. 6, the user interface presents a minimally logical form 602 of an XPath addressing syntax for the cost node of the electronic document. In this example, the user interface presents it in an address and function window The user interface presents the minimally logical form simply as: “Cost”. If the address is selected after the function (as the illustrated embodiment shows), the address can be oriented correctly within the existing function. If the function is chosen after the address, the function can be oriented correctly based on the existing address or addresses.
In another embodiment, the user interface presents an icon or symbol for the address. This icon or symbol can be “Cost” icon 506 of hierarchical schema 502 or cost data-entry field 508 of electronic form 302, for instance. The icon or symbol can also be a highlight or other differentiating mark on a currently presented icon or data-entry field.
Before continuing to block 222, some or all of blocks 202 through 220 can be repeated. The path application can continue to enable a user to select functions and nodes. A user can select, for instance, a cash advance node (shown as a “cash advance” icon 510 of hierarchical schema 504 and cash advance data-entry field 512 of electronic form 302, all of which are shown in FIG. 5). At block 220, an address or indicator for the cash advance node can be presented in the address and function window of FIG. 6.
Referring to FIG. 7, the user interface presents a minimally logical form 702 of an XPath addressing syntax for the cash advance node of the electronic document. Here it is simply “CashAdvance”. Before or after selecting the cash advance node, the user interface enables the user to choose whether or not to add or subtract the cash advance node. Here the user selects to subtract it, shown by the “−” symbol.
At block 222, the user interface receives a selection to finish the process. In the ongoing embodiment, this can comprise receiving an “enter” command or selection of a verify formula button 704.
At block 224, the path application determines whether or not to alter the structured-document path-language expression to treat blanks as zeros. If the path application determines to not alter the path-language expression, the path application proceeds to block 226. If the path application determines to alter the path-language expression, the path application proceeds to block 230. In the illustrated and described embodiment, the path application can determine whether or not to alter the path-language expression based on a default setting or a selection. The user interface can, for instance, enable and receive a selection (such as with a button or check box) indicating that a user wants to treat particular nodes as zero if blank.
At block 226, the path application verifies that the simplified structured-document path-language expression is syntactically valid. This is especially important in cases where a user has typed in a function or some other syntax. If the expression is not valid, the user interface can show the user the syntactical error, such as a period or comma being misplaced.
At block 228, the path application stores or communicates a computer-readable path-language expression. This expression can comprise the full syntax needed for a computer to execute the expression.
In the ongoing embodiment, the path application has built the following XPath expression for the function and nodes selected above:
/NS1:ExpenseReport/NS1:Expenses/NS1:Expense/NS1:Cost−
/NS1:ExpenseReport/NS1:Expenses/NS1:CashAdvance
The path application can evaluate this expression, save it, or send it to other applications or electronic documents. In the ongoing embodiment, the path application adds this expression to a “Total” node 514 of hierarchical schema 502 (shown in FIG. 5). When evaluated, total expenses field 516 can show the value of cost field 508 minus cash advance field 512, which in this case is $0.00 (shown in FIG. 7). The path application also presents the simplified form of the path-language expression in the address and function window, shown in FIG. 7 as “sum(Cost)−CashAdvance”.
If, however, no numbers or strings (e.g., non-numbers) are in one or both of the cost or cash advance nodes, XPath may fail to generate a value for the total field. This is because XPath treats blanks as strings, rather than zeros, and so fails to perform functions intended to handle number values (such as mathematical functions) on nodes not having a number value.
At block 230, the path application alters the structured-document path-language expression to treat blanks as zeros. The path application can do so automatically, such as by a default setting, or without further user interaction based on a user's having previously selected that blank values be treated as zeros. The path application can do so for one particular node or multiple nodes addressed in the expression. This alteration can comprise adding a new function and accompanying syntax that performs this function when executed.
The path application can alter, for example, the path-language expression of the ongoing embodiment. In this example, if the selected nodes are to be treated as zero if blank, the path application can alter the expression resulting in:
Nz(NS1:ExpenseReport/NS1:Expenses/NS1:Expense/NS1:Cost)−
Nz(/NS1:ExpenseReport/NS1:Expenses/NS1:CashAdvance)
As shown, this alteration adds a function, shown with “Nz( )”, to be preformed for the nodes “Cost” and “CashAdvance”. This function dynamically replaces blank values with zero when the expression modified by the function is evaluated.
CONCLUSION
Systems and methods for building and/or simplifying structured-document path-language expressions are described above. Although the invention has been described in language specific to structural features and/or methodological acts, it is to be understood that the invention defined in the appended claims is not necessarily limited to the specific features or acts described. Rather, the specific features and acts are disclosed as exemplary forms of implementing the claimed invention.

## Claims

1. One or more computer-readable media embodying computer-readable instructions which, when executed, perform acts comprising:
receiving a selection of at least part of a graphical rendering of a hierarchically structured electronic document;
receiving a structured-document path-language address usable to locate the part of the hierarchically structured electronic document;
automatically producing a simplified form of the structured-document path-language address, the simplified form of the structured-document path-language address being produced by abbreviating the structured-document path-language address by removing one or more unique namespaces; and
building a structured-document path-language expression that includes the structured-document path-language address and, if the part of the hierarchically structured electronic document includes a blank value, altering the structured-document path-language expression to treat the blank value as a zero.

2. The media of claim 1, wherein producing the simplified form of the structured-document path-language address comprises simplifying the structured-document path-language address to a minimally logical form.

3. The media of claim 1, further comprising presenting, in a user interface, the simplified form of the structured-document path-language address.

4. The media of claim 1, wherein the structured-document path-language address comprises XML Path language (XPath).

5. The media of claim 1, wherein the electronic document comprises eXtensible Markup Language (XML).

6. A method comprising:
enabling selection of a structured-document path-language function;
receiving selection of the structured-document path-language function;
enabling graphical selection of part of a graphical rendering of a hierarchically structured electronic document;
receiving selection of the part;
automatically presenting a simplified structured-document path-language expression comprising the selected part and the selected function, the automatically presenting comprising abbreviating the structured-document path-language expression by removing one or more unique namespaces; and
altering the structured-document path-language expression to treat a blank value as a zero if the selected part includes one or more blank values.

7. The method of claim 6, wherein the act of enabling selection of the structured-document path-language function comprises enabling selection through a user interface not requiring entry of a syntax for the structured-document path-language function.

8. The method of claim 6, wherein the act of enabling selection of the structured-document path-language function comprises presenting the structured-document path-language function in a syntactically incomplete form.

9. The method of claim 6, wherein the act of enabling selection of the structured-document path-language function comprises presenting the structured-document path-language function in a simplified form.

10. The method of claim 6, further comprising presenting an explanation of the structured-document path-language function.

11. The method of claim 6, wherein the structured-document path-language function comprises a function of eXtensible Markup Language (XML) Path language (XPath).

12. The method of claim 6, wherein the act of enabling graphical selection of the part comprises presenting a graphical rendering of the electronic document having a selectable field mapped to the part.

13. The method of claim 6, wherein the act of enabling graphical selection of the part comprises presenting a hierarchical schema of the electronic document having a selectable node representing the part.

14. The method of claim 6, wherein the act of presenting comprises presenting the selected part in a simplified form.

15. The method of claim 6, wherein the act of presenting comprises presenting the selected function in a simplified form.

16. The method of claim 6, wherein the act of presenting comprises presenting the selected function and the selected part in simplified forms.

17. The method of claim 6, wherein the hierarchically structured electronic document comprises eXtensible Markup Language (XML).

18. The method of claim 6, further comprising building a syntactically correct form of the structured-document path-language expression.

19. The method of claim 6, further comprising simplifying the structured-document path-language expression.

20. A method comprising:
presenting, via a user interface, a selectable simplified form of a structured-document path-language function;
presenting, via a user interface, a graphical rendering of a hierarchically structured electronic document, the graphical rendering comprising a plurality of selectable parts;
receiving selection of the simplified form;
receiving a selection of one or more of the selectable parts;
automatically producing a simplified form of a structured-document path-language address for at least one selected selectable part the simplified form of the structured-document path-language address being produced by removing one or more unique namespaces;
building a structured-document path-language expression comprising the structured-document path-language function and the structured-document path-language address, and
altering the structured-document path-language expression to treat a blank value as a zero if the selected part includes one or more blank values.

21. The method of claim 20, wherein the simplified form describes an operation of the structured-document path-language function.

22. The method of claim 20, wherein the simplified form comprises a textual string of greater length than a machine-readable syntax for the structured-document path-language function.

23. The method of claim 20, further comprising presenting an explanation of the structured-document path-language function.

24. The method of claim 20, wherein the structured-document path-language function is a function of eXtensible Markup Language (XML) Path language (XPath).

25. A method comprising:
presenting a graphical rendering of a hierarchically structured electronic document;
receiving selection of a part of the graphical rendering, the selected part corresponding to a node on a hierarchical schema for the hierarchically structured electronic document, the hierarchical schema comprising a plurality of nodes;
generating a structured-document path-language addressing syntax for the node;
automatically simplifying the structured-document path-language addressing syntax by abbreviating the structured-document path-language address by removing one or more unique name spaces;
presenting the simplified structured-document path-language syntax; and
building a structured-document path-language expression comprising the structured-document path-language addressing syntax and a syntax for a structured-document path-language function, the building being effective to enable the structured-document path-language expression to treat a blank value of the selected node as a zero.

26. The method of claim 25, wherein the act of simplifying comprises simplifying the structured-document path-language addressing syntax to a minimally logical form.

27. The method of claim 25, wherein the act of presenting the graphical rendering of the hierarchically structured electronic document comprises presenting the hierarchical schema for the electronic document having selectable icons by which one or more of the plurality of nodes are able to be selected.

28. The method of claim 25, wherein the act of presenting the graphical rendering of the hierarchically structured electronic document comprises presenting a rendering of the electronic document having selectable fields by which one or more of the plurality of nodes are able to be selected.

29. The method of claim 25, further comprising:
receiving syntax for a structured-document path-language function; and
building a structured-document path-language expression comprising the structured-document path-language addressing syntax and the syntax for the structured-document path-language function.

30. The method of claim 29, further comprising determining if the structured-document path-language expression is syntactically correct.

31. The method of claim 29, further comprising presenting information showing a syntactical error in the structured-document path-language expression if the structured-document path-language expression is syntactically incorrect.

32. The method of claim 25, wherein the structured-document path-language comprises XML Path language (XPath).

33. A method comprising:
receiving a structured-document path-language expression addressing a node of a hierarchically structured electronic document, the node corresponding to a user selection of a graphical rendering of a part of the hierarchically structured electronic document, and the node being associated with a simplified structured-document path-language address automatically produced by removing one or more unique name spaces; and
altering the structured-document path-language expression effective to enable the structured-document path-language expression to treat a blank value of the node as a zero.

34. The method of claim 33, wherein the act of altering is performed without user interaction.

35. The method of claim 33, wherein the structured-document path-language expression comprises a mathematical function and wherein the act of altering is effective to enable the structured-document path-language expression to produce a numerical result when evaluated.

36. The method of claim 33, wherein the structured-document path-language expression comprises XML Path Language (XPath) and the hierarchically structured electronic document comprises XML.