Re: [Mono-dev] Mono .Net difference - handling xs:extension please help

2014-11-17 Thread Atsushi Eno
Actually the mono runtime team at Xamarin seems to be working on it, so 
you should ask them, not me.


But anyways current System.Xml code in referencesource is still 
incomplete to actually replace things. It will be done only after 
Microsoft's open-sourcing process is done.


Atsushi Eno


On 2014年11月15日 19:37, MarLOne wrote:

Hello Atsushi Eno,

When will Mono be replacing its library with the MS's contribution?

MarL




--
View this message in context: 
http://mono.1490590.n4.nabble.com/Mono-Net-difference-handling-xs-extension-please-help-tp4664552p4664621.html
Sent from the Mono - Dev mailing list archive at Nabble.com.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list





___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Mono .Net difference - handling xs:extension please help

2014-11-15 Thread MarLOne
Hello Atsushi Eno,

When will Mono be replacing its library with the MS's contribution?

MarL




--
View this message in context: 
http://mono.1490590.n4.nabble.com/Mono-Net-difference-handling-xs-extension-please-help-tp4664552p4664621.html
Sent from the Mono - Dev mailing list archive at Nabble.com.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Mono .Net difference - handling xs:extension please help

2014-11-15 Thread Miguel de Icaza
A planning process will take time.   Or you can step up and do the work and
contribute it

On Saturday, November 15, 2014, MarLOne infoseeker...@gmail.com wrote:

 Hello Atsushi Eno,

 When will Mono be replacing its library with the MS's contribution?

 MarL




 --
 View this message in context:
 http://mono.1490590.n4.nabble.com/Mono-Net-difference-handling-xs-extension-please-help-tp4664552p4664621.html
 Sent from the Mono - Dev mailing list archive at Nabble.com.
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com javascript:;
 http://lists.ximian.com/mailman/listinfo/mono-devel-list

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Mono .Net difference - handling xs:extension please help

2014-11-12 Thread MarLOne
Hello Timotheus,

Thanks and will try. Perhaps you can give me some assistance with
MonoDevelop/Mono.

In MS .Net, I can stay in say XP (even it has reached end of life) and still
can run VS2010 with .Net 4. But in Mint, I seem to be stuck in the version
of Mono I can get, hence that old version you are seeing. Is there a
trustworthy PPA that allows me to use the latest Mono/MonoDevelop without
having to upgrade the OS?

I am new to this kind of behavour where I have get a new OS just to get a
new version of application.

Thanks.

MarL



--
View this message in context: 
http://mono.1490590.n4.nabble.com/Mono-Net-difference-handling-xs-extension-please-help-tp4664552p4664556.html
Sent from the Mono - Dev mailing list archive at Nabble.com.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Mono .Net difference - handling xs:extension please help

2014-11-12 Thread Timotheus Pokorra
Hello MarL,

Don't worry, no need to install a new OS...

Please have a look on the download page:
http://www.mono-project.com/download/#download-lin
see the link 
http://www.mono-project.com/docs/getting-started/install/linux/#debian-ubuntu-and-derivatives
I think that even provides a recent version of MonoDevelop. Yes:
http://origin-download.mono-project.com/repo/debian/pool/main/m/monodevelop/

So after adding the Xamarin repository to your apt sources, apt-get
update   apt-get install mono-devel monodevelop should work for you.

I hope this helps,

  Timotheus

On 12 November 2014 10:34, MarLOne infoseeker...@gmail.com wrote:
 Hello Timotheus,

 Thanks and will try. Perhaps you can give me some assistance with
 MonoDevelop/Mono.

 In MS .Net, I can stay in say XP (even it has reached end of life) and still
 can run VS2010 with .Net 4. But in Mint, I seem to be stuck in the version
 of Mono I can get, hence that old version you are seeing. Is there a
 trustworthy PPA that allows me to use the latest Mono/MonoDevelop without
 having to upgrade the OS?

 I am new to this kind of behavour where I have get a new OS just to get a
 new version of application.

 Thanks.

 MarL



 --
 View this message in context: 
 http://mono.1490590.n4.nabble.com/Mono-Net-difference-handling-xs-extension-please-help-tp4664552p4664556.html
 Sent from the Mono - Dev mailing list archive at Nabble.com.
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list



