473,800 Members | 2,613 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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"
elementFormDefa ult="qualified" attributeFormDe fault="unqualif ied"
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 attributeFormDe fault="unqualif ied"
elementFormDefa ult="qualified"
targetNamespace ="http://www.ciber.com/myfile" version="1.0"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema">

Here is my code

public void CreateSchemaRoo t(string strNameSpace, bool
bElemFormDefaul t, bool bAttrForm, string strNamespace)
{
if (strNamespace.L ength > 0)
{
schema.TargetNa mespace = strNamespace;
XmlSerializerNa mespaces efilens = new XmlSerializerNa mespaces();
efilens.Add("", "strNameSpace") ;
schema.Namespac es = efilens;
}

if (bElemFormDefau lt)
schema.ElementF ormDefault = XmlSchemaForm.Q ualified;
else
schema.ElementF ormDefault = XmlSchemaForm.U nqualified;
if (bAttrForm)
schema.Attribut eFormDefault = XmlSchemaForm.Q ualified;
else
schema.Attribut eFormDefault = XmlSchemaForm.U nqualified;
schema.Version = "1.0";
XmlSerializerNa mespaces ns = new XmlSerializerNa mespaces();
ns.Add(strNameS pace, schemaNS);
schema.Namespac es = ns;
}
Any help is greatly appreciated. Thanks

Nov 12 '05 #1
0 1102

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

Similar topics

3
1867
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 have to be unique only within each document. I.e., the following is valid: <doc> <file>AAA</file> <file>BBB</file> </doc>
1
1225
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 the schema? here is the example I found on the net, that I am trying to validate, and it doesn't work... link: http://www.laltruiste.com/document.php?compteur=2&rep=4&evolution=8
1
2236
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 validates. ============== BASE XMLSCHEMA ================= <?xml version="1.0"?> <xs:schema targetNamespace="test" xmlns="test" xmlns:xs="http://www.w3.org/2001/XMLSchema">
0
1185
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 version="1.0" encoding="UTF-8" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="departement"> <xs:complexType>
2
1542
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" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="Loan"> <xs:complexType> <xs:sequence> <xs:element name="Borrower" maxOccurs="unbounded"> <xs:complexType> <xs:attribute name="BorrID" use="required">
1
2864
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 types and of more elaborate classes implementing IXmlSerializable. The resulting WSDL file for the webservice has two separate schemas in its <types> sections, and the client proxy (generated with wsdl.exe) is missing the definitions of the...
2
1699
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 writing it back to the file makes it invalid, not obeying rules of this schema. Here is the simple test program performing this operation. __________________________________________________ using System; using System.Data; namespace DataSetTest
1
6041
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
2826
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? Here’s a working example: <xs:schema id="schema" targetNamespace="http://tempuri.org/schema.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/schema.xsd" xmlns:mstns="http://tempuri.org/schema.xsd" ...
0
9691
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9551
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10507
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10279
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9092
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7582
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6815
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5607
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3765
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.