BizTalk Utilities CV ,   Jobs ,   Code library  
 
The org.xml.sax.XMLReader Interface
org.xml.sax.XMLFilter Interface
org.xml.sax.Locator Interface
org.xml.sax.HandlerBase Handler
org.xml.sax.ext.LexicalHandler Handler
org.xml.sax.ext.DeclHandler Handler
Overview of Content Handlers
Overview of DTD Handlers
java.xml.sax.InputSource Class
org.xml.sax.helpers.XMLReaderFactory Class
javax.xml.transform.URIResolver Class
javax.xml.transform.TransformerFactory Class
javax.xml.transform.Transformer Class
javax.xml.transform.Templates Class
javax.xml.transform.stream.StreamSource Class
javax.xml.transform.stream.StreamResult Class
javax.xml.transform.Source Class
javax.xml.transform.sax.SAXSource Class
javax.xml.transform.sax.SAXResult Class
javax.xml.transform.Result Class
<< XSLT
.NET and XML >>

By :Mark Wilson
I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :03/24/2008
Times viewed :239

 

The org.w3c.dom.ProcessingInstruction Interface

All Super interfaces: org.w3c.dom.Node

Members

Signature

Public methods

String

getData()

String

getTarget()

void

setData(String data)

Overview

The ProcessingInstruction interface represents a "processing instruction", used in XML as a way to keep processor-specific information in the text of the document.

Example of handling ProcessingInstructions in SAX

Processing instructions within XML are handled in a bit of special case as they are not considered XML elements. SAX defines a specific call back method for handling PIs(Processing Instructions). In a real application that is using XML data, this is where an application should receive instructions and variable values or execute methods to perform application-specific processing. E.g. the apache cocoon publishing framework might set flags to perform transformation on the data once it is parsed or to display the xml as a specific content type.

public void processingInstruction(String target, String data){

   System.out.println("PI: target: "+target+" and Date :"+data);

 }

Example of handling ProcessingInstructions in DOM

The ProcessingInstruction node in the DOM is a little bit of a break from what you have seen so far: to fit the syntax into the Node interface model, the getNodeValue() method returns all data instructions within a PI(ProcessingInstruction) in one String. This allows quick output of the PI. If you were writing an application that received PIs from an XML document, you might prefer to use the actual ProcessingInstruction interface; although it exposes the same data, the method names( getTarget() and getData()) are more in line with a PI’s format. With this understanding, you can add in the code to print out any Pis in supplied document:

            Case Node.PORCESSING_INSTRUCTION_NODE:

                        node.getNodeName();

                        node.getNodeValue();

//Perform your processing here


Rate this article on a scale of 1 to 10

Your vote :  


 

Recent Jobs

An immediate job opportunity as a B
Software Developers Needed in Charl
Sr. Software Engineer - Analytics
Immediate Mainframe openings for Ch
Immediate TANDEM-TAL openings for C

View all Jobs (Add yours)
View all CV (Add yours)



answering service
help desk services
swimming pool contractor
help desk
water softener
Teleconference
Host Department NOLIMIT Web Hosting
MSN
sunglasses


    Email TopXML  

Front Page Daily Stuff TopXML Forum XML blogs XML Newsgroups BizTalk Biztalk Utilities Biztalk Utilities Tutorial B2B SAP XML Microsoft .NET Dotnet System XML Soapformatter SQLXML XMLserializer XQuery PHP PHP SimpleXML PHP XML Dom PHP XML RPC PHP XSLT Java Java Java XML Xalan Microsoft ASP ASP Schemas XML SQL Server XML XMLDom XSL XSL Tutorial XSLT Stylesheets General Javascript CSS XHTML WAP