Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>Question 1:</strong></p> <p>What it looks like you're trying to do is append a <a href="http://www.javacommerce.com/displaypage.jsp?name=pi.sql&amp;id=18238" rel="nofollow">"processing instruction"</a> to your XML file. A processing instruction (PI) is a tag that encodes application-specific information, beginning with <code>"&lt;?"</code> and ending with <code>"?&gt;"</code>.</p> <p>To add a PI to your XML file, you need to use the <a href="http://msdn.microsoft.com/en-us/library/system.xml.xmltextwriter.writeprocessinginstruction.aspx" rel="nofollow"><code>WriteProcessingInstruction</code> method</a> of the <code>XmlTextWriter</code> class. There are two parts to every PI, a target and a value, and these are the two parameters accepted by the <code>WriteProcessingInstruction</code> method.</p> <p>So, in your case, you would write the following code to append the processing instruction:</p> <pre><code>XMLobj.WriteProcessingInstruction("xml", "version=""1.0"" encoding=""ISO-8859-1"" param=""on""") </code></pre> <p>which would produce:</p> <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1" param="on"?&gt; </code></pre> <p><br> <strong>Question 2:</strong></p> <p>The VB.NET equivalent of C#'s <code>null</code> is <a href="http://msdn.microsoft.com/en-us/library/0x9tb07z%28v=VS.100%29.aspx" rel="nofollow"><code>Nothing</code></a>. This keyword either specifies the default value of a value type, or a null value of a reference type.</p> <p>You should not use <a href="http://msdn.microsoft.com/en-us/library/system.dbnull.aspx" rel="nofollow"><code>System.DBNull</code></a> unless you're dealing with databases. <code>DBNull</code> represents an uninitialized variant or non-existent database column. It is <em>not</em> equivalent to <code>Nothing</code> or <code>null</code>. I agree that the first error message you get is confusing at best.</p> <p>So, instead, the line to write the DocType to the XML file should be:</p> <pre><code>XMLobj.WriteDocType("Test", Nothing, "test/my.dtd", Nothing) </code></pre> <p>which will produce:</p> <pre><code>&lt;!DOCTYPE Test SYSTEM "test/my.dtd"&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload