Example 6-10: Testing our new xmldoc: URL handler

import java.net.URL;
import oracle.xml.parser.v2.*;
import java.io.*;
import XMLDocURLStreamHandlerFactory;
import XMLHelper;

public class TestXMLDocURL {
  // debug_main is Oracle8i Java Stored Procedure Debugging entry point
  public static void debug_main() throws Exception {
    main(null);
  }
  public static void main(String[] args) throws Exception {
    // Enable the use of xmldoc URL's in this session
    XMLDocuments.enableXMLDocURLs();
    // Create an xmldoc URL for the /plays/shakespeare/dream.xml file
    URL u = new URL("xmldoc:/plays/shakespeare/dream.xml");
    // Parse the shakespeare document
    XMLDocument xmldoc = XMLHelper.parse(u);
    // Create an xmldoc URL for the /testdir/EntityTest.xml'
    u = new URL("xmldoc:/testdir/EntityTest.xml");
    // Parse the test document
    xmldoc = XMLHelper.parse(u);
    // Print out the test document
    xmldoc.print(System.out);
  }
}