Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XML Schema Semantics validation

Reply
Thread Tools

XML Schema Semantics validation

 
 
pal.girish@gmail.com
Guest
Posts: n/a
 
      03-30-2007
Hi,
I am totally new to XML. I would like to know is there any way to
enforce rules in XML through XML schema such that value of one
attribute in some elemnet is validated against values of other
attributes in other elements. For eg
if
<fruit name=apple cost=5>
</fruit>
<fruit name=grapes cost=10>
</fruit>

now i need to check that cost of grapes is always greater than apple
can i do it through XML schema or I will need to parse the tree using
some programming language and then do all these types of validations

Thanks,
Girish

 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      03-30-2007
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

> if
> <fruit name=apple cost=5>
> </fruit>
> <fruit name=grapes cost=10>
> </fruit>
>
> now i need to check that cost of grapes is always greater than apple
> can i do it through XML schema or I will need to parse the tree using
> some programming language and then do all these types of validations


XSD schemas can't express such constraints relating to different
attribute values. You can express such constraints with the Schematron
language, see <http://www.schematron.com/>.


--

Martin Honnen
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
New to xml schema - does the dtd/schema validation happens always ? pramodr XML 3 04-05-2009 12:10 PM
web.xml / XML schema issue, why do some XML schema attributes disappear asciz@starmail.com Java 3 02-20-2007 09:56 AM
Validation with XSD using XML::LibXML::Schema, and XML::Validator::Schema huntingseasonson@gmail.com Perl Misc 5 11-29-2006 12:37 PM
Problem with schema-validation and property "http://apache.org/xml/properties/schema/external-schemaLocation" Markus Java 1 11-23-2005 02:41 PM
[XML Schema] Including a schema document with absent target namespace to a schema with specified target namespace Stanimir Stamenkov XML 3 04-25-2005 09:59 AM



Advertisments