Go to main content

Oracle® Solaris Cluster Data Services Developer's Guide

Exit Print View

Updated: September 2015

How to Set Up the XML Parser

You have now created the networking and XML generation code for the application. The CrnpClient constructor calls a setupXmlProcessing method. This method creates a DocumentBuilderFactory object and sets various parsing properties on that object. The JAXP documentation describes this method in more detail. See https://jaxp.java.net/.

  • Create the Java code that implements the preceding logic.
    private void setupXmlProcessing() throws Exception
    dbf = DocumentBuilderFactory.newInstance();
    // We don't need to bother validating
    // We want to ignore comments and whitespace
    // Coalesce CDATA sections into TEXT nodes.