473,594 Members | 2,768 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

need help to declard type=IntType instead type="xsd:int" with xml schema

Hi,

I am writing C# code to produce xml schema.

//Create attribute
XmlSchemaAttrib ute att2 = new XmlSchemaAttrib ute();
att2.Name = "CustomerID ";
att2.SchemaType Name = new XmlQualifiedNam e("int",schemaN S);
att2.Use = XmlSchemaUse.Re quired;
ct.Attributes.A dd(att2);
I need to produce schema with custom data type instead of the
xsd:string or xsd:int

The code above will produce the following schema

<?xml version="1.0" encoding="utf-8"?>
<xsd:schema attributeFormDe fault="unqualif ied" version="1.0"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema">
<xsd:element name="Customer" >
<xsd:complexTyp e>
<xsd:sequence >
<xsd:element name="Order">
<xsd:complexTyp e>
<xsd:attribut e name="CustomerI D" type="xsd:int"
use="required" />
<xsd:attribut e name="OrderID" type="xsd:int" use="required"
/>
</xsd:complexType >
</xsd:element>
</xsd:sequence>
<xsd:attribut e name="CustomerI D" type="xsd:Strin gType"
use="required" />
</xsd:complexType >
</xsd:element>
</xsd:schema>

I need to produce schema with

<xsd:attribut e name="CustomerI D" type="IntType" use="required" />
or
<xsd:attribut e name="CustomerI D" type="StringTyp e" use="required" />
when I use
att2.SchemaType Name = new XmlQualifiedNam e("IntType",sch emaNS);

I get

<xsd:attribut e name="CustomerI D" type="xsd:IntTy pe" use="required" />

How do I get the type to equal only "IntType" without the "xsd" part?

Thanks

Nov 12 '05 #1
1 1622


co********@yaho o.com wrote:

<xsd:attribut e name="CustomerI D" type="IntType" use="required" />
or
<xsd:attribut e name="CustomerI D" type="StringTyp e" use="required" />
when I use
att2.SchemaType Name = new XmlQualifiedNam e("IntType",sch emaNS);


I would simply try
att2.SchemaType Name = new XmlQualifiedNam e("IntType")
then if your type is in no namespace.
Or if that schema is going to have a targetNamespace then I think you
need to use
att2.SchemaType Name = new XmlQualifiedNam e("IntType",
"targetNamespac eURIGoesHere")

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 12 '05 #2

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

Similar topics

12
4114
by: Jose Fernandez | last post by:
Hello. I'm building a web service and I get this error. NEWS.News.CoverNews(string)': not all code paths return a value This is the WebMethod public SqlDataReader CoverNews(string Sport) {
0
1934
by: Kaimar Seljamäe | last post by:
Hi, I have to create a web service client which uses SOAP encoding but does not use "multi-reference" values (see http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383513 item 10). If I create SOAP client like this: public class StockService : SoapHttpClientProtocol {
5
10320
by: Mike Logan | last post by:
I used WSDL.exe to generate a client side web proxy for a web service, called the web service, got the results but an array returned by the web service is not in the results. However if I use "Add Web Reference" for the same service the same function works appropriately. Here is the client proxy generated from WSDL.exe <System.Web.Services.Protocols.SoapDocumentMethodAttribute("capeconnect:AppSec:AppSecPortType#getApplicationUsers",
9
3203
by: MSDNAndi | last post by:
Hi, I have a set of simple webservices calls that worked fine using .NET Framework 1.0. I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL. What it does is to call a webservice with two parameters, one being a integer, the other one being a "String" which contains XML (not the best practice, however that is the target interface and we cannot change that).
6
10783
by: geoffrobinson | last post by:
Hi, I'm serializing an object using XmlSerializer. It is serializing, but we are getting errors upon deserialization. We use the following code to serialize: FileStream fs = new FileStream(NavCmdFile, FileMode.Create, FileAccess.Write, FileShare.None); XmlSerializer xmlFmt = new XmlSerializer(someObject.GetType());
2
3694
by: NoNickname | last post by:
Right now I'm getting this in the wsdl: <s:element minOccurs="0" maxOccurs="1" name="Items" type="tns:ArrayOfMyClass" /> I would like to get minOccurs="1" for this webmethod: public string HelloWorld(MyClass Items) {
1
1643
by: easy.lin | last post by:
.... <object id="10">door</object> .... I try to write this in clipse XSD editor <element name="object" type="string"> <attribute name="id" type="int"></attribute> </element> but get wrong message....
1
1925
by: brucepickford001 | last post by:
Hi, I have a not simple problem. I want the following XML to be schema valid <PopulationDemographic> <PersonName>Joe Blogs</PersonName> <Age>2</Age> <Category>baby</Category> </PopulationDemographic>
10
2738
by: jollysr | last post by:
Could someone please help me convert the following XML to HTML page? <?xml version="1.0" encoding="UTF-16"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema"> <SOAP-ENV:Body> <ns1:doGoogleSearchResponse xmlns:ns1="urn:GoogleSearch"...
0
7936
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
8241
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...
1
7997
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8227
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5738
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
5402
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
3853
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3893
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1203
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.