473,394 Members | 1,048 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,394 software developers and data experts.

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
XmlSchemaAttribute att2 = new XmlSchemaAttribute();
att2.Name = "CustomerID";
att2.SchemaTypeName = new XmlQualifiedName("int",schemaNS);
att2.Use = XmlSchemaUse.Required;
ct.Attributes.Add(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 attributeFormDefault="unqualified" version="1.0"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="Customer">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Order">
<xsd:complexType>
<xsd:attribute name="CustomerID" type="xsd:int"
use="required" />
<xsd:attribute name="OrderID" type="xsd:int" use="required"
/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="CustomerID" type="xsd:StringType"
use="required" />
</xsd:complexType>
</xsd:element>
</xsd:schema>

I need to produce schema with

<xsd:attribute name="CustomerID" type="IntType" use="required" />
or
<xsd:attribute name="CustomerID" type="StringType" use="required" />
when I use
att2.SchemaTypeName = new XmlQualifiedName("IntType",schemaNS);

I get

<xsd:attribute name="CustomerID" type="xsd:IntType" use="required" />

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

Thanks

Nov 12 '05 #1
1 1615


co********@yahoo.com wrote:

<xsd:attribute name="CustomerID" type="IntType" use="required" />
or
<xsd:attribute name="CustomerID" type="StringType" use="required" />
when I use
att2.SchemaTypeName = new XmlQualifiedName("IntType",schemaNS);


I would simply try
att2.SchemaTypeName = new XmlQualifiedName("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.SchemaTypeName = new XmlQualifiedName("IntType",
"targetNamespaceURIGoesHere")

--

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
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
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...
5
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...
9
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. ...
6
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...
2
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...
1
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...
1
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>...
10
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/"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
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
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,...
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...
0
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...

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.