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

what's wrong with this schema definition?

kk
I have this portion in my schema definition:

<xsd:simpleType name="MyTimeType">
<xsd:restriction base="xsd:dateTime">
<xsd:pattern value="\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}-Z"/>
<xsd:pattern
value="\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}+\d{2}:\d{2}"/>
<xsd:pattern
value="\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}-\d{2}:\d{2}"/>
</xsd:restriction>
</xsd:simepleType>

When I validate this with XMLSpy, it high-lights the second pattern
and gives this error message:

"This schema doesn't appear to be valid by itself (as a part
of anohter schema, it might still be OK): Schema error -
invalid regular expression: \ expected at position 41"

Could someone tell what's wrong with this pattern?

thanks a lot.

kk

Jul 20 '05 #1
2 1784


kk wrote:
I have this portion in my schema definition:

<xsd:simpleType name="MyTimeType">
<xsd:restriction base="xsd:dateTime">
<xsd:pattern value="\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}-Z"/>
<xsd:pattern
value="\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}+\d{2}:\d{2}"/>
<xsd:pattern
value="\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}-\d{2}:\d{2}"/>
</xsd:restriction>
</xsd:simepleType>

When I validate this with XMLSpy, it high-lights the second pattern
and gives this error message:

"This schema doesn't appear to be valid by itself (as a part
of anohter schema, it might still be OK): Schema error -
invalid regular expression: \ expected at position 41"

Could someone tell what's wrong with this pattern?


Have you tried using
\+
instead of
+
The plus symbol is meta character thus you might need to escape it to
have it literally included in the pattern

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2
kk
Martin Honnen wrote:


Have you tried using
\+
instead of
+
The plus symbol is meta character thus you might need to escape it to
have it literally included in the pattern


Thank you very much, that was dumb on my part :)

Jul 20 '05 #3

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

Similar topics

112
by: Andy | last post by:
Hi All! We are doing new development for SQL Server 2000 and also moving from SQL 7.0 to SQL Server 2000. What are cons and pros for using IDENTITY property as PK in SQL SERVER 2000? Please,...
4
by: Lénaïc Huard | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, I've some namespace problems when defining default values for attributes. My problem seems to come from the fact that the attributes are...
2
by: Shailendra Batham | last post by:
Hello Gurus, I want to put some restrictions on my attribute tag in my XML Schema, anyone out there have any idea how to do that. here is my XML and the XML Schema <?xml version="1.0"...
8
by: Drew Berkemeyer | last post by:
Hello, How can I use XSD to ignore certain nodes of an XML document. Specifically, we have an event that I want to define using XSD. I then want to validate incoming XML events with that XSD....
7
by: Lauren Wilson | last post by:
OK, I have been drowning in all kinds of articles about XML lately. The ONE thing I have not yet seen is a general discussion article about the alleged benefits of XML, especially as it affects...
2
by: Mark | last post by:
Hi... I've been trying the .Validate() method on the XmlDocument to validate some xml against a schema, but one thing I noted was that unless the document explicitly declares the schema as a...
5
by: Sek | last post by:
Hi Folks, I would like to create a XML file that adhere to the Schema definition files. My schema definition files import/include further XSD files and internal references can be to a depth...
2
by: bmichel | last post by:
Regarding the XSD schema shown below, I want to modifiy it so that: - the "owner_id" attribute in the "dog" element to exist in one of the "owner" element "id" attribute. - the "id" attribute in...
3
by: uridor | last post by:
Hello, I've been trying to make my XSD work, but I'm stuck. I did manage to narrow it down to a simple use case, so I'd appreciate it if someone could load these and see what's wrong: It's...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.