Reputation: 11
I need my XML to have the following tags, the problem is that I'm not entirely sure how to communicate the issue so google searches are not providing anything. Hopefully by seeing my question you'll understand my issue.
The beginning of the XML document that I am creating in my Java code needs to have the following in the prolog:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<?AdlibExpress applanguage="USA" appversion="5.0.0" dtdversion="2.6.3" ?>
<!DOCTYPE JOBS SYSTEM "D:\Adlib5.4\System\DTD\AdlibExpress.dtd">
The encoding is easy enough. I am having difficulty adding:
<?AdlibExpress applanguage="USA" appversion="5.0.0" dtdversion="2.6.3" ?>
I don't even know what to look for or what to call this.
Here is the library I am using
DocumentBuilderFactory docFactory1 = DocumentBuilderFactory.newInstance();
docFactory1.setNamespaceAware(true);
DocumentBuilder docBuilder1 = docFactory1.newDocumentBuilder();
// root elements
Document doc = docBuilder1.newDocument();
Theres gotta be something in one of these classes to do what I'm talking about but I'm not having luck finding it. If you're able to help me, can you also let me know how to properly communicate the issue? Thanks
Upvotes: 1
Views: 370
Reputation: 32980
<?AdlibExpress...?>
is a processing instruction.
You can create it with
doc.appendChild(
doc.createProcessingInstruction("AdlibExpress", "applanguage=\"USA\" appversion=\"5.0.0\" dtdversion=\"2.6.3\""));
Upvotes: 3