472,783 Members | 981 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,783 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 1594


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: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.