473,804 Members | 3,194 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Class generation from XSD and datatype mapping

Hi all,

I have the need to generate C# classes from XSD schemas, and the XSD.exe
tool is just (almost) great for that. I said "almost" because it seems that
every XML Schema datatype other than boolean is rendered as a String
field/property.

As an example, I am getting:

[System.Xml.Seri alization.XmlEl ementAttribute( DataType="posit iveInteger")]
public string Port {
get {
return this.portField;
}
set {
this.portField = value;
}
}

I would like to have:

[System.Xml.Seri alization.XmlEl ementAttribute( DataType="posit iveInteger")]
public UInt32 Port {
get {
return this.portField;
}
set {
this.portField = value;
}
}

More generally, is it possible to have datatype mapping include other value
types, such as Int32, or DateTime?

Thanks in advance, kind regards,
Vanni
Oct 29 '07 #1
0 1181

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

Similar topics

4
2390
by: clintonG | last post by:
I'd like to know about application(s) or the name by which the following process is referred which would allow a business analyst to enter the following statements which when submitted would result in the generation of class library members... "Are you an individual person not working?" if no, ask "have you ever worked for an employer?" if no, ask "Are you thirteen years of age or younger?" ...
1
1903
by: Dave56 | last post by:
I am trying to create an class (in vb.net) that will serialize to produce xml as follows: ------------------------------------------ <?xml version="1.0" encoding="utf-8"?> <TotalCostData> <Ship DataType="Money" Currency="USD">1.00</Ship> <Total DataType="Money" Currency="USD">35.00</Total> </TotalCostData> ------------------------------------------
4
1597
by: Nikolay Petrov | last post by:
I am searching for an idea how to optimize some of my code. Let's say I have a class, which exposes some properties: Class Dummy1 Private m_sValue1 As String Private m_sValue2 As String Public Property Value1() As String Get Value1 = Me.m_sValue1
3
2810
by: Peter Kirk | last post by:
Hi I am reading metadata from a database (sql server) - for example metadata describing columns in a table. This metadata includes information about the datatype of the column - for example "decimal", "small int", "varchar", "image", "char" and so on. Is there some built-in functionality in .net for converting these datatypes to c# datatypes? For example, "varchar" could map to System.string. Or do I need to write my own type-mapping...
11
1690
by: food4uk | last post by:
Dear all : I am not good at programming, please give a hand. My data structure is very similar as an array. I actually can use the std::vector as container to organize my data objects. However, the behaviours of std::vector::iterator can not meet my requirements. I need to redefine the vector::iterator's behavious such as ++. It means "next position in the object sequence" in STL but now I redefine it to mean "next position within a 2-d...
3
2924
by: toton | last post by:
Hi, I want to specialize template member function of a template class . It is creating some syntax problem .... Can anyone say how to do it ? The class is something like this template<typename T,typename Alloc = std::allocator<T class CircularBuffer4 { public: typedef typename CircularBuffer<T,Alloc>::size_type
1
260
by: Mani Jayadevan | last post by:
Sevket, Were you able to resolve the issue? I am facing the same problem. If you have already resolved it please let me know how you did it? Thanks Mani EggHeadCafe - .NET Developer Portal of Choice http://www.eggheadcafe.com
5
1523
by: tshad | last post by:
In VS 2003, I am setting up an abstract class that is setting up classes for each datatype of VB.Net (as well as C#). I am trying to set it up so that most of the work is done in the Abstract Class. It seems to work pretty well. I have the actual data memory variables stored as an object as each class will use it as a different type of object (not sure if this is a problem). The system can tell if the variable is a string, boolean or...
1
1565
by: meyis | last post by:
hai i am meyis i need a java program code for date generation.(mssql-back end) Fields are fromdate and todate both field are datetime datatype. Button:-save,cancel,exit both dates are given by the user how to generate the list of date between these two date. ie.lists of date between the fromdate and todate with datatype datetime
0
9579
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
10578
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
10321
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
10077
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...
0
9152
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...
0
5522
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
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2991
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.