[Schematron] test question

G. Ken Holman gkholman at CraneSoftwrights.com
Tue Oct 7 13:14:58 EDT 2008


At 2008-10-07 12:54 -0400, Albertson, Jacob [USA] wrote:
>    This might be more of an XPath question but I will try posting 
> it here anyway. I need a assertion test that will see if an element 
> in an external document is exactly the same as an element in my 
> document (It has all the same descendents and they all have all the 
> same attributes and no other extra descendents in either).

I suggestion you move to the XSLT 2 query binding and use deep-equal():

    http://www.w3.org/TR/2007/REC-xpath-functions-20070123/#func-deep-equal
    This function assesses whether two sequences are deep-equal to each
    other. To be deep-equal, they must contain items that are pairwise
    deep-equal; and for two items to be deep-equal, they must either be
    atomic values that compare equal, or nodes of the same kind, with
    the same name, whose children are deep-equal.

>I have tried many examples including the following but nothing seems 
>to work. Any help would be greatly appreciated.

I don't think you can do it piecemeal with XPath 1.

I hope this helps.

. . . . . . . . . Ken

--
Upcoming XSLT/XSL-FO hands-on courses:      Wellington, NZ 2009-01
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video sample lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg
Video course overview:  http://www.youtube.com/watch?v=VTiodiij6gE
G. Ken Holman                 mailto:gkholman at CraneSoftwrights.com
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal




More information about the Schematron mailing list