473,387 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

need help with my schema root in my xsd file

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
0 1076

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Victor Engmark | last post by:
How do I define that the contents of an element should be unique only in a sub-tree of the whole XML file? In my case, I have several documents, each containing several files. The file names...
1
by: Dominique | last post by:
I want to use a namespace in an XML file, that I have created in the schema for this xml file. do i have to redefine this namespace in the xml file? or is there a way to re-use the definition from...
1
by: Cat | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm getting a validation error when I try to restrict the content of nested groups with xs:redefine whereas the same restriction on xs:element's...
0
by: Xavier Seneque | last post by:
hello, i'm trying to parse an XML file from a java program, and the structure of the XML document is described in a schema file. here is the simple schema file (departement.xsd) : <?xml...
2
by: Rajesh Jain | last post by:
I Have 2 separate schemas. --------------Schema 1 is defined as below----------- <xs:schema targetNamespace="http://Schemas/1" xmlns="http://Schemas/1" xmlns:xs="http://www.w3.org/2001/XMLSchema"...
1
by: louis_la_brocante | last post by:
Dear all, I am having trouble generating a client proxy for a webservice whose methods return a "complex" type. The type is complex in that it is a class whose members are a mix of primitive...
2
by: MaLec | last post by:
I’d like to use the DataSet as the container for the XML files conforming to some schema. The problem is, that the operation of reading the XML file into the DataSet having its schema and then...
1
by: tthunder | last post by:
Hi @all, Please check the following XML file and XML schema definition below first: ------- XML File (full): ------- <?xml version="1.0" encoding="UTF-8"?>
0
by: icesign | last post by:
I know that the selector of these elements has a scope relative to the element being declared, but maybe there is a way to get beyond bounds of this scope or maybe just a way to extend base element?...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.