Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

stag-diff(1p) [debian man page]

STAG-DIFF(1p)						User Contributed Perl Documentation					     STAG-DIFF(1p)

NAME
stag-diff - finds the difference between two stag files SYNOPSIS
stag-diff -ignore foo-id -ignore bar-id file1.xml file2.xml DESCRIPTION
Compares two data trees and reports whether they match. If they do not match, the mismatch is reported. ARGUMENTS -help|h shows this document -ignore|i ELEMENT these nodes are ignored for the purposes of comparison. Note that attributes are treated as elements, prefixed by the containing element id. For example, if you have <foo ID="wibble"> And you wish to ignore the ID attribute, then you would use the switch -ignore foo-ID You can specify multiple elements to ignore like this -i foo -i bar -i baz You can also specify paths -i foo/bar/bar-id -parser|p FORMAT which parser to use. The default is XML. This can also be autodetected by the file suffix. Other alternatives are sxpr and itext. See Data::Stag for details. -report|r ELEMENT report mismatches as they occur on each element of type ELEMENT multiple elements can be specified -verbose|v used in conjunction with the -report switch shows the tree of the mismatching element OUTPUT If a mismatch is reported, a report is generated displaying the subpart of the tree that could not be matched. This will look like this: REASON: no_matching_node: annotation no_matching_node: feature_set no_matching_node: feature_span no_matching_node: evidence no_matching_node: evidence-id data_mismatch(:15077290 ne :15077291): evidence-id AND evidence-id Due to the nature of tree matching, it can be difficult to specify exactly how trees do not match. To investigate this, you may need to use the -r and -v options. For the above output, I would recommend using stag-diff -r feature_span -v ALGORITHM Both trees are recursively traversed... see the actual code for how this works The order of elements is not important; eg <foo> <bar> <baz>1</baz> </bar> <bar> <baz>2</baz> </bar> </foo> matches <foo> <bar> <baz>2</baz> </bar> <bar> <baz>1</baz> </bar> </foo> The recursive nature of this algorithm means that certain tree comparisons will explode wrt time and memory. I think this will only happen with very deep trees where nodes high up in the tree can only be differentiated by nodes low down in the tree. Both trees are loaded into memory to begin with, so it may thrash with very large documents AUTHOR Chris Mungall cjm at fruitfly dot org SEE ALSO
Data::Stag perl v5.10.0 2008-12-23 STAG-DIFF(1p)

Check Out this Related Man Page

Text::Glob(3)						User Contributed Perl Documentation					     Text::Glob(3)

NAME
Text::Glob - match globbing patterns against text SYNOPSIS
use Text::Glob qw( match_glob glob_to_regex ); print "matched " if match_glob( "foo.*", "foo.bar" ); # prints foo.bar and foo.baz my $regex = glob_to_regex( "foo.*" ); for ( qw( foo.bar foo.baz foo bar ) ) { print "matched: $_ " if /$regex/; } DESCRIPTION
Text::Glob implements glob(3) style matching that can be used to match against text, rather than fetching names from a filesystem. If you want to do full file globbing use the File::Glob module instead. Routines match_glob( $glob, @things_to_test ) Returns the list of things which match the glob from the source list. glob_to_regex( $glob ) Returns a compiled regex which is the equivalent of the globbing pattern. glob_to_regex_string( $glob ) Returns a regex string which is the equivalent of the globbing pattern. SYNTAX
The following metacharacters and rules are respected. "*" - match zero or more characters "a*" matches "a", "aa", "aaaa" and many many more. "?" - match exactly one character "a?" matches "aa", but not "a", or "aaa" Character sets/ranges "example.[ch]" matches "example.c" and "example.h" "demo.[a-c]" matches "demo.a", "demo.b", and "demo.c" alternation "example.{foo,bar,baz}" matches "example.foo", "example.bar", and "example.baz" leading . must be explictly matched "*.foo" does not match ".bar.foo". For this you must either specify the leading . in the glob pattern (".*.foo"), or set $Text::Glob::strict_leading_dot to a false value while compiling the regex. "*" and "?" do not match / "*.foo" does not match "bar/baz.foo". For this you must either explicitly match the / in the glob ("*/*.foo"), or set $Text::Glob::strict_wildcard_slash to a false value with compiling the regex. BUGS
The code uses qr// to produce compiled regexes, therefore this module requires perl version 5.005_03 or newer. AUTHOR
Richard Clamp <richardc@unixbeard.net> COPYRIGHT
Copyright (C) 2002, 2003, 2006, 2007 Richard Clamp. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
File::Glob, glob(3) perl v5.18.2 2017-10-06 Text::Glob(3)
Man Page