M
Marco Cyriacks
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Dear all,
within a C++ application I use xerces-c to validate XML instances
against a XML schema. This works very fine for me but currently I try to
realise the validation of some inner restricting for those XML
instances. Some examples:
1. If element 'PluginDescription' has the optional attribute 'attrPD'
and this attribute is true, the child element 'Resources' has to have
exactly one child element 'Resource' with an attribute 'attrR="AAA"'
(check against existence and value of that attribute).
<PluginDescription attrPD="true">
<Resources>
<Resource attrR="AAA"/>
</Resources>
</PluginDescription>
2. If element 'PluginDescription' does not have the optional attribute
'attrPD' or this attribute is false, the contents and number of child
elements for 'Resources' is arbitrarily.
<PluginDescription attrPD="false">
<Resources>
<Resource attrR="AAA"/>
<Resource attrR="BBB"/>
</Resources>
</PluginDescription>
<PluginDescription>
<Resources>
<Resource attrR="AAA"/>
</Resources>
</PluginDescription>
<PluginDescription>
<Resources>
</Resources>
</PluginDescription>
Is it possible to validate a XML instance against these restrictions? If
I'm right, it is not possible to do this using XML schema.
My ideas on it:
- - Implementation of the validation against those restrictions in my
application using C++ and xerces-c
This might by the easiest solution but will force application change
and recompilation if the restrictions change.
- - Creation of schematron
During a web research I found informations on XML schematron.
Unfortunately my first trials on that failed. Is it possible to validate
my XML instances against the presented restrictions using schematron?
Any help would be appreciated!
Best regards,
Marco
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJL4+apAAoJEH1rHVTBeH9oYGcH/jbmoVp/rVN597msIuFSjFiJ
6TSgictCzEm0M9Bb9pytmPhXHV20XH8i9SkzZSTzSk+nkZTqCxLyBoOyAFOITAbT
k1fktn2UYMtlFKNg8Z8hgdk2CiAVDR0qIVr6rzJ3xpcXndrLdagSo4nsnC5YAVV6
aMCBhv8hGcSz23p6K02c0TddpqLv7VO1cQRPXNkKVESXSiCJ5n/3Lx1kzZP6Z9BS
oEJ6o+vB933jkcoyuKUAwhaGp81G0DOCX7s5wJ0HT6EufCqtdumRsZB7sRWYucBC
HXbc3bRWAxEfDstNrtPkJFRwFK6Xc4eEmGb0kEMORY8fy5ttqigpTHOb7S3p6cc=
=gBop
-----END PGP SIGNATURE-----
Hash: SHA1
Dear all,
within a C++ application I use xerces-c to validate XML instances
against a XML schema. This works very fine for me but currently I try to
realise the validation of some inner restricting for those XML
instances. Some examples:
1. If element 'PluginDescription' has the optional attribute 'attrPD'
and this attribute is true, the child element 'Resources' has to have
exactly one child element 'Resource' with an attribute 'attrR="AAA"'
(check against existence and value of that attribute).
<PluginDescription attrPD="true">
<Resources>
<Resource attrR="AAA"/>
</Resources>
</PluginDescription>
2. If element 'PluginDescription' does not have the optional attribute
'attrPD' or this attribute is false, the contents and number of child
elements for 'Resources' is arbitrarily.
<PluginDescription attrPD="false">
<Resources>
<Resource attrR="AAA"/>
<Resource attrR="BBB"/>
</Resources>
</PluginDescription>
<PluginDescription>
<Resources>
<Resource attrR="AAA"/>
</Resources>
</PluginDescription>
<PluginDescription>
<Resources>
</Resources>
</PluginDescription>
Is it possible to validate a XML instance against these restrictions? If
I'm right, it is not possible to do this using XML schema.
My ideas on it:
- - Implementation of the validation against those restrictions in my
application using C++ and xerces-c
This might by the easiest solution but will force application change
and recompilation if the restrictions change.
- - Creation of schematron
During a web research I found informations on XML schematron.
Unfortunately my first trials on that failed. Is it possible to validate
my XML instances against the presented restrictions using schematron?
Any help would be appreciated!
Best regards,
Marco
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJL4+apAAoJEH1rHVTBeH9oYGcH/jbmoVp/rVN597msIuFSjFiJ
6TSgictCzEm0M9Bb9pytmPhXHV20XH8i9SkzZSTzSk+nkZTqCxLyBoOyAFOITAbT
k1fktn2UYMtlFKNg8Z8hgdk2CiAVDR0qIVr6rzJ3xpcXndrLdagSo4nsnC5YAVV6
aMCBhv8hGcSz23p6K02c0TddpqLv7VO1cQRPXNkKVESXSiCJ5n/3Lx1kzZP6Z9BS
oEJ6o+vB933jkcoyuKUAwhaGp81G0DOCX7s5wJ0HT6EufCqtdumRsZB7sRWYucBC
HXbc3bRWAxEfDstNrtPkJFRwFK6Xc4eEmGb0kEMORY8fy5ttqigpTHOb7S3p6cc=
=gBop
-----END PGP SIGNATURE-----