Home > Articles

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

Q&A

  1. How can I tell if an expression will match a node or a node-set?

  1. Unless a predicate specifically targets a specific node or the expression matches an attribute, you can't tell whether your expression will match a node or a node-set. This is by design because it actually shouldn't matter whether you are matching a node or a node-set; each node matching the expression is supposed to be processed. You can download a tool called XPath Visualizer from http://www.topxml.com/
    xpathvisualizer/default.asp
    . This tool can help you determine whether your expression is correct.

  1. How can I tell whether an expression in a value-of command will yield a text value or a tree fragment?

  1. You have no way of knowing whether you are getting a text value or a tree fragment unless you use the text() function.

  1. I have a stylesheet that keeps outputting text that I didn't ask for. How can I get rid of this problem?

  1. The default behavior of the stylesheet causes this problem. Check whether all nodes are being matched by a template. Also, check that your expression outputting values doesn't match a tree fragment.

  • + Share This
  • 🔖 Save To Your Account