不知你有沒有跟我一樣的經驗,每一次寫XPath語法都要經過編譯,執行才能知道結果,費時又麻煩。想說有個工具,先在工具上測好語法,然後在寫在程式中,那該有多好,後來我找到這一個工具,SketchPath目前是Bate,但很好用,這是用.NET 2.0,免費的可惜沒提供Source
這是官方上列出的特色
· Easy to install: A single 450KB .EXE file (Needs .NET 2.0 Also)
· XPath Location Step-Tracer - Predicate tracing
· Auto-Generate XPath Locations by selecting from
o XPath Result list
o Regular Expression Result list
o Element Tree View
o Element Nodes List
o XML Text Editor
o XPath Variables List
o XPath Step Tracer
· Save XPath expressions for re-use as variables
· Import XPath Expressions from an XML source (eg. XSLT)
· Manage Xpath variables lists in groups
· Save and load XPath variable groups in library files
· ‘As-You-Type’ bookmarking of nodeset results in Element Tree View
· Manage Xpath environment
o Manage Namespaces
o Set the Context Node
o Select the group of XPath variables required
· Auto-Complete ('Intellisense') uses 'Look-Ahead' to list available location and value nodes when typing
· A dynamically populated XPath 'Assist Pane' allows the building of complex expressions
· Syntax checking and colorizing of XPath expressions
· Uses .NET System.XML.XPath namespace to evaluate expressions
· All XML panes synchronised, viewable panes & behaviour controlled by modes
· Use Regular Expressions (Regex) to resolve XPath locations
· Simple User-Interface with just 3 main toolbars with minimal icon-clutter
· Simple Flexible and Resizeable multiline Expression Editor pane
· Package Inspection feature for ZIP compressed XML file structures, support includes:
o Word 2007 docx format
o Excel 2007 xlsx format
o Powerpoint 2007 pptx format
o XML Paper Specification xps format
o OASIS Open Document Format (ODF)
· Fast XPath location generation using an optimized 'Element Index' (updated as you type)
·
Free-flow XML Source Editor Pane with well-formedness checking
我最喜歡的就是他的Auto-Generate功能,當點選了其中的一個Element或Attribute會產生從根到Element或Attribute的XPath,省事很多。
詳情就自己看官網或DemoFlash(別人作的)吧
官網:SketchPath Demo Flash