-- 
Kontaktdaten:
in Plauen: 03741 7424995
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Mono .Net difference - handling xs:extension please help

2014-11-12 Thread MarLOne
Hello Timotheus,

I have the answer for you. 

I have a VM with Mint17 which has Mono runtime 3.2.8 which is one major
version that I reported earlier. So I build a console application to test
using this schema (embedded resource) with this sample instance document.

This also gives me a good test of compatibility that Mono has been
promoting. I then took this console application and run it in my Windows 7
with the most up to date .Net installed. It ran perfectly as expected
verbatim without recompilation. 

This therefore indicates the IL code thus generated is not at fault.

I then took this console application and xml document to my Mint 17 and ran
it. As expected, it failed with the same message produced by the old version
of Mono runtime.

Therefore I would dare to claim that the problem exists much further back
and is in the Mono runtime. What I am using is nothing new or even edge
case. In fact, the construct is as old as .Net2.

So what next? If I stay with Mono, to get around this gotcha I have to
abandon a perfectly valid schema (data model). This is placing the cart in
front of the horse.

I opened the instance document in MonoDevelop ver 4.2.2 (yes it is old and
it is because Linux/Mint does not allow me to move to newer version) and
then hit Tools  Xml  Validate. Well the screen lights up like a Christmas
tree and pointing to the same place as I have found.

Even more worryingly, that tool does not even handle the xsi:schemaLocation
hint while Eclipse did that flawlessly.

I appreciate the great work of Open Source in bringing Mono to something
workable. But after falling into holes so many times believing this
cross-platform development tool, Mono has lost my trust particularly not
knowing where is the next incompatible gotcha! This is no different than a
calculator produces erroneous result with certain expression kind and one
does not know which expression pattern. This problem plus the others that I
have unearthed are seriously matters. I would rather prefer Mono fails to
compile or supporting MS .Net construct (fail early and fail loud) than
slipping in minefield silently like this wasting people's time.

Has this simple scenario been tested?

MarL







--
View this message in context: 
http://mono.1490590.n4.nabble.com/Mono-Net-difference-handling-xs-extension-please-help-tp4664552p4664559.html
Sent from the Mono - Dev mailing list archive at Nabble.com.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Mono .Net difference - handling xs:extension please help

2014-11-12 Thread Rafael Teixeira
Probably is the core System.Xml class library assembly that misses some
functionality. It is kind of lower priority these days as most people is
moving to schema-less serialization with either Xml or JSON.
Surely nobody needed to exercise the extension mechanism before, so that's
is why it is still broken, that is characteristic of any Open Source
project.
If you really need it please open an issue, and help pinpoint the real
cause for the behavior, better yet, if you can: fix it and send a Pull
Request.

Best regards,


Rafael Teixeira
O..:.)

