Namespeces, prefixes, and Attributes?

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I am using the following code to write an attribute to an element node
<pre class="prettyprint writer.WriteAttributeString("", "xsi", "", "http://www.w3.org/2001/XMLSchema-instance");
writer.WriteAttributeString("noNamespaceSchemaLocation", "xsi", "amzn-envelope.xsd");
[/code]
<br/>
But this gives:
<AmazonEnvelope xsi="http://www.w3.org/2001/XMLSchema-instance" p1:noNamespaceSchemaLocation="amzn-envelope.xsd" xmlns:p1="xsi . . . . .<br/>

I would like to see:
<pre class="prettyprint <AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="amzn-envelope.xsd
[/code]
<br/>
How can I get rid of the pxxx? I would like to add a namespace to xsi but that just adds another pxxx.


<hr class="sig Kevin Burton

View the full article
 
Back
Top