I want to use a namespace in this format "name1:name2:name3", but when I try to use it in my vb class like this
Namespace name1:name2:name3
Partial Public Class Message
End class
End namespave
I get an error: Declaration expected.
I have no control over the namespace so I can not change it.
Thanks in advance!
EDIT
I use xsd.exe to autogenerate a class fromn an xsd. I use the n switch to set the namespace. I get the namespace from the organization who provides the xsd and the namespace is on the form "ukm:sst:collection:detail". I have to use it in my class to get the xml i serialize from the class validated.
My xml should look like this
<?xml version="1.0" encoding="UTF-8" ?>
<message xmlns="ukm:sst:collection:detail" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance" xsi:schemaLocation="ukm:sst:collection:detail">
EDIT2
My class:
<System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.17929"), _
System.SerializableAttribute(), _
System.Diagnostics.DebuggerStepThroughAttribute(), _
System.ComponentModel.DesignerCategoryAttribute("code"), _
System.Xml.Serialization.XmlTypeAttribute([Namespace]:="ukm:sst:collection:detail"), _
System.Xml.Serialization.XmlRootAttribute("melding", [Namespace]:="ukm:sst:collection:detail", IsNullable:=False)> _
Partial Public Class Message
But my xml is missing the xsi:schemaLocation attribute
my xml looks like:
<?xml version="1.0" encoding="utf-8"?>
<message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="ukm:sst:collection:detail">
but the xml should look like:
<?xml version="1.0" encoding="UTF-8" ?>
<message xmlns="ukm:sst:collection:detail" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance" xsi:schemaLocation="ukm:sst:collection:detail test_v2_0.xsd">
I have the Imports System.Xml.Serialization in my autogenerated class.
What is it I'm doing wrong?