On Wed, Nov 12, 2014 at 8:51 AM, MarLOne infoseeker...@gmail.com wrote:

 Hello Timotheus,

 I have the answer for you.

 I have a VM with Mint17 which has Mono runtime 3.2.8 which is one major
 version that I reported earlier. So I build a console application to test
 using this schema (embedded resource) with this sample instance document.

 This also gives me a good test of compatibility that Mono has been
 promoting. I then took this console application and run it in my Windows 7
 with the most up to date .Net installed. It ran perfectly as expected
 verbatim without recompilation.

 This therefore indicates the IL code thus generated is not at fault.

 I then took this console application and xml document to my Mint 17 and ran
 it. As expected, it failed with the same message produced by the old
 version
 of Mono runtime.

 Therefore I would dare to claim that the problem exists much further back
 and is in the Mono runtime. What I am using is nothing new or even edge
 case. In fact, the construct is as old as .Net2.

 So what next? If I stay with Mono, to get around this gotcha I have to
 abandon a perfectly valid schema (data model). This is placing the cart in
 front of the horse.

 I opened the instance document in MonoDevelop ver 4.2.2 (yes it is old and
 it is because Linux/Mint does not allow me to move to newer version) and
 then hit Tools  Xml  Validate. Well the screen lights up like a Christmas
 tree and pointing to the same place as I have found.

 Even more worryingly, that tool does not even handle the xsi:schemaLocation
 hint while Eclipse did that flawlessly.

 I appreciate the great work of Open Source in bringing Mono to something
 workable. But after falling into holes so many times believing this
 cross-platform development tool, Mono has lost my trust particularly not
 knowing where is the next incompatible gotcha! This is no different than a
 calculator produces erroneous result with certain expression kind and one
 does not know which expression pattern. This problem plus the others that I
 have unearthed are seriously matters. I would rather prefer Mono fails to
 compile or supporting MS .Net construct (fail early and fail loud) than
 slipping in minefield silently like this wasting people's time.

 Has this simple scenario been tested?

 MarL







 --
 View this message in context:
 http://mono.1490590.n4.nabble.com/Mono-Net-difference-handling-xs-extension-please-help-tp4664552p4664559.html
 Sent from the Mono - Dev mailing list archive at Nabble.com.
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Mono .Net difference - handling xs:extension please help

2014-11-12 Thread Alexander Köplinger
For completeness sake I tested it on Mono 3.10 and latest master, it throws the 
same error there too, so it's definitely a bug in Mono :)
-- Alex
 
Date: Wed, 12 Nov 2014 09:49:34 -0200
From: mono...@gmail.com
To: infoseeker...@gmail.com
CC: mono-devel-list@lists.ximian.com
Subject: Re: [Mono-dev] Mono  .Net difference - handling xs:extension  please 
help

Probably is the core System.Xml class library assembly that misses some 
functionality. It is kind of lower priority these days as most people is moving 
to schema-less serialization with either Xml or JSON.Surely nobody needed to 
exercise the extension mechanism before, so that's is why it is still broken, 
that is characteristic of any Open Source project.If you really need it please 
open an issue, and help pinpoint the real cause for the behavior, better yet, 
if you can: fix it and send a Pull Request.
Best regards,
Rafael Teixeira
O..:.)


On Wed, Nov 12, 2014 at 8:51 AM, MarLOne infoseeker...@gmail.com wrote:
Hello Timotheus,



I have the answer for you.



I have a VM with Mint17 which has Mono runtime 3.2.8 which is one major

version that I reported earlier. So I build a console application to test

using this schema (embedded resource) with this sample instance document.



This also gives me a good test of compatibility that Mono has been

promoting. I then took this console application and run it in my Windows 7

with the most up to date .Net installed. It ran perfectly as expected

verbatim without recompilation.



This therefore indicates the IL code thus generated is not at fault.



I then took this console application and xml document to my Mint 17 and ran

it. As expected, it failed with the same message produced by the old version

of Mono runtime.



Therefore I would dare to claim that the problem exists much further back

and is in the Mono runtime. What I am using is nothing new or even edge

case. In fact, the construct is as old as .Net2.



So what next? If I stay with Mono, to get around this gotcha I have to

abandon a perfectly valid schema (data model). This is placing the cart in

front of the horse.



I opened the instance document in MonoDevelop ver 4.2.2 (yes it is old and

it is because Linux/Mint does not allow me to move to newer version) and

then hit Tools  Xml  Validate. Well the screen lights up like a Christmas

tree and pointing to the same place as I have found.



Even more worryingly, that tool does not even handle the xsi:schemaLocation

hint while Eclipse did that flawlessly.



I appreciate the great work of Open Source in bringing Mono to something

workable. But after falling into holes so many times believing this

cross-platform development tool, Mono has lost my trust particularly not

knowing where is the next incompatible gotcha! This is no different than a

calculator produces erroneous result with certain expression kind and one

does not know which expression pattern. This problem plus the others that I

