364,085 Members | 5289 Browsing Online
Community for Developers & IT Professionals
Bytes IT Community

need help with my schema root in my xsd file

comic_rage@yahoo.com
P: n/a
comic_rage@yahoo.com
Hi,

I need to use C# to print the xml schema root

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.ciber.com/myfile"
xmlns="http://www.ciber.com/myfile"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified"
version="1.0">

I am having a problem with printing out the
xmlns="http://www.ciber.com/myfile" and maybe other pieces of info.
Because of this, I can load the xsd file on .net studio.
so far, I can only get my code to print the following

<?xml version="1.0" encoding="utf-8"?>
<xsd:schema attributeFormDefault="unqualified"
elementFormDefault="qualified"
targetNamespace="http://www.ciber.com/myfile" version="1.0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">

Here is my code

public void CreateSchemaRoot(string strNameSpace, bool
bElemFormDefault, bool bAttrForm, string strNamespace)
{
if (strNamespace.Length > 0)
{
schema.TargetNamespace = strNamespace;
XmlSerializerNamespaces efilens = new XmlSerializerNamespaces();
efilens.Add("","strNameSpace");
schema.Namespaces = efilens;
}

if (bElemFormDefault)
schema.ElementFormDefault = XmlSchemaForm.Qualified;
else
schema.ElementFormDefault = XmlSchemaForm.Unqualified;


if (bAttrForm)
schema.AttributeFormDefault = XmlSchemaForm.Qualified;
else
schema.AttributeFormDefault = XmlSchemaForm.Unqualified;
schema.Version = "1.0";
XmlSerializerNamespaces ns = new XmlSerializerNamespaces();
ns.Add(strNameSpace, schemaNS);
schema.Namespaces = ns;
}


Any help is greatly appreciated. Thanks

Nov 12 '05 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Help answer this question



Didn't find the answer to your .NET Framework question?

You can also browse similar questions: .NET Framework