473,324 Members | 2,254 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,324 software developers and data experts.

MSXML schema validation on type "token"

Hi, I tried following element definition in MSXML 4.0
<xsd:element name="Identifier">
<xsd:simpleType>
<xsd:restriction base="xsd:token">
<xsd:pattern value=".*"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>

It can validate XML text like: <Identifier>abbbb</Identifier>
But not :
<Identifier>
abbbb</Identifier>

and
<Identifier>abbbb
</Identifier>

and
<Identifier>
abbbb
</Identifier>

Isn't token a white space collapsed string?

Cheers
Linkspeed
Jul 20 '05 #1
2 2764
"linkspeed" <li***********@yahoo.com> wrote in message
news:f9**************************@posting.google.c om
Hi, I tried following element definition in MSXML 4.0
<xsd:element name="Identifier">
<xsd:simpleType>
<xsd:restriction base="xsd:token">
<xsd:pattern value=".*"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
What sense does this kind of pattern have?
It can validate XML text like: <Identifier>abbbb</Identifier>
But not :
<Identifier>
abbbb</Identifier>
Sure, not at last because your pattern does not allow newlines. A token
cannot contain newlines, either.
Isn't token a white space collapsed string?


It maybe *has to be* a string containing no white spaces, but it is not
converted to one as the schema is used for validation. The schema must
match the XML *as is*, not as *would be*. If you used base="xsd:string"
as restiction base it also would not have worked out (because of the
pattern).

Martin
Jul 20 '05 #2
In article <3f***********************@newsread2.arcor-online.net>,
Martin Boehm <ng********@arcor.de> wrote:
Sure, not at last because your pattern does not allow newlines. A token
cannot contain newlines, either.


But the token type has a whiteSpace facet with value "collapse", so
the newline should be turned into a space and then removed *before*
testing for validity.

-- Richard
--
Spam filter: to mail me from a .com/.net site, put my surname in the headers.

FreeBSD rules!
Jul 20 '05 #3

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

Similar topics

1
by: Najm Hashmi | last post by:
Hi all , I am trying to create a store procedure and I get the following error: SQL0104N An unexpected token "END-OF-STATEMENT" was found following "END". Expected tokens may include: "JOIN...
3
by: Frodo Baggins | last post by:
Hi All, I have a piece of code (not written by me) that is failing on compile with the error: pasting "xdr_ndmp_connect_open_request" and "," does not give a valid preprocessing token The...
1
by: G Fernandes | last post by:
Hi, can someone tell me what the following words mean as per C/clc: 1) token 2) token sequence 3) scalar variable 4) vector
10
by: Ian Lazarus | last post by:
Hello. How do "unresolved token" link errors occur. How do I fix them? Linking... LINK : error LNK2020: unresolved token (0A000015) ??_7type_info@@6B@ LINK : error LNK2020: unresolved token...
2
by: P | last post by:
Hi all, I'm trying to run the following code taken from http://blogs.ittoolbox.com/database/technology/archives/006045.asp# select substr(tablespace_name,1,30) as "Tablespace Name", case...
4
by: lisa | last post by:
I have an XML file that starts like this: <?xml version="1.0" encoding="ISO-8859-1" xmlns:fn="http://www.w3.org/2005/xpath-functions"?> <Authors> <Author> <ID>2</ID>...
5
by: Damien | last post by:
Hi all, I'm using a pretty standard C++ Singleton class, as below: template <typename T> class Singleton { public: static T* Instance() {
12
by: Dave H. | last post by:
Please redirect me if this message is posted to the wrong group. Given the intention of delivering content to an HTTP user agent (such as Internet Explorer) which is to be immediately opened by...
0
by: kellygreer1 | last post by:
I'm writing an .ashx page that needs to be able to write files to a network share. Example: string fullPath = @"\\someserver\someshare\log.txt"; File.WriteAllText(fullPath,"test"); I seem to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.