have unearthed are seriously matters. I would rather prefer Mono fails to

compile or supporting MS .Net construct (fail early and fail loud) than

slipping in minefield silently like this wasting people's time.



Has this simple scenario been tested?



MarL















--

View this message in context: 
http://mono.1490590.n4.nabble.com/Mono-Net-difference-handling-xs-extension-please-help-tp4664552p4664559.html

Sent from the Mono - Dev mailing list archive at Nabble.com.

___

Mono-devel-list mailing list

Mono-devel-list@lists.ximian.com

http://lists.ximian.com/mailman/listinfo/mono-devel-list




___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
  ___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Mono .Net difference - handling xs:extension please help

2014-11-12 Thread Atsushi Eno

Hello,

If you believe xs:complexType/xs:extension is that superficial, could 
you explain why the validation result is wrong?


Dealing with xs:complexType is one of the most complicated XML schema 
validation technology, which involved handful of ambiguity, which may be 
fixed in later specifications, after we have implemented this feature 
mostly in 2003-2004.


Atsushi Eno

On 2014年11月12日 15:15, MarLOne wrote:

Hello,

Not sure if this issue has been raised as it is driving me nuts as another
Mono/.Net runtime behavior differences.

I have a xml schema called FamilyTree2.xsd  FamilyTree2.xsd
http://mono.1490590.n4.nabble.com/file/n4664552/FamilyTree2.xsd  . This
has been validate in Eclipse's Xsd Editor.

Then I have an instance document created using this schema and is called
FamilyTree2SimplePerson.xml  FamilyTree2SimplePerson.xml
http://mono.1490590.n4.nabble.com/file/n4664552/FamilyTree2SimplePerson.xml

I then use xsd.exe in Mono runtime 2.10.8.1 to generate a C# class from the
schema. I then use the following code to deserialize the instance document
into an person object:
 [Test]
 public void TestSimplePerson ()
 {
 const String testFile = FamilyTree2SimplePerson.xml;
 String fileName = Path.Combine( Constants.DataFilesDirectory,
testFile );
 Assert.IsTrue( File.Exists( fileName ) );
 
 LMar.Demo.person p = null;

 using( Stream input = File.OpenRead( fileName ) )
 {
 XmlReaderSettings rs = new XmlReaderSettings();
 rs.Schemas = new XmlSchemaSet();
 rs.Schemas.Add( SchemaLoaders.FamilyTree2 );
 rs.ValidationType = ValidationType.Schema;
 
 using( XmlReader reader = XmlReader.Create( input, rs ) )

 {
 XmlSerializer ser = new XmlSerializer( typeof(
LMar.Demo.person ) );
 p = ser.Deserialize( reader ) as LMar.Demo.person;  //
XmlSchemaValiationException
 Assert.IsNotNull( p );
 }
 }

The schema is embedded into the assembly as embedded resource,

The exception message is as follows:
System.Xml.Schema.XmlSchemaValiationException: XmlSchema error: Attribute
declaration was not found for name XML Line 6, Position 12.

person is the base class of spouse which uses the xs:extension to define it
in the schema. This error message points to the name for the spouse object.

I believe this is a Mono  MS .Net incompatibility runtime error for the
following reasons:
1) The instance document has been validated by Eclipse xsd/xml editor as
well as online validator. In fact the instance document was created by
Eclipse xml editor.
2) The same code ( the xsd generated code produced in .Net and Mono appear
to be the same) shown above runs without error in MS .Net and retrieving all
the values.

Has anyone discovered this error? It is a simple usage of xs:extension, a
very commonly used construct and should not cause any incompatibility.

It is so disheartening to see superficial compatibility while beneath the
surface so much differences. Is there a site that lists this kind of runtime
incompatibility for people wanting to use Mono as serious tool? Every time I
push Mono, I end up in a hole like this as I have encountered time and time
again incompatibilities.

Is there some quirky flags in the XmlReaderSettings to get this going in
Mono?

Thanks.

MarL




