processing-instruction()


The processing-instruction() node test retrieves a set of processing-instruction (PI) nodes, which are children and siblings of element nodes or are children of the root node. Here's an XML document with a single processing instruction:

 <?xml version="1.0" encoding="ISO-8859-1"?> <Material>Leather   <?HandleThis how="somehow"   ?>   <Product>Leather Seats</Product>   <Quantity>20</Quantity> </Material><?HandleThat how="another way"   ?> 

The next expression returns the contents of the instruction, including the spaces that follow the phrase how="somehow".

 /Material/processing-instruction('HandleThis') 

The node test can identify a processing-instruction node by specifying a PI target, such as HandleThis, but the test is also valid without specifying a PI target. The next expression returns two nodes.

 count(/descendant::processing-instruction()) 

The XML declaration statement (which starts with <?xml) is not a processing instruction and is not available to an XPath expression.




SOA for the Business Developer. Concepts, BPEL, and SCA
SOA for the Business Developer: Concepts, BPEL, and SCA (Business Developers series)
ISBN: 1583470654
EAN: 2147483647
Year: 2004
Pages: 157
Authors: Ben Margolis

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net