William Vambenepe's blog

IT management in a changing IT world

According to the currently adopted definition by FAO/WHO, buy in online uk viagra are: ‘Live microorganisms which when administered in adequate amounts confer a health benefit on the host’.This original definition excluded naturally occurring herbal viagra for women, such as gastric juice and hydrogen peroxide (they kill micro-organisms but are not produced by micro-organisms), and also excluded synthetic compounds such as the sulfonamides (which are antimicrobial agents).Examples include , progressive free viagra online, and fractional relaxation.Practitioners of human factors engineering believe that there is much that cheap generic viagra substitutes may usefully gain by emulating concepts in aviation safety, where it was long ago realized that it is dangerous to place too much responsibility on one "superhuman" individual and expect him or her not to make errors.Secondary care medical services are provided by medical cheapest viagra in uk in their offices or clinics or at local community hospitals for a patient referred by a primary care provider who first diagnosed or treated the patient.

24
Jan
2006

Schema-based XPath tool

by William (@vambenepe on Twitter)

Most XML editors offer an XPath tool that allows one to test and fine-tune XPath expressions by running them against XML documents. Very helpful but also potentially very deceptive. With such a tool it is very easy to convince oneself that an XPath expression is correct after running it against a few instance documents. And a month later the application behave erratically (in many cases it probably won’t break it will execute the request on the wrong element which is worst) because the XPath expression is ran on a different document and what it returns is not what the programmer had in mind. This is especially likely to occur as people use and abuse shortcuts such as “//” and ignore namespaces.

What we need is an XPath tool that can run not only run the XPath against an instance document but can also run it against a schema. In the later case, the tool would flag any portion of the schema that can possibly correspond to a node in the resulting nodeset. It would force programmers to realize that their //bar can match the /foo/bar that they want to reach but it could also match something that falls under the xsd:any at the end of the schema. And the programmer has to deal with that.

Related posts:

  1. Just-in-scope (or just-if-i-care) validation
  2. The elusive XPath nodeset serialization
  3. XPath brain teasers: graph queries in XPath 1.0
  4. Less is more: inventory of XPath subsets
  5. Who needs XPath fragment-level PUT?
  6. We won’t get rid of SSN-based authentication anytime soon…
AddThis Social Bookmark Button Follow @vambenepe on Twitter.

One Response to “Schema-based XPath tool”

  1. pankaj_kumar Says:

    Welcome to the world of “dynamic programming”! BTW, as Bruke Eckel would say, you can trade strong typing for strong testing(ref: http://www.mindview.net/WebLog/log-0025 ).

Leave a Reply