--
View this message in context: 
http://mono.1490590.n4.nabble.com/Mono-Net-difference-handling-xs-extension-please-help-tp4664552.html
Sent from the Mono - Dev mailing list archive at Nabble.com.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list





___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Mono .Net difference - handling xs:extension please help

2014-11-12 Thread Atsushi Eno
Actually I was wrong, it's already there: 
https://github.com/Microsoft/referencesource/tree/master/System.Xml/System/Xml/Schema


Atsushi Eno

On 2014年11月13日 00:05, Atsushi Eno wrote:
And Microsoft has announced open-sourcing .NET! So you don't have to 
spread your hate speech on bugs, we will take their good code.


https://github.com/dotnet/corefx/tree/master/src

(No XML Schema implementation yet, but I assume that would happen at 
some stage.)


Atsushi Eno


On 2014年11月12日 22:44, Atsushi Eno wrote:

Hello,

If you believe xs:complexType/xs:extension is that superficial, could 
you explain why the validation result is wrong?


Dealing with xs:complexType is one of the most complicated XML schema 
validation technology, which involved handful of ambiguity, which may 
be fixed in later specifications, after we have implemented this 
feature mostly in 2003-2004.


Atsushi Eno

On 2014年11月12日 15:15, MarLOne wrote:

Hello,

Not sure if this issue has been raised as it is driving me nuts as 
another

Mono/.Net runtime behavior differences.

I have a xml schema called FamilyTree2.xsd  FamilyTree2.xsd
http://mono.1490590.n4.nabble.com/file/n4664552/FamilyTree2.xsd . 
This

has been validate in Eclipse's Xsd Editor.

Then I have an instance document created using this schema and is 
called

FamilyTree2SimplePerson.xml  FamilyTree2SimplePerson.xml
http://mono.1490590.n4.nabble.com/file/n4664552/FamilyTree2SimplePerson.xml 



I then use xsd.exe in Mono runtime 2.10.8.1 to generate a C# class 
from the
schema. I then use the following code to deserialize the instance 
document

into an person object:
 [Test]
 public void TestSimplePerson ()
 {
 const String testFile = FamilyTree2SimplePerson.xml;
 String fileName = Path.Combine( 
Constants.DataFilesDirectory,

testFile );
 Assert.IsTrue( File.Exists( fileName ) );
  LMar.Demo.person p = null;
 using( Stream input = File.OpenRead( fileName ) )
 {
 XmlReaderSettings rs = new XmlReaderSettings();
 rs.Schemas = new XmlSchemaSet();
 rs.Schemas.Add( SchemaLoaders.FamilyTree2 );
 rs.ValidationType = ValidationType.Schema;
  using( XmlReader reader = 
XmlReader.Create( input, rs ) )

 {
 XmlSerializer ser = new XmlSerializer( typeof(
LMar.Demo.person ) );
 p = ser.Deserialize( reader ) as 
LMar.Demo.person;  //

XmlSchemaValiationException
 Assert.IsNotNull( p );
 }
 }

The schema is embedded into the assembly as embedded resource,

The exception message is as follows:
System.Xml.Schema.XmlSchemaValiationException: XmlSchema error: 
Attribute

declaration was not found for name XML Line 6, Position 12.

person is the base class of spouse which uses the xs:extension to 
define it
in the schema. This error message points to the name for the spouse 
object.


I believe this is a Mono  MS .Net incompatibility runtime error for 
the

following reasons:
1) The instance document has been validated by Eclipse xsd/xml 
editor as

well as online validator. In fact the instance document was created by
Eclipse xml editor.
2) The same code ( the xsd generated code produced in .Net and Mono 
appear
to be the same) shown above runs without error in MS .Net and 
retrieving all

the values.

Has anyone discovered this error? It is a simple usage of 
xs:extension, a

very commonly used construct and should not cause any incompatibility.

It is so disheartening to see superficial compatibility while 
beneath the
surface so much differences. Is there a site that lists this kind of 
runtime
incompatibility for people wanting to use Mono as serious tool? 
Every time I
push Mono, I end up in a hole like this as I have encountered time 
and time

