473,473 Members | 2,060 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Need help for xml schema

955
I had develop an xml schema for checking type of data
as
<xs:simpleType name="O_FMExchangeRate" xmlns:xs="http://
www.w3.org/2001/XMLSchema">
<xs:restriction base="xs:float">
<xs:minExclusive value="0.0000001"/>
<xs:pattern value="d(0)|\d{1,5}|\d{1,5}\.\d{1,7}|\.\d{1,7}|
\d{1,5}\.|\+\d{1,5}|\+\d{1,5}\.\d{1,7}|\+\.\d{1,7} |\+\d{1,5}\."/>
</xs:restriction>
</xs:simpleType>

a problem is that I would like to have this field as an optional
field
but Tag pattern ... d(0)|\ (as above) didn't help me on that.
do you have any suggestion?

Sep 5 '07 #1
2 988
did you mean \d{0} instead of d(0) [a literal]?
you might also be able to just use nothing - IIRC, the xsd pattern
essentially becomes "^(pattern)$" in a regex, so comparing in C#, both
the following seem to work OK:
@"^(\d{0}|(\d{2}))$"
@"^(|(\d{2}))$"

Marc
Sep 5 '07 #2
Note I was deliberately using a simpler pattern for testing!

And for the pedants, yes, d(0) is the literal d0 with a capture group,
not the literal d(0) as my other post might have suggested.

Marc
Sep 5 '07 #3

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

Similar topics

7
by: Mike Kamermans | last post by:
I hope someone can help me, because what I'm going through at the moment trying to edit XML documents is enough to make me want to never edit XML again. I'm looking for an XML editor that has a...
1
by: comic_rage | last post by:
Hi, I am writing C# code to produce xml schema. //Create attribute XmlSchemaAttribute att2 = new XmlSchemaAttribute(); att2.Name = "CustomerID"; att2.SchemaTypeName = new...
1
by: comic_rage | last post by:
Hi, I am trying to add an annotation with a documentation, which contains several nodes. So far, I having a problem on how to code this with C#. Any help is appreciated. <xsd:annotation>...
0
by: comic_rage | last post by:
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"...
1
by: Rohit Raghuwanshi | last post by:
Hello all, we are running a delphi application with DB2 V8.01 which is causing deadlocks when rows are being inserted into a table. Attaching the Event Monitor Log (DEADLOCKS WITH DETAILS) here....
0
by: S Wheeler | last post by:
Hi All - I am creating a upgrade utility that transfers an bin / exe image over an xml stream. But I can not seem to get the deserialization of the binary field to work correctly. What I have is...
9
by: Tony Girgenti | last post by:
Hello I developed and tested a web application using VS.NET 2003, VB, .NET Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1. It uses a web form. I tried doing this without any help, but i'm...
4
by: Hemant Shah | last post by:
Folks, I am having problem with an application that uses static SQL, the application basically browses through the table given start and end key most of the time it is processed from begining to...
11
by: NewGuytoNetworking | last post by:
I have an XML that my company sends out daily it used to be created by SQL but I now have to use crystal reports and I can't seem to get it to line up the same. Please help with any references or how...
3
by: Water Cooler v2 | last post by:
Sorry for asking this beginner question. I've written DTDs so far and read about XML Schemas. I understand that they are a replacement of the DTD fundamentally, and therefore allow for the...
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...
1
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...
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...
0
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,...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
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...

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.