[Mono-list] Validation of XML

Herman Vega hvegax at gmail.com
Wed Nov 30 07:22:54 EST 2005


Hi All...

I need to validate an Xml content and I have two ways:

* Using DTD file.
* Using XSD schema file.

The problem is that i have a DTD file that it's ok, work fine with
xmllint validation program. but my implementation with DTD Validation
don't work with mono. I decide to work with XSD validation schema and
work fine for me. Now i can validate a xml  against XSD schema file
very well with mono.

But here it's the new problem... when i generate a XSD schema file
from XML using xsd.exe this generate a wrong XSD Schema file.


Now the 2 ways...  (1) how i can generate a valid XSD schema file from
Xml (not manual) or (2) how i can validate a Xml using valid DTD file?

I attached the source files that I'm still working

The error using DTD validation:

$ mono -V
Mono JIT compiler version 1.1.8.2, (C) 2002-2005 Novell, Inc and
Contributors. www.mono-project.com
        TLS:           __thread
        GC:            Included Boehm (with typed GC)
        SIGSEGV      : normal
        Globalization: norma

$ mcs --version
Mono C# compiler version 1.1.8.0

$ mono ValidateXml.exe DTD activities.dtd activities.xml

Unhandled Exception: System.Xml.XmlException: Unexpected declaration
markup was found. file:///home/hvega/ticedu/xml/TestXml/activities.dtd
Line 2, position 3.

Regards

--
 ,''`.   Herman Vega Jara <hvega at alumnos.ubiobio.cl>
 : :' :  Ing. ejec. Comp. e Inf. at UBB rlz!
 `. `'  http://gbtcr.chileforge.cl
   `-
-------------- next part --------------
A non-text attachment was scrubbed...
Name: activity.dtd
Type: text/x-dtd
Size: 2851 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-list/attachments/20051130/63508bbe/activity-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: activity.xml
Type: text/xml
Size: 1627 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-list/attachments/20051130/63508bbe/activity-0001.xml
-------------- next part --------------
A non-text attachment was scrubbed...
Name: activity.xsd
Type: application/octet-stream
Size: 7280 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-list/attachments/20051130/63508bbe/activity-0001.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ValidateXml.cs
Type: text/x-csharp
Size: 996 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-list/attachments/20051130/63508bbe/ValidateXml-0001.bin


More information about the Mono-list mailing list