again incompatibilities.

Is there some quirky flags in the XmlReaderSettings to get this 
going in

Mono?

Thanks.

MarL




--
View this message in context: 
http://mono.1490590.n4.nabble.com/Mono-Net-difference-handling-xs-extension-please-help-tp4664552.html

Sent from the Mono - Dev mailing list archive at Nabble.com.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list





___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Mono .Net difference - handling xs:extension please help

2014-11-12 Thread Atsushi Eno
And Microsoft has announced open-sourcing .NET! So you don't have to 
spread your hate speech on bugs, we will take their good code.


https://github.com/dotnet/corefx/tree/master/src

(No XML Schema implementation yet, but I assume that would happen at 
some stage.)


Atsushi Eno


On 2014年11月12日 22:44, Atsushi Eno wrote:

Hello,

If you believe xs:complexType/xs:extension is that superficial, could 
you explain why the validation result is wrong?


Dealing with xs:complexType is one of the most complicated XML schema 
validation technology, which involved handful of ambiguity, which may 
be fixed in later specifications, after we have implemented this 
feature mostly in 2003-2004.


Atsushi Eno

On 2014年11月12日 15:15, MarLOne wrote:

Hello,

Not sure if this issue has been raised as it is driving me nuts as 
another

Mono/.Net runtime behavior differences.

I have a xml schema called FamilyTree2.xsd  FamilyTree2.xsd
http://mono.1490590.n4.nabble.com/file/n4664552/FamilyTree2.xsd . This
has been validate in Eclipse's Xsd Editor.

Then I have an instance document created using this schema and is called
FamilyTree2SimplePerson.xml  FamilyTree2SimplePerson.xml
http://mono.1490590.n4.nabble.com/file/n4664552/FamilyTree2SimplePerson.xml 



I then use xsd.exe in Mono runtime 2.10.8.1 to generate a C# class 
from the
schema. I then use the following code to deserialize the instance 
document

into an person object:
 [Test]
 public void TestSimplePerson ()
 {
 const String testFile = FamilyTree2SimplePerson.xml;
 String fileName = Path.Combine( 
Constants.DataFilesDirectory,

testFile );
 Assert.IsTrue( File.Exists( fileName ) );
  LMar.Demo.person p = null;
 using( Stream input = File.OpenRead( fileName ) )
 {
 XmlReaderSettings rs = new XmlReaderSettings();
 rs.Schemas = new XmlSchemaSet();
 rs.Schemas.Add( SchemaLoaders.FamilyTree2 );
 rs.ValidationType = ValidationType.Schema;
  using( XmlReader reader = 
XmlReader.Create( input, rs ) )

 {
 XmlSerializer ser = new XmlSerializer( typeof(
LMar.Demo.person ) );
 p = ser.Deserialize( reader ) as 
LMar.Demo.person;  //

XmlSchemaValiationException
 Assert.IsNotNull( p );
 }
 }

The schema is embedded into the assembly as embedded resource,

The exception message is as follows:
System.Xml.Schema.XmlSchemaValiationException: XmlSchema error: 
Attribute

declaration was not found for name XML Line 6, Position 12.

person is the base class of spouse which uses the xs:extension to 
define it
in the schema. This error message points to the name for the spouse 
object.


I believe this is a Mono  MS .Net incompatibility runtime error for the
following reasons:
1) The instance document has been validated by Eclipse xsd/xml editor as
well as online validator. In fact the instance document was created by
Eclipse xml editor.
2) The same code ( the xsd generated code produced in .Net and Mono 
appear
to be the same) shown above runs without error in MS .Net and 
retrieving all

the values.

Has anyone discovered this error? It is a simple usage of 
xs:extension, a

very commonly used construct and should not cause any incompatibility.

It is so disheartening to see superficial compatibility while beneath 
the
surface so much differences. Is there a site that lists this kind of 
runtime
incompatibility for people wanting to use Mono as serious tool? Every 
time I
push Mono, I end up in a hole like this as I have encountered time 
and time

again incompatibilities.

Is there some quirky flags in the XmlReaderSettings to get this going in
Mono?

Thanks.

MarL




--
View this message in context: 
http://mono.1490590.n4.nabble.com/Mono-Net-difference-handling-xs-extension-please-help-tp4664552.html

Sent from the Mono - Dev mailing list archive at Nabble.com.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list





___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Mono .Net difference - handling xs:extension please help

2014-11-11 Thread MarLOne
Hello,

Not sure if this issue has been raised as it is driving me nuts as another
Mono/.Net runtime behavior differences.

I have a xml schema called FamilyTree2.xsd  FamilyTree2.xsd
http://mono.1490590.n4.nabble.com/file/n4664552/FamilyTree2.xsd  . This
has been validate in Eclipse's Xsd Editor.

Then I have an instance document created using this schema and is called
FamilyTree2SimplePerson.xml  FamilyTree2SimplePerson.xml
http://mono.1490590.n4.nabble.com/file/n4664552/FamilyTree2SimplePerson.xml  

I then use xsd.exe in Mono runtime 2.10.8.1 to generate a C# class from the
schema. I then use the following code to deserialize the instance document
into an person object:
[Test]
public void TestSimplePerson ()
{
const String testFile = FamilyTree2SimplePerson.xml;
String fileName = Path.Combine( Constants.DataFilesDirectory,
testFile );
Assert.IsTrue( File.Exists( fileName ) );

LMar.Demo.person p = null;
using( Stream input = File.OpenRead( fileName ) )
{
XmlReaderSettings rs = new XmlReaderSettings();
rs.Schemas = new XmlSchemaSet();
rs.Schemas.Add( SchemaLoaders.FamilyTree2 );
rs.ValidationType = ValidationType.Schema;

using( XmlReader reader = XmlReader.Create( input, rs ) )
{
XmlSerializer ser = new XmlSerializer( typeof(
LMar.Demo.person ) );
p = ser.Deserialize( reader ) as LMar.Demo.person;  //
XmlSchemaValiationException
Assert.IsNotNull( p );
}
}

The schema is embedded into the assembly as embedded resource,

The exception message is as follows:
System.Xml.Schema.XmlSchemaValiationException: XmlSchema error: Attribute
declaration was not found for name XML Line 6, Position 12.

person is the base class of spouse which uses the xs:extension to define it
in the schema. This error message points to the name for the spouse object. 

I believe this is a Mono  MS .Net incompatibility runtime error for the
following reasons:
1) The instance document has been validated by Eclipse xsd/xml editor as
well as online validator. In fact the instance document was created by
Eclipse xml editor.
2) The same code ( the xsd generated code produced in .Net and Mono appear
to be the same) shown above runs without error in MS .Net and retrieving all
the values.

Has anyone discovered this error? It is a simple usage of xs:extension, a
very commonly used construct and should not cause any incompatibility. 

It is so disheartening to see superficial compatibility while beneath the
surface so much differences. Is there a site that lists this kind of runtime
incompatibility for people wanting to use Mono as serious tool? Every time I
push Mono, I end up in a hole like this as I have encountered time and time
again incompatibilities.

Is there some quirky flags in the XmlReaderSettings to get this going in
Mono? 

Thanks.

MarL




--
View this message in context: 
http://mono.1490590.n4.nabble.com/Mono-Net-difference-handling-xs-extension-please-help-tp4664552.html
Sent from the Mono - Dev mailing list archive at Nabble.com.
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Mono .Net difference - handling xs:extension please help

2014-11-11 Thread Timotheus Pokorra
Hello MarL,
 I then use xsd.exe in Mono runtime 2.10.8.1 to generate a C# class from the
 schema. I then use the following code to deserialize the instance document

It seems you are using an ancient version of Mono.
Please try with a recent Mono, see
http://www.mono-project.com/download/, we are now at 3.10.0
Hopefully the behaviour has been fixed. If it still does not work,
please let the list know!

All the best,
  Timotheus
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list