469,626 Members | 994 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,626 developers. It's quick & easy.

XmlValidatingReader not working with key constraint of type base64Binary

Hi!

I have this particular problem. I have to use a base64Binary attribute
as a key for one element in my schema. Everything is validating ok in
XmlSpy, but when using the .Net XmlValidatingReader to validate my Xml
file, the duplicate key doesn't seem to be checked. When using a
string attribute type, the validation works. However, I need to use
the base64binary attribute as the key.

To show what's the problem, I've compiled a small console application
showing the problem provided with the class file, the xml files and the
schemas.

In the .config file, the application is set-up to use the following
files:

problematicData.xml
problematicSchema.xsd

This is where I'm using the base64Binary attribute as a key. If you
want to see the validation working on a string attribute, change the
..config file so that it looks like this:

<add key="XmlFileName" value="workingData.xml"/>
<add key="XsdFileName" value="workingSchema.xsd"/>

My question is: Is there any way in .Net to make the
XmlValidatingReader work with a key on a base64Binary attribute???

Here's the link to the .zip file containing the appropriate files:
http://h1.ripway.com/BredStik/problematicSchema.zip

Thanks for your help!

Nov 23 '05 #1
3 1420
When I validate your problematic xml and xsd files through a validator in
..net framework 1.1 I get this error:

There is a duplicate key sequence 'AAA' for 'defaultNamespace:pkEmploye' key
or unique identity constraint. An error occurred at problematicData.xml,
(5, 3).

Isnt this the error that you expect?

"BredStik" <ml*********@pcms.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Hi!

I have this particular problem. I have to use a base64Binary attribute
as a key for one element in my schema. Everything is validating ok in
XmlSpy, but when using the .Net XmlValidatingReader to validate my Xml
file, the duplicate key doesn't seem to be checked. When using a
string attribute type, the validation works. However, I need to use
the base64binary attribute as the key.

To show what's the problem, I've compiled a small console application
showing the problem provided with the class file, the xml files and the
schemas.

In the .config file, the application is set-up to use the following
files:

problematicData.xml
problematicSchema.xsd

This is where I'm using the base64Binary attribute as a key. If you
want to see the validation working on a string attribute, change the
.config file so that it looks like this:

<add key="XmlFileName" value="workingData.xml"/>
<add key="XsdFileName" value="workingSchema.xsd"/>

My question is: Is there any way in .Net to make the
XmlValidatingReader work with a key on a base64Binary attribute???

Here's the link to the .zip file containing the appropriate files:
http://h1.ripway.com/BredStik/problematicSchema.zip

Thanks for your help!

Nov 23 '05 #2
Hi!

Thanks for the "heads-up". Actually, I put the wrong xsd and xml in
the .zip file I shared. You can download the file again and overwrite
the previous files. You'll see that the exact same key is defined but
on a base64binary attribute and no validation error will occur. Any
way to make this work? Thanks again.

Nov 23 '05 #3
This was an issue in .net framework 1.1. If you upgrade to .net 2.0, keep
using the same XmlValidatingReader code, you will get an error.

Thanks,
Zafar

"BredStik" <ml*********@pcms.com> wrote in message
news:11*********************@g44g2000cwa.googlegro ups.com...
Hi!

Thanks for the "heads-up". Actually, I put the wrong xsd and xml in
the .zip file I shared. You can download the file again and overwrite
the previous files. You'll see that the exact same key is defined but
on a base64binary attribute and no validation error will occur. Any
way to make this work? Thanks again.

Nov 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.