S
Shawn
Hi!
I've spent several hours finding a solution to this problem without any
luck. Hopefully someone here can provide me with an answer.
When I run this code I get an error saying: "Reference to undeclared
namespace prefix: 'esu'."
My question is simple: How do I add a namespace??
This is what the namespace should look like:
<esu:institusjoner xmlns:esu="http://www.utdanning.no/schema/institusjon/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.utdanning.no/schema/institusjon/
C:\schemas\schema_institusjon.xsd">
Set xmldoc = Server.CreateObject("Microsoft.XMLDOM")
Set root = xmldoc.createNode("element", "esu:myroot", "")
xmldoc.appendChild(root)
Set node_1 = xmldoc.createNode("element", "esu:user", "")
xmldoc.documentElement.appendChild(node_1)
Set node_2 = xmldoc.createNode("element", "esu:id", "")
node_2.Text = "1"
node_1.appendChild(node_2)
Set node_3 = xmldoc.createNode("element", "esu:name", "")
node_3.Text = "Shawn"
node_1.appendChild(node_3)
xmldoc.save(server.mappath("xml.xml"))
Thanks,
Shawn
I've spent several hours finding a solution to this problem without any
luck. Hopefully someone here can provide me with an answer.
When I run this code I get an error saying: "Reference to undeclared
namespace prefix: 'esu'."
My question is simple: How do I add a namespace??
This is what the namespace should look like:
<esu:institusjoner xmlns:esu="http://www.utdanning.no/schema/institusjon/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.utdanning.no/schema/institusjon/
C:\schemas\schema_institusjon.xsd">
Set xmldoc = Server.CreateObject("Microsoft.XMLDOM")
Set root = xmldoc.createNode("element", "esu:myroot", "")
xmldoc.appendChild(root)
Set node_1 = xmldoc.createNode("element", "esu:user", "")
xmldoc.documentElement.appendChild(node_1)
Set node_2 = xmldoc.createNode("element", "esu:id", "")
node_2.Text = "1"
node_1.appendChild(node_2)
Set node_3 = xmldoc.createNode("element", "esu:name", "")
node_3.Text = "Shawn"
node_1.appendChild(node_3)
xmldoc.save(server.mappath("xml.xml"))
Thanks,
Shawn