Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there an editor with an easy way to extract element sctructures?

Status
Not open for further replies.

PPettit

IS-IT--Management
Sep 13, 2003
511
US
Does anyone know of an XML editor that makes it easy to extract element structures?

Using this as an example:
Code:
<?xml version="1.0"?>
<catalog>
   <book id="bk101">
      <author>Gambardella, Matthew</author>
      <title>XML Developer's Guide</title>
      <genre>Computer</genre>
      <price>44.95</price>
      <publish_date>2000-10-01</publish_date>
      <description>An in-depth look at creating applications 
      with XML.</description>
   </book>
</catalog>

I'd like to be able to select a tag (ex: <description>), hit a button or something, and then be able to paste something along the lines of "catalog.book.description" into another document.

 
>I'd like to be able to select a tag (ex: <description>), hit a button or something, and then be able to paste something along the lines of "catalog.book.description" into another document.

That I don't know which would have that exact short-cut. But, the absolute path is relatively trivial. I come across haphazardly some free editors that may provide that suggestion or hint.
[ul][li]EditiX (free edition) has a popup info displaying the absolute path including "position" index.[/li]
[li]epcEdit (free edition) has the absolute path (without position index) displayed on the status bar[/li][li]and many, many more...[/li][/ul]
Both do not offer stand ready to copy-and-paste and I don't even blame them because it is by large a dull matter of not much challenge.

Why then that absolutely is mostly so trivial? It is because those xpaths assume a fixed context (the document root). The power of xpath is largely of its perspective of varying context node with respect to which some other node is reachable (through the axes). Its powerful plays are also due to the built-in functions for filtering group of nodes out of unwanted groups.

If there are N nodes in the document, the cardinality of absolute xpaths is of order O(N). And with varying context node, the cardinality of point-to-point xpaths is of order O(N^2) already by a naive analysis, not touching yet groups of nodes. Hence, it is most easily out of control in complexity to be handled by any kind of editors.

That's why absolutely path is kind of trivial and less interesting. This is my analysis.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top