473,486 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Trouble using XmlValidatingReader against an XSD schema containing MaxLengths

Hello,

I am using the XmlValidatingReader to validate xml against an XSD
schema. Some of the elements in the XSD have a max length set. I am
having issues validating fields containing xml 'special' characters.
The validator barks that I have exceeded the max length when in fact
the actual text is below the max length. I have determined that the
validator is not taking these encoded characters into account.

So for example, I have a field with a max length of 12 set on the XSD.
When the element contains 'This & That' (length 11) I get a validation
error thrown because it is counting the encoding -- 'This & That'
(length 15). I would have thought it would treat & as one
character. If I remove the '&' character it works fine. If I remove
'This' from the beginning, it works fine.

Is there any way around this short of removing the length constraint
from the XSD?

Thanks,

BM

Nov 12 '05 #1
0 1047

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

Similar topics

1
1826
by: Alejandro Calbazana | last post by:
Hello, Should the XmlValidatingReader validating xml against an xsd serially (e.g. - does the XML have to be in the correct position in order for a document to be valid)? For example, I am...
4
2387
by: Jon Poploskie | last post by:
Hello, I have an xsd file that I'm trying to use to validate some xml against. I'm hoping this is a simple problem, but I just don't see it. I get the error "The 'role' element is not...
0
4658
by: Harold Putman | last post by:
The XmlValidatingReader seems to have changed drastically in .Net Frameworks 1.0 SP3 and beyond with regards to validating XML files that are XML Schemas. Consider the following code: ---...
1
9081
by: aevans1108 | last post by:
Greetings All If this is the wrong place to post this question, please give me a push in the right direction. Thanks. I know there has to be a simpler way to do this, but this is as simple a...
2
1792
by: matthew.schneider | last post by:
I have a defined XML Schema, and XML documents containing data that I validate against it. Periodically, I will have a data document that will contain extra elements that are not part of my schema....
0
1140
by: Stefan Roth | last post by:
Hi, I have an existing DOM-object (instance of XmlDocumnt) filled with some XML data. Now I want to validate that document against an XML schema. I have a reference to an XML Schema for that...
2
7135
by: josh | last post by:
Hi, I am trying to validate cXML documents against cXML.dtd using the XmlValidatingReader. If I set the XMLValidatingReader's ValidatingType to ValidationType.DTD, I get the following...
1
1813
by: Plop69 | last post by:
need some help on following: xml file 1 <TEST xmlns="http://test" > <OK>mlkddflmkj</OK> </TEST> xml file 2
12
8522
by: Plop69 | last post by:
need some help on following: xml file 1 <TEST xmlns="http://test" > <OK>mlkddflmkj</OK> </TEST>
0
7099
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6964
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
5430
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,...
1
4864
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4559
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
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1378
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 ...
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
262
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.