Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 14th, 2008, 01:55 PM
Authorized User
 
Join Date: Jul 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default seek a expression

I want to express the meaning r2ml:name 'client' which is direct child of r2ml:UniversallyQuantifiedFormula is not equal to any attribute r2ml:name which is inside r2ml:antecedent.
can anyone help me out?
my expression below is not right:
r2ml:UniversallyQuantifiedFormula/r2ml:ObjectVariable/@r2ml:name!=r2ml:antecedent//@r2ml:name
i am at my wits's end.can anybody help me out?
<r2ml:DeonticIntegrityRule r2ml:ruleID="ES_06">
 <r2ml:constraint>
   <r2ml:UniversallyQuantifiedFormula>
       <r2ml:ObjectVariable r2ml:name="client" r2ml:class="userv:Client"/>
       <r2ml:Implication>
    <r2ml:antecedent>
     <r2ml:ObjectVariable r2ml:name="policy" r2ml:class="userv:VehicleInsurancePolicy"/>

         <r2ml:ObjectVariable r2ml:name="client" r2ml:class="userv:Client"/>
    </r2ml:antecedent>
  </r2ml:Implication>
 </r2ml:UniversallyQuantifiedFormula>
</r2ml:constraint>
</r2ml:DeonticIntegrityRule>

 
Old July 15th, 2008, 02:25 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Predicates are expressed within square brackets, []. If you wish to select the r2ml:ObjectVariable elements that have a r2ml:Name value that doesn't appear on any r2ml:Name attribute within an r2ml:antecedent then I think it's:
Code:
//r2ml:UniversallyQuantifiedFormula/r2ml:ObjectVariable[not(@r2ml:name = //r2ml:antecedent/r2ml:ObjectVariable/@r2ml:name)]
But it depends on:
* Are you only interested in comparing against antecedents that are siblings of the ObjectVariable?
* Are the r2ml attributes always on an ObjectVariable?




--

Joe (Microsoft MVP - XML)
 
Old July 15th, 2008, 11:21 AM
Authorized User
 
Join Date: Jul 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i want to put the expression in the test statement within <xsl:if>,we must take into account that r2ml:ObjectVariable is descendant of r2ml:antecedent.the relationship between them is a little complicated,not just the parent and child relationship.
r2ml:name always appear in r2ml:ObjectVariable.

 
Old July 16th, 2008, 01:45 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

As you haven't shown the whole document structure it's difficult to be precise but:
Code:
//r2ml:UniversallyQuantifiedFormula/r2ml:ObjectVariable[not('client' = //r2ml:antecedent/descendant::r2ml:ObjectVariable/@r2ml:name)]
should be right. To use as a test in an xsl:when element just add the expression, it will be converted to a Boolean.


--

Joe (Microsoft MVP - XML)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Seek Time... ankur_icfai SQL Server 2000 2 August 30th, 2006 11:14 PM
cannot 'seek' inside a function dextermagnific XSLT 2 August 10th, 2006 01:54 AM
How to use seek method in DAO nadee VB How-To 4 April 21st, 2006 10:55 AM
DAO and seek torro17 BOOK: Access 2003 VBA Programmer's Reference 1 March 15th, 2006 06:02 PM
Seek record in Access sunny76 Access 3 February 21st, 2006 09:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.