Checking XPath Expressions

Checking XPath Expressions

The Xalan package has a handy example program,, that enables you to apply an XPath expression to a document and see what the results would be, which is great for testing. To run this example, you need to compile into ApplyXPath.class using the java.exe tool that comes with Java.

As an example, Ill apply the XPath expression PLANET/ NAME to planets.xml using ApplyXPath.class. Heres the result, displaying all <NAME> elements that are children of <PLANET> elements (the <output> tags are added by ApplyXPath):

 %java ApplyXPath planets.xml PLANET/NAME  <output>  <NAME>Mercury</NAME><NAME>Venus</NAME><NAME>Earth</NAME>  </output> 

Inside XSLT
Inside Xslt
ISBN: B0031W8M4K
Year: 2005
Pages: 196

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: