This file is indexed.

/usr/lib/python2.7/dist-packages/libxslt.py is in python-libxslt1 1.1.28-2.1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
#
# Both libxml2mod and libxsltmod have a dependancy on libxml2.so
# and they should share the same module, try to convince the python
# loader to work in that mode if feasible
#
import sys
if not hasattr(sys,'getdlopenflags'):
    import libxml2mod
    import libxsltmod
    import libxml2
else:
    try:
        from dl import RTLD_GLOBAL, RTLD_NOW
    except ImportError:
        RTLD_GLOBAL = -1
        RTLD_NOW = -1
        try:
            import os
            osname = os.uname()[0]
            if osname == 'Linux' or osname == 'SunOS':
                RTLD_GLOBAL = 0x00100
                RTLD_NOW = 0x00002
            elif osname == 'Darwin':
                RTLD_GLOBAL = 0x8
                RTLD_NOW = 0x2
            #
            # is there a better method ?
            #
#            else:
#                print "libxslt could not guess RTLD_GLOBAL and RTLD_NOW " + \
#                      "on this platform: %s" % (osname)
        except:
             pass
#            print "libxslt could not guess RTLD_GLOBAL and RTLD_NOW " + \
#                  "on this platform: %s" % (osname)
    except:
        RTLD_GLOBAL = -1
        RTLD_NOW = -1

    if RTLD_GLOBAL != -1 and RTLD_NOW != -1:
        try:
            flags = sys.getdlopenflags() 
            sys.setdlopenflags(RTLD_GLOBAL | RTLD_NOW)
            try:
                import libxml2mod
                import libxsltmod
                import libxml2
            finally:
                sys.setdlopenflags(flags)
        except:
            import libxml2mod
            import libxsltmod
            import libxml2
    else:
        import libxml2mod
        import libxsltmod
        import libxml2


class transformCtxtBase:
    def __init__(self, _obj=None):
        if _obj != None: 
            self._o = _obj;
            return
        self._o = None
    def __hash__(self):
        v = libxsltmod.xsltGetTransformContextHashCode(self._o)
        return v
    def __eq__(self, other):
        if other == None:
            return 0
        v = libxsltmod.xsltCompareTransformContextsEqual(self._o, other._o)
        return v
        
class stylesheetBase:
    def __init__(self, _obj=None):
        if _obj != None: 
            self._o = _obj;
            return
        self._o = None
    def __hash__(self):
        v = libxsltmod.xsltGetStylesheetHashCode(self._o)
        return v
    def __eq__(self, other):
        if other == None:
            return 0
        v = libxsltmod.xsltCompareStylesheetsEqual(self._o, other._o)
        return v

class extensionModule:
    def _styleInit(self, style, URI):
        return self.styleInit(stylesheet(_obj=style), URI)

    def _styleShutdown(self, style, URI, data):
        return self.styleShutdown(stylesheet(_obj=style), URI, data)

    def _ctxtInit(self, ctxt, URI):
        return self.ctxtInit(transformCtxt(_obj=ctxt), URI)

    def _ctxtShutdown(self, ctxt, URI, data):
        return self.ctxtShutdown(transformCtxt(_obj=ctxt), URI, data)

    def styleInit(self, style, URI):
        """Callback function when used in a newly compiled stylesheet,
           the return value is passed in subsequent calls"""
        pass

    def styleShutdown(self, style, URI, data):
        """Callback function when a stylesheet using it is destroyed"""
        pass

    def ctxtInit(self, ctxt, URI):
        """Callback function when used in a new transformation process,
           the return value is passed in subsequent calls"""
        pass

    def ctxtShutdown(self, ctxt, URI, data):
        """Callback function when a transformation using it finishes"""
        pass

def cleanup():
    """Cleanup all libxslt and libxml2 memory allocated"""
    libxsltmod.xsltPythonCleanup()
    libxml2.cleanupParser()

#
# Everything below this point is automatically generated
#

#
# Functions from module extensions
#

def debugDumpExtensions(output):
    """Dumps a list of the registered XSLT extension functions and
       elements"""
    libxsltmod.xsltDebugDumpExtensions(output)

def initGlobals():
    """Initialize the global variables for extensions"""
    libxsltmod.xsltInitGlobals()

def registerTestModule():
    """Registers the test module"""
    libxsltmod.xsltRegisterTestModule()

def unregisterExtModule(URI):
    """Unregister an XSLT extension module from the library."""
    ret = libxsltmod.xsltUnregisterExtModule(URI)
    return ret

def unregisterExtModuleElement(name, URI):
    """Unregisters an extension module element"""
    ret = libxsltmod.xsltUnregisterExtModuleElement(name, URI)
    return ret

def unregisterExtModuleFunction(name, URI):
    """Unregisters an extension module function"""
    ret = libxsltmod.xsltUnregisterExtModuleFunction(name, URI)
    return ret

def unregisterExtModuleTopLevel(name, URI):
    """Unregisters an extension module top-level element"""
    ret = libxsltmod.xsltUnregisterExtModuleTopLevel(name, URI)
    return ret

#
# Functions from module extra
#

def registerAllExtras():
    """Registers the built-in extensions"""
    libxsltmod.xsltRegisterAllExtras()

#
# Functions from module python
#

def pythonCleanup():
    """Cleanup just libxslt (not libxml2) memory allocated"""
    libxsltmod.xsltPythonCleanup()

def registerErrorHandler(f, ctx):
    """Register a Python written function to for error reporting.
       The function is called back as f(ctx, error)."""
    ret = libxsltmod.xsltRegisterErrorHandler(f, ctx)
    return ret

def registerExtModuleElement(name, URI, precompile, transform):
    """Register a Python written element to the XSLT engine"""
    ret = libxsltmod.xsltRegisterExtModuleElement(name, URI, precompile, transform)
    return ret

def registerExtModuleFunction(name, URI, f):
    """Register a Python written function to the XSLT engine"""
    ret = libxsltmod.xsltRegisterExtModuleFunction(name, URI, f)
    return ret

def registerExtensionClass(URI, c):
    """Register a Python written extension class to the XSLT engine"""
    ret = libxsltmod.xsltRegisterExtensionClass(URI, c)
    return ret

def setLoaderFunc(loader):
    """Set the function for controlling document loading"""
    ret = libxsltmod.xsltSetLoaderFunc(loader)
    return ret

#
# Functions from module xslt
#

def cleanupGlobals():
    """Unregister all global variables set up by the XSLT library"""
    libxsltmod.xsltCleanupGlobals()

def init():
    """Initializes the processor (e.g. registers built-in
       extensions, etc.)"""
    libxsltmod.xsltInit()

#
# Functions from module xsltInternals
#

def isBlank(str):
    """Check if a string is ignorable"""
    ret = libxsltmod.xsltIsBlank(str)
    return ret

def loadStylesheetPI(doc):
    """This function tries to locate the stylesheet PI in the
      given document If found, and if contained within the
      document, it will extract that subtree to build the
      stylesheet to process @doc (doc itself will be modified).
      If found but referencing an external document it will
      attempt to load it and generate a stylesheet from it. In
      both cases, the resulting stylesheet and the document need
       to be freed once the transformation is done."""
    if doc == None: doc__o = None
    else: doc__o = doc._o
    ret = libxsltmod.xsltLoadStylesheetPI(doc__o)
    if ret == None: return None
    return stylesheet(_obj=ret)

def newStylesheet():
    """Create a new XSLT Stylesheet"""
    ret = libxsltmod.xsltNewStylesheet()
    if ret == None: return None
    return stylesheet(_obj=ret)

def parseStylesheetDoc(doc):
    """parse an XSLT stylesheet, building the associated
      structures.  doc is kept as a reference within the returned
      stylesheet, so changes to doc after the parsing will be
      reflected when the stylesheet is applied, and the doc is
       automatically freed when the stylesheet is closed."""
    if doc == None: doc__o = None
    else: doc__o = doc._o
    ret = libxsltmod.xsltParseStylesheetDoc(doc__o)
    if ret == None: return None
    return stylesheet(_obj=ret)

def parseStylesheetFile(filename):
    """Load and parse an XSLT stylesheet"""
    ret = libxsltmod.xsltParseStylesheetFile(filename)
    if ret == None: return None
    return stylesheet(_obj=ret)

def uninit():
    """Uninitializes the processor."""
    libxsltmod.xsltUninit()

#
# Functions from module xsltlocale
#

def freeLocales():
    """Cleanup function for the locale support on shutdown"""
    libxsltmod.xsltFreeLocales()

#
# Functions from module xsltutils
#

def calibrateAdjust(delta):
    """Used for to correct the calibration for xsltTimestamp()"""
    libxsltmod.xsltCalibrateAdjust(delta)

def debuggerStatus():
    """Get xslDebugStatus."""
    ret = libxsltmod.xsltGetDebuggerStatus()
    return ret

def nsProp(node, name, nameSpace):
    """Similar to xmlGetNsProp() but with a slightly different
      semantic  Search and get the value of an attribute
      associated to a node This attribute has to be anchored in
      the namespace specified, or has no namespace and the
      element is in that namespace.  This does the entity
      substitution. This function looks in DTD attribute
      declaration for #FIXED or default declaration values unless
       DTD use has been turned off."""
    if node == None: node__o = None
    else: node__o = node._o
    ret = libxsltmod.xsltGetNsProp(node__o, name, nameSpace)
    return ret

def setDebuggerStatus(value):
    """This function sets the value of xslDebugStatus."""
    libxsltmod.xsltSetDebuggerStatus(value)

def timestamp():
    """Used for gathering profiling data"""
    ret = libxsltmod.xsltTimestamp()
    return ret

def xslDropCall():
    """Drop the topmost item off the call stack"""
    libxsltmod.xslDropCall()

class xpathParserContext(libxml2.xpathParserContext):
    def __init__(self, _obj=None):
        self._o = None
        libxml2.xpathParserContext.__init__(self, _obj=_obj)

    # accessors for xpathParserContext
    def context(self):
        """Get the xpathContext from an xpathParserContext"""
        ret = libxsltmod.xsltXPathParserGetContext(self._o)
        if ret == None: return None
        return xpathContext(_obj=ret)

    #
    # xpathParserContext functions from module extra
    #

    def functionNodeSet(self, nargs):
        """Implement the node-set() XSLT function node-set
          node-set(result-tree)  This function is available in
           libxslt, saxon or xt namespace."""
        libxsltmod.xsltFunctionNodeSet(self._o, nargs)

    #
    # xpathParserContext functions from module functions
    #

    def documentFunction(self, nargs):
        """Implement the document() XSLT function node-set
           document(object, node-set?)"""
        libxsltmod.xsltDocumentFunction(self._o, nargs)

    def elementAvailableFunction(self, nargs):
        """Implement the element-available() XSLT function boolean
           element-available(string)"""
        libxsltmod.xsltElementAvailableFunction(self._o, nargs)

    def formatNumberFunction(self, nargs):
        """Implement the format-number() XSLT function string
           format-number(number, string, string?)"""
        libxsltmod.xsltFormatNumberFunction(self._o, nargs)

    def functionAvailableFunction(self, nargs):
        """Implement the function-available() XSLT function boolean
           function-available(string)"""
        libxsltmod.xsltFunctionAvailableFunction(self._o, nargs)

    def generateIdFunction(self, nargs):
        """Implement the generate-id() XSLT function string
           generate-id(node-set?)"""
        libxsltmod.xsltGenerateIdFunction(self._o, nargs)

    def keyFunction(self, nargs):
        """Implement the key() XSLT function node-set key(string,
           object)"""
        libxsltmod.xsltKeyFunction(self._o, nargs)

    def systemPropertyFunction(self, nargs):
        """Implement the system-property() XSLT function object
           system-property(string)"""
        libxsltmod.xsltSystemPropertyFunction(self._o, nargs)

    def unparsedEntityURIFunction(self, nargs):
        """Implement the unparsed-entity-uri() XSLT function string
           unparsed-entity-uri(string)"""
        libxsltmod.xsltUnparsedEntityURIFunction(self._o, nargs)

class xpathContext(libxml2.xpathContext):
    def __init__(self, _obj=None):
        self._o = None
        libxml2.xpathContext.__init__(self, _obj=_obj)

    def __del__(self):
        pass
    # accessors for xpathContext
    def transformContext(self):
        """Get the transformation context from an xpathContext"""
        ret = libxsltmod.xsltXPathGetTransformContext(self._o)
        if ret == None: return None
        return transformCtxt(_obj=ret)

    #
    # xpathContext functions from module functions
    #

    def registerAllFunctions(self):
        """Registers all default XSLT functions in this context"""
        libxsltmod.xsltRegisterAllFunctions(self._o)

class transformCtxt(transformCtxtBase):
    def __init__(self, _obj=None):
        self._o = None
        transformCtxtBase.__init__(self, _obj=_obj)

    # accessors for transformCtxt
    def context(self):
        """Get the XPath context of a transformation"""
        ret = libxsltmod.xsltTransformGetContext(self._o)
        if ret == None: return None
        return xpathContext(_obj=ret)

    def current(self):
        """Get the current() node of a transformation"""
        ret = libxsltmod.xsltTransformGetCurrent(self._o)
        if ret == None: return None
        return libxml2.xmlNode(_obj=ret)

    def insertNode(self):
        """Get the insertion node in the output document"""
        ret = libxsltmod.xsltTransformGetInsertNode(self._o)
        if ret == None: return None
        return libxml2.xmlNode(_obj=ret)

    def instruction(self):
        """Get the instruction node in the stylesheet"""
        ret = libxsltmod.xsltTransformGetInstruction(self._o)
        if ret == None: return None
        return libxml2.xmlNode(_obj=ret)

    def mode(self):
        """Get the mode of a transformation"""
        ret = libxsltmod.xsltTransformGetMode(self._o)
        return ret

    def modeURI(self):
        """Get the mode URI of a transformation"""
        ret = libxsltmod.xsltTransformGetModeURI(self._o)
        return ret

    def outputDoc(self):
        """Get the output document of a transformation"""
        ret = libxsltmod.xsltTransformGetOutputDoc(self._o)
        if ret == None: return None
        return libxml2.xmlDoc(_obj=ret)

    def outputURI(self):
        """Get the output URI of a transformation if known"""
        ret = libxsltmod.xsltTransformGetOutputURI(self._o)
        return ret

    def style(self):
        """Get the stylesheet from a transformation"""
        ret = libxsltmod.xsltTransformGetStyle(self._o)
        if ret == None: return None
        return stylesheet(_obj=ret)

    #
    # transformCtxt functions from module attributes
    #

    def applyAttributeSet(self, node, inst, attrSets):
        """Apply the xsl:use-attribute-sets. If @attrSets is None,
          then @inst will be used to exctract this value. If both,
           @attrSets and @inst, are None, then this will do nothing."""
        if node == None: node__o = None
        else: node__o = node._o
        if inst == None: inst__o = None
        else: inst__o = inst._o
        libxsltmod.xsltApplyAttributeSet(self._o, node__o, inst__o, attrSets)

    #
    # transformCtxt functions from module documents
    #

    def freeDocuments(self):
        """Free up all the space used by the loaded documents"""
        libxsltmod.xsltFreeDocuments(self._o)

    #
    # transformCtxt functions from module extensions
    #

    def freeCtxtExts(self):
        """Free the XSLT extension data"""
        libxsltmod.xsltFreeCtxtExts(self._o)

    def initCtxtExts(self):
        """Initialize the set of modules with registered stylesheet
           data"""
        ret = libxsltmod.xsltInitCtxtExts(self._o)
        return ret

    def shutdownCtxtExts(self):
        """Shutdown the set of modules loaded"""
        libxsltmod.xsltShutdownCtxtExts(self._o)

    #
    # transformCtxt functions from module extra
    #

    def debug(self, node, inst, comp):
        """Process an debug node"""
        if node == None: node__o = None
        else: node__o = node._o
        if inst == None: inst__o = None
        else: inst__o = inst._o
        libxsltmod.xsltDebug(self._o, node__o, inst__o, comp)

    def registerExtras(self):
        """Registers the built-in extensions. This function is
           deprecated, use xsltRegisterAllExtras instead."""
        libxsltmod.xsltRegisterExtras(self._o)

    #
    # transformCtxt functions from module imports
    #

    def findElemSpaceHandling(self, node):
        """Find strip-space or preserve-space information for an
           element respect the import precedence or the wildcards"""
        if node == None: node__o = None
        else: node__o = node._o
        ret = libxsltmod.xsltFindElemSpaceHandling(self._o, node__o)
        return ret

    def needElemSpaceHandling(self):
        """Checks whether that stylesheet requires white-space
           stripping"""
        ret = libxsltmod.xsltNeedElemSpaceHandling(self._o)
        return ret

    #
    # transformCtxt functions from module namespaces
    #

    def copyNamespace(self, elem, ns):
        """Copies a namespace node (declaration). If @elem is not
           None, then the new namespace will be declared on @elem."""
        if elem == None: elem__o = None
        else: elem__o = elem._o
        if ns == None: ns__o = None
        else: ns__o = ns._o
        ret = libxsltmod.xsltCopyNamespace(self._o, elem__o, ns__o)
        if ret == None: return None
        return libxml2.xmlNs(_obj=ret)

    def copyNamespaceList(self, node, cur):
        """Do a copy of an namespace list. If @node is non-None the
          new namespaces are added automatically. This handles
          namespaces aliases. This function is intended only for
          *internal* use at transformation-time for copying
          ns-declarations of Literal Result Elements.  Called by:
          xsltCopyTreeInternal() (transform.c) xsltShallowCopyElem()
          (transform.c)  REVISIT: This function won't be used in the
           refactored code."""
        if node == None: node__o = None
        else: node__o = node._o
        if cur == None: cur__o = None
        else: cur__o = cur._o
        ret = libxsltmod.xsltCopyNamespaceList(self._o, node__o, cur__o)
        if ret == None: return None
        return libxml2.xmlNs(_obj=ret)

    def namespace(self, cur, ns, out):
        """Find a matching (prefix and ns-name) ns-declaration for the
          requested @ns->prefix and @ns->href in the result tree. If
          none is found then a new ns-declaration will be added to
          @resultElem. If, in this case, the given prefix is already
          in use, then a ns-declaration with a modified ns-prefix be
          we created.  Called by: - xsltCopyPropList() (*not* 
          anymore) - xsltShallowCopyElement() -
          xsltCopyTreeInternal() (*not*  anymore) -
          xsltApplySequenceConstructor() (*not* in the refactored
           code), - xsltElement() (*not* anymore)"""
        if cur == None: cur__o = None
        else: cur__o = cur._o
        if ns == None: ns__o = None
        else: ns__o = ns._o
        if out == None: out__o = None
        else: out__o = out._o
        ret = libxsltmod.xsltGetNamespace(self._o, cur__o, ns__o, out__o)
        if ret == None: return None
        return libxml2.xmlNs(_obj=ret)

    def plainNamespace(self, cur, ns, out):
        """Obsolete. *Not* called by any Libxslt/Libexslt function.
           Exaclty the same as xsltGetNamespace()."""
        if cur == None: cur__o = None
        else: cur__o = cur._o
        if ns == None: ns__o = None
        else: ns__o = ns._o
        if out == None: out__o = None
        else: out__o = out._o
        ret = libxsltmod.xsltGetPlainNamespace(self._o, cur__o, ns__o, out__o)
        if ret == None: return None
        return libxml2.xmlNs(_obj=ret)

    def specialNamespace(self, invocNode, nsName, nsPrefix, target):
        """Find a matching (prefix and ns-name) ns-declaration for the
          requested @nsName and @nsPrefix in the result tree. If none
          is found then a new ns-declaration will be added to
          @resultElem. If, in this case, the given prefix is already
          in use, then a ns-declaration with a modified ns-prefix be
          we created. Note that this function's priority is to
          preserve ns-prefixes; it will only change a prefix if
          there's a namespace clash. If both @nsName and @nsPrefix
          are None, then this will try to "undeclare" a default
           namespace by declaring an xmlns=""."""
        if invocNode == None: invocNode__o = None
        else: invocNode__o = invocNode._o
        if target == None: target__o = None
        else: target__o = target._o
        ret = libxsltmod.xsltGetSpecialNamespace(self._o, invocNode__o, nsName, nsPrefix, target__o)
        if ret == None: return None
        return libxml2.xmlNs(_obj=ret)

    #
    # transformCtxt functions from module python
    #

    def compareTransformContextsEqual(self, other):
        """Compare one transformCtxt with another"""
        if other == None: other__o = None
        else: other__o = other._o
        ret = libxsltmod.xsltCompareTransformContextsEqual(self._o, other__o)
        return ret

    def freeTransformContext(self):
        """Free up an existing XSLT TransformContext"""
        libxsltmod.xsltFreeTransformContext(self._o)

    def transformContextHashCode(self):
        """Get the hash code of the transformContext"""
        ret = libxsltmod.xsltGetTransformContextHashCode(self._o)
        return ret

    #
    # transformCtxt functions from module templates
    #

    def attrListTemplateProcess(self, target, attrs):
        """Processes all attributes of a Literal Result Element.
          Attribute references are applied via xsl:use-attribute-set
          attributes. Copies all non XSLT-attributes over to the
          @target element and evaluates Attribute Value Templates. 
           Called by xsltApplySequenceConstructor() (transform.c)."""
        if target == None: target__o = None
        else: target__o = target._o
        if attrs == None: attrs__o = None
        else: attrs__o = attrs._o
        ret = libxsltmod.xsltAttrListTemplateProcess(self._o, target__o, attrs__o)
        if ret == None: return None
        return libxml2.xmlAttr(_obj=ret)

    def attrTemplateProcess(self, target, attr):
        """Process one attribute of a Literal Result Element (in the
          stylesheet). Evaluates Attribute Value Templates and copies
          the attribute over to the result element. This does *not*
           process attribute sets (xsl:use-attribute-set)."""
        if target == None: target__o = None
        else: target__o = target._o
        if attr == None: attr__o = None
        else: attr__o = attr._o
        ret = libxsltmod.xsltAttrTemplateProcess(self._o, target__o, attr__o)
        if ret == None: return None
        return libxml2.xmlAttr(_obj=ret)

    def attrTemplateValueProcess(self, str):
        """Process the given node and return the new string value."""
        ret = libxsltmod.xsltAttrTemplateValueProcess(self._o, str)
        return ret

    def attrTemplateValueProcessNode(self, str, inst):
        """Process the given string, allowing to pass a namespace
          mapping context and return the new string value.  Called
          by: - xsltAttrTemplateValueProcess() (templates.c) -
          xsltEvalAttrValueTemplate() (templates.c)  QUESTION: Why is
          this function public? It is not used outside of templates.c."""
        if inst == None: inst__o = None
        else: inst__o = inst._o
        ret = libxsltmod.xsltAttrTemplateValueProcessNode(self._o, str, inst__o)
        return ret

    def evalAttrValueTemplate(self, inst, name, ns):
        """Evaluate a attribute value template, i.e. the attribute
          value can contain expressions contained in curly braces
           ({}) and those are substituted by they computed value."""
        if inst == None: inst__o = None
        else: inst__o = inst._o
        ret = libxsltmod.xsltEvalAttrValueTemplate(self._o, inst__o, name, ns)
        return ret

    def evalTemplateString(self, contextNode, inst):
        """Processes the sequence constructor of the given instruction
          on @contextNode and converts the resulting tree to a
          string. This is needed by e.g. xsl:comment and
           xsl:processing-instruction."""
        if contextNode == None: contextNode__o = None
        else: contextNode__o = contextNode._o
        if inst == None: inst__o = None
        else: inst__o = inst._o
        ret = libxsltmod.xsltEvalTemplateString(self._o, contextNode__o, inst__o)
        return ret

    #
    # transformCtxt functions from module variables
    #

    def evalGlobalVariables(self):
        """Evaluates all global variables and parameters of a
          stylesheet. For internal use only. This is called at start
           of a transformation."""
        ret = libxsltmod.xsltEvalGlobalVariables(self._o)
        return ret

    def evalOneUserParam(self, name, value):
        """This is normally called from xsltEvalUserParams to process
          a single parameter from a list of parameters.  The @value
          is evaluated as an XPath expression and the result is
          stored in the context's global variable/parameter hash
          table.  To have a parameter treated literally (not as an
          XPath expression) use xsltQuoteUserParams (or
          xsltQuoteOneUserParam).  For more details see description
           of xsltProcessOneUserParamInternal."""
        ret = libxsltmod.xsltEvalOneUserParam(self._o, name, value)
        return ret

    def freeGlobalVariables(self):
        """Free up the data associated to the global variables its
           value."""
        libxsltmod.xsltFreeGlobalVariables(self._o)

    def parseStylesheetParam(self, cur):
        """Registers a local XSLT 'param' declaration at
           transformation time and evaluates its value."""
        if cur == None: cur__o = None
        else: cur__o = cur._o
        libxsltmod.xsltParseStylesheetParam(self._o, cur__o)

    def parseStylesheetVariable(self, inst):
        """Registers a local XSLT 'variable' instruction at
           transformation time and evaluates its value."""
        if inst == None: inst__o = None
        else: inst__o = inst._o
        libxsltmod.xsltParseStylesheetVariable(self._o, inst__o)

    def quoteOneUserParam(self, name, value):
        """This is normally called from xsltQuoteUserParams to process
          a single parameter from a list of parameters.  The @value
          is stored in the context's global variable/parameter hash
           table."""
        ret = libxsltmod.xsltQuoteOneUserParam(self._o, name, value)
        return ret

    def variableLookup(self, name, ns_uri):
        """Search in the Variable array of the context for the given
           variable value."""
        ret = libxsltmod.xsltVariableLookup(self._o, name, ns_uri)
        if ret == None: return None
        return libxml2.xpathObjectRet(ret)

    #
    # transformCtxt functions from module xsltInternals
    #

    def allocateExtraCtxt(self):
        """Allocate an extra runtime information slot at run-time and
          return its number This make sure there is a slot ready in
           the transformation context"""
        ret = libxsltmod.xsltAllocateExtraCtxt(self._o)
        return ret

    def createRVT(self):
        """Creates a Result Value Tree (the XSLT 1.0 term for this is
           "Result Tree Fragment")"""
        ret = libxsltmod.xsltCreateRVT(self._o)
        if ret == None: return None
        return libxml2.xmlDoc(_obj=ret)

    def extensionInstructionResultFinalize(self):
        """Finalizes the data (e.g. result tree fragments) created
          within a value-returning process (e.g. EXSLT's function).
          Tree fragments marked as being returned by a function are
          set to normal state, which means that the fragment garbage
          collector will free them after the function-calling process
           exits."""
        ret = libxsltmod.xsltExtensionInstructionResultFinalize(self._o)
        return ret

    def freeRVTs(self):
        """Frees all registered result value trees (Result Tree
          Fragments) of the transformation. Internal function; should
           not be called by user-code."""
        libxsltmod.xsltFreeRVTs(self._o)

    def initAllDocKeys(self):
        """INTERNAL ROUTINE ONLY  Check if any keys on the current
           document need to be computed"""
        ret = libxsltmod.xsltInitAllDocKeys(self._o)
        return ret

    def registerLocalRVT(self, RVT):
        """Registers a result value tree (XSLT 1.0 term: Result Tree
          Fragment) in the RVT garbage collector. The fragment will
          be freed when the instruction which created the fragment
           exits."""
        if RVT == None: RVT__o = None
        else: RVT__o = RVT._o
        ret = libxsltmod.xsltRegisterLocalRVT(self._o, RVT__o)
        return ret

    def registerPersistRVT(self, RVT):
        """Register the result value tree (XSLT 1.0 term: Result Tree
          Fragment) in the fragment garbage collector. The fragment
           will be freed when the transformation context is freed."""
        if RVT == None: RVT__o = None
        else: RVT__o = RVT._o
        ret = libxsltmod.xsltRegisterPersistRVT(self._o, RVT__o)
        return ret

    def registerTmpRVT(self, RVT):
        """Registers the result value tree (XSLT 1.0 term: Result Tree
          Fragment) in the garbage collector. The fragment will be
          freed at the exit of the currently instantiated
          xsl:template. Obsolete; this function might produce massive
          memory overhead, since the fragment is only freed when the
          current xsl:template exits. Use xsltRegisterLocalRVT()
           instead."""
        if RVT == None: RVT__o = None
        else: RVT__o = RVT._o
        ret = libxsltmod.xsltRegisterTmpRVT(self._o, RVT__o)
        return ret

    def releaseRVT(self, RVT):
        """Either frees the RVT (which is an xmlDoc) or stores it in
           the context's cache for later reuse."""
        if RVT == None: RVT__o = None
        else: RVT__o = RVT._o
        libxsltmod.xsltReleaseRVT(self._o, RVT__o)

    #
    # transformCtxt functions from module xsltutils
    #

    def message(self, node, inst):
        """Process and xsl:message construct"""
        if node == None: node__o = None
        else: node__o = node._o
        if inst == None: inst__o = None
        else: inst__o = inst._o
        libxsltmod.xsltMessage(self._o, node__o, inst__o)

    def printErrorContext(self, style, node):
        """Display the context of an error."""
        if style == None: style__o = None
        else: style__o = style._o
        if node == None: node__o = None
        else: node__o = node._o
        libxsltmod.xsltPrintErrorContext(self._o, style__o, node__o)

    def profileInformation(self):
        """This function should be called after the transformation
          completed to extract template processing profiling
          information if availble. The information are returned as an
          XML document tree like <?xml version="1.0"?> <profile>
          <template rank="1" match="*" name="" mode="" calls="6"
          time="48" average="8"/> <template rank="2"
          match="item2|item3" name="" mode="" calls="10" time="30"
          average="3"/> <template rank="3" match="item1" name=""
          mode="" calls="5" time="17" average="3"/> </profile> The
          caller will need to free up the returned tree with
           xmlFreeDoc()"""
        ret = libxsltmod.xsltGetProfileInformation(self._o)
        if ret == None: return None
        return libxml2.xmlDoc(_obj=ret)

    def saveProfiling(self, output):
        """Save the profiling information on @output"""
        libxsltmod.xsltSaveProfiling(self._o, output)

    def setCtxtParseOptions(self, options):
        """Change the default parser option passed by the XSLT engine
           to the parser when using document() loading."""
        ret = libxsltmod.xsltSetCtxtParseOptions(self._o, options)
        return ret

class stylesheet(stylesheetBase):
    def __init__(self, _obj=None):
        self._o = None
        stylesheetBase.__init__(self, _obj=_obj)

    # accessors for stylesheet
    def doc(self):
        """Get the document of a stylesheet"""
        ret = libxsltmod.xsltStylesheetGetDoc(self._o)
        if ret == None: return None
        return libxml2.xmlDoc(_obj=ret)

    def doctypePublic(self):
        """Get the output PUBLIC of a stylesheet"""
        ret = libxsltmod.xsltStylesheetGetDoctypePublic(self._o)
        return ret

    def doctypeSystem(self):
        """Get the output SYSTEM of a stylesheet"""
        ret = libxsltmod.xsltStylesheetGetDoctypeSystem(self._o)
        return ret

    def encoding(self):
        """Get the output encoding of a stylesheet"""
        ret = libxsltmod.xsltStylesheetGetEncoding(self._o)
        return ret

    def imports(self):
        """Get the imports of a stylesheet"""
        ret = libxsltmod.xsltStylesheetGetImports(self._o)
        if ret == None: return None
        return stylesheet(_obj=ret)

    def method(self):
        """Get the output method of a stylesheet"""
        ret = libxsltmod.xsltStylesheetGetMethod(self._o)
        return ret

    def methodURI(self):
        """Get the output method URI of a stylesheet"""
        ret = libxsltmod.xsltStylesheetGetMethodURI(self._o)
        return ret

    def next(self):
        """Get the next sibling of a stylesheet"""
        ret = libxsltmod.xsltStylesheetGetNext(self._o)
        if ret == None: return None
        return stylesheet(_obj=ret)

    def parent(self):
        """Get the parent of a stylesheet"""
        ret = libxsltmod.xsltStylesheetGetParent(self._o)
        if ret == None: return None
        return stylesheet(_obj=ret)

    def version(self):
        """Get the output version of a stylesheet"""
        ret = libxsltmod.xsltStylesheetGetVersion(self._o)
        return ret

    #
    # stylesheet functions from module attributes
    #

    def freeAttributeSetsHashes(self):
        """Free up the memory used by attribute sets"""
        libxsltmod.xsltFreeAttributeSetsHashes(self._o)

    def parseStylesheetAttributeSet(self, cur):
        """parse an XSLT stylesheet attribute-set element"""
        if cur == None: cur__o = None
        else: cur__o = cur._o
        libxsltmod.xsltParseStylesheetAttributeSet(self._o, cur__o)

    def resolveStylesheetAttributeSet(self):
        """resolve the references between attribute sets."""
        libxsltmod.xsltResolveStylesheetAttributeSet(self._o)

    #
    # stylesheet functions from module documents
    #

    def freeStyleDocuments(self):
        """Frees the node-trees (and xsltDocument structures) of all
          stylesheet-modules of the stylesheet-level represented by
           the given @style."""
        libxsltmod.xsltFreeStyleDocuments(self._o)

    #
    # stylesheet functions from module extensions
    #

    def checkExtPrefix(self, URI):
        """Check if the given prefix is one of the declared
          extensions. This is intended to be called only at
          compile-time. Called by: xsltGetInheritedNsList() (xslt.c)
           xsltParseTemplateContent (xslt.c)"""
        ret = libxsltmod.xsltCheckExtPrefix(self._o, URI)
        return ret

    def checkExtURI(self, URI):
        """Check if the given prefix is one of the declared
          extensions. This is intended to be called only at
          compile-time. Called by: xsltPrecomputeStylesheet()
           (xslt.c) xsltParseTemplateContent (xslt.c)"""
        ret = libxsltmod.xsltCheckExtURI(self._o, URI)
        return ret

    def freeExts(self):
        """Free up the memory used by XSLT extensions in a stylesheet"""
        libxsltmod.xsltFreeExts(self._o)

    def registerExtPrefix(self, prefix, URI):
        """Registers an extension namespace This is called from xslt.c
          during compile-time. The given prefix is not needed. Called
          by: xsltParseExtElemPrefixes() (new function)
           xsltRegisterExtPrefix() (old function)"""
        ret = libxsltmod.xsltRegisterExtPrefix(self._o, prefix, URI)
        return ret

    def shutdownExts(self):
        """Shutdown the set of modules loaded"""
        libxsltmod.xsltShutdownExts(self._o)

    #
    # stylesheet functions from module imports
    #

    def nextImport(self):
        """Find the next stylesheet in import precedence."""
        ret = libxsltmod.xsltNextImport(self._o)
        if ret == None: return None
        return stylesheet(_obj=ret)

    def parseStylesheetImport(self, cur):
        """parse an XSLT stylesheet import element"""
        if cur == None: cur__o = None
        else: cur__o = cur._o
        ret = libxsltmod.xsltParseStylesheetImport(self._o, cur__o)
        return ret

    def parseStylesheetInclude(self, cur):
        """parse an XSLT stylesheet include element"""
        if cur == None: cur__o = None
        else: cur__o = cur._o
        ret = libxsltmod.xsltParseStylesheetInclude(self._o, cur__o)
        return ret

    #
    # stylesheet functions from module keys
    #

    def addKey(self, name, nameURI, match, use, inst):
        """add a key definition to a stylesheet"""
        if inst == None: inst__o = None
        else: inst__o = inst._o
        ret = libxsltmod.xsltAddKey(self._o, name, nameURI, match, use, inst__o)
        return ret

    def freeKeys(self):
        """Free up the memory used by XSLT keys in a stylesheet"""
        libxsltmod.xsltFreeKeys(self._o)

    #
    # stylesheet functions from module namespaces
    #

    def freeNamespaceAliasHashes(self):
        """Free up the memory used by namespaces aliases"""
        libxsltmod.xsltFreeNamespaceAliasHashes(self._o)

    def namespaceAlias(self, node):
        """Read the stylesheet-prefix and result-prefix attributes,
           register them as well as the corresponding namespace."""
        if node == None: node__o = None
        else: node__o = node._o
        libxsltmod.xsltNamespaceAlias(self._o, node__o)

    #
    # stylesheet functions from module pattern
    #

    def cleanupTemplates(self):
        """Cleanup the state of the templates used by the stylesheet
           and the ones it imports."""
        libxsltmod.xsltCleanupTemplates(self._o)

    def freeTemplateHashes(self):
        """Free up the memory used by xsltAddTemplate/xsltGetTemplate
           mechanism"""
        libxsltmod.xsltFreeTemplateHashes(self._o)

    #
    # stylesheet functions from module preproc
    #

    def freeStylePreComps(self):
        """Free up the memory allocated by all precomputed blocks"""
        libxsltmod.xsltFreeStylePreComps(self._o)

    def stylePreCompute(self, inst):
        """Precompute an XSLT stylesheet element"""
        if inst == None: inst__o = None
        else: inst__o = inst._o
        libxsltmod.xsltStylePreCompute(self._o, inst__o)

    #
    # stylesheet functions from module python
    #

    def applyStylesheet(self, doc, params):
        """Apply the stylesheet to the document"""
        if doc == None: doc__o = None
        else: doc__o = doc._o
        ret = libxsltmod.xsltApplyStylesheet(self._o, doc__o, params)
        if ret == None: return None
        return libxml2.xmlDoc(_obj=ret)

    def applyStylesheetUser(self, doc, params, transformCtxt):
        """Apply the stylesheet to the document"""
        if doc == None: doc__o = None
        else: doc__o = doc._o
        if transformCtxt == None: transformCtxt__o = None
        else: transformCtxt__o = transformCtxt._o
        ret = libxsltmod.xsltApplyStylesheetUser(self._o, doc__o, params, transformCtxt__o)
        if ret == None: return None
        return libxml2.xmlDoc(_obj=ret)

    def compareStylesheetsEqual(self, other):
        """Compare one stylesheet with another"""
        if other == None: other__o = None
        else: other__o = other._o
        ret = libxsltmod.xsltCompareStylesheetsEqual(self._o, other__o)
        return ret

    def newTransformContext(self, doc):
        """Create a new XSLT TransformContext"""
        if doc == None: doc__o = None
        else: doc__o = doc._o
        ret = libxsltmod.xsltNewTransformContext(self._o, doc__o)
        if ret == None: return None
        return transformCtxt(_obj=ret)

    def saveResultToString(self, result):
        """Have the stylesheet serialize the result of a
           transformation to a python string"""
        if result == None: result__o = None
        else: result__o = result._o
        ret = libxsltmod.xsltSaveResultToString(self._o, result__o)
        return ret

    def stylesheetHashCode(self):
        """Get the hash code of the stylesheet"""
        ret = libxsltmod.xsltGetStylesheetHashCode(self._o)
        return ret

    #
    # stylesheet functions from module variables
    #

    def parseGlobalParam(self, cur):
        """parse an XSLT transformation param declaration and record
           its value."""
        if cur == None: cur__o = None
        else: cur__o = cur._o
        libxsltmod.xsltParseGlobalParam(self._o, cur__o)

    def parseGlobalVariable(self, cur):
        """Parses a global XSLT 'variable' declaration at compilation
           time and registers it"""
        if cur == None: cur__o = None
        else: cur__o = cur._o
        libxsltmod.xsltParseGlobalVariable(self._o, cur__o)

    #
    # stylesheet functions from module xsltInternals
    #

    def allocateExtra(self):
        """Allocate an extra runtime information slot statically while
           compiling the stylesheet and return its number"""
        ret = libxsltmod.xsltAllocateExtra(self._o)
        return ret

    def compileAttr(self, attr):
        """Precompile an attribute in a stylesheet, basically it
          checks if it is an attrubute value template, and if yes
          establish some structures needed to process it at
           transformation time."""
        if attr == None: attr__o = None
        else: attr__o = attr._o
        libxsltmod.xsltCompileAttr(self._o, attr__o)

    def freeStylesheet(self):
        """Free up the memory allocated by @style"""
        libxsltmod.xsltFreeStylesheet(self._o)

    def parseStylesheetImportedDoc(self, doc):
        """parse an XSLT stylesheet building the associated structures
           except the processing not needed for imported documents."""
        if doc == None: doc__o = None
        else: doc__o = doc._o
        ret = libxsltmod.xsltParseStylesheetImportedDoc(doc__o, self._o)
        if ret == None: return None
        return stylesheet(_obj=ret)

    def parseStylesheetOutput(self, cur):
        """parse an XSLT stylesheet output element and record
           information related to the stylesheet output"""
        if cur == None: cur__o = None
        else: cur__o = cur._o
        libxsltmod.xsltParseStylesheetOutput(self._o, cur__o)

    def parseStylesheetProcess(self, doc):
        """Parses an XSLT stylesheet, adding the associated
          structures. Called by: xsltParseStylesheetImportedDoc()
           (xslt.c) xsltParseStylesheetInclude() (imports.c)"""
        if doc == None: doc__o = None
        else: doc__o = doc._o
        ret = libxsltmod.xsltParseStylesheetProcess(self._o, doc__o)
        if ret == None: return None
        return stylesheet(_obj=ret)

    def parseTemplateContent(self, templ):
        """parse a template content-model Clean-up the template
          content from unwanted ignorable blank nodes and process
           xslt:text"""
        if templ == None: templ__o = None
        else: templ__o = templ._o
        libxsltmod.xsltParseTemplateContent(self._o, templ__o)

    #
    # stylesheet functions from module xsltutils
    #

    def cNsProp(self, node, name, nameSpace):
        """Similar to xmlGetNsProp() but with a slightly different
          semantic  Search and get the value of an attribute
          associated to a node This attribute has to be anchored in
          the namespace specified, or has no namespace and the
          element is in that namespace.  This does the entity
          substitution. This function looks in DTD attribute
          declaration for #FIXED or default declaration values unless
           DTD use has been turned off."""
        if node == None: node__o = None
        else: node__o = node._o
        ret = libxsltmod.xsltGetCNsProp(self._o, node__o, name, nameSpace)
        return ret

    def printErrorContext(self, ctxt, node):
        """Display the context of an error."""
        if ctxt == None: ctxt__o = None
        else: ctxt__o = ctxt._o
        if node == None: node__o = None
        else: node__o = node._o
        libxsltmod.xsltPrintErrorContext(ctxt__o, self._o, node__o)

    def saveResultToFd(self, fd, result):
        """Save the result @result obtained by applying the @style
          stylesheet to an open file descriptor This does not close
           the descriptor."""
        if result == None: result__o = None
        else: result__o = result._o
        ret = libxsltmod.xsltSaveResultToFd(fd, result__o, self._o)
        return ret

    def saveResultToFile(self, file, result):
        """Save the result @result obtained by applying the @style
          stylesheet to an open FILE * I/O. This does not close the
           FILE @file"""
        if result == None: result__o = None
        else: result__o = result._o
        ret = libxsltmod.xsltSaveResultToFile(file, result__o, self._o)
        return ret

    def saveResultToFilename(self, URL, result, compression):
        """Save the result @result obtained by applying the @style
           stylesheet to a file or @URL"""
        if result == None: result__o = None
        else: result__o = result._o
        ret = libxsltmod.xsltSaveResultToFilename(URL, result__o, self._o, compression)
        return ret

# xsltTransformState
XSLT_STATE_OK = 0
XSLT_STATE_ERROR = 1
XSLT_STATE_STOPPED = 2

# xsltDebugStatusCodes
XSLT_DEBUG_NONE = 0
XSLT_DEBUG_INIT = 1
XSLT_DEBUG_STEP = 2
XSLT_DEBUG_STEPOUT = 3
XSLT_DEBUG_NEXT = 4
XSLT_DEBUG_STOP = 5
XSLT_DEBUG_CONT = 6
XSLT_DEBUG_RUN = 7
XSLT_DEBUG_RUN_RESTART = 8
XSLT_DEBUG_QUIT = 9

# xsltOutputType
XSLT_OUTPUT_XML = 0
XSLT_OUTPUT_HTML = 1
XSLT_OUTPUT_TEXT = 2

# xsltErrorSeverityType
XSLT_ERROR_SEVERITY_ERROR = 0
XSLT_ERROR_SEVERITY_WARNING = 1

# xsltStyleType
XSLT_FUNC_COPY = 1
XSLT_FUNC_SORT = 2
XSLT_FUNC_TEXT = 3
XSLT_FUNC_ELEMENT = 4
XSLT_FUNC_ATTRIBUTE = 5
XSLT_FUNC_COMMENT = 6
XSLT_FUNC_PI = 7
XSLT_FUNC_COPYOF = 8
XSLT_FUNC_VALUEOF = 9
XSLT_FUNC_NUMBER = 10
XSLT_FUNC_APPLYIMPORTS = 11
XSLT_FUNC_CALLTEMPLATE = 12
XSLT_FUNC_APPLYTEMPLATES = 13
XSLT_FUNC_CHOOSE = 14
XSLT_FUNC_IF = 15
XSLT_FUNC_FOREACH = 16
XSLT_FUNC_DOCUMENT = 17
XSLT_FUNC_WITHPARAM = 18
XSLT_FUNC_PARAM = 19
XSLT_FUNC_VARIABLE = 20
XSLT_FUNC_WHEN = 21
XSLT_FUNC_EXTENSION = 22
XSLT_FUNC_OTHERWISE = 23
XSLT_FUNC_FALLBACK = 24
XSLT_FUNC_MESSAGE = 25
XSLT_FUNC_INCLUDE = 26
XSLT_FUNC_ATTRSET = 27
XSLT_FUNC_LITERAL_RESULT_ELEMENT = 28
XSLT_FUNC_UNKOWN_FORWARDS_COMPAT = 29

# xsltLoadType
XSLT_LOAD_START = 0
XSLT_LOAD_STYLESHEET = 1
XSLT_LOAD_DOCUMENT = 2

# xsltSecurityOption
XSLT_SECPREF_READ_FILE = 1
XSLT_SECPREF_WRITE_FILE = 2
XSLT_SECPREF_CREATE_DIRECTORY = 3
XSLT_SECPREF_READ_NETWORK = 4
XSLT_SECPREF_WRITE_NETWORK = 5

# xsltDebugTraceCodes
XSLT_TRACE_ALL = -1
XSLT_TRACE_NONE = 0
XSLT_TRACE_COPY_TEXT = 1
XSLT_TRACE_PROCESS_NODE = 2
XSLT_TRACE_APPLY_TEMPLATE = 4
XSLT_TRACE_COPY = 8
XSLT_TRACE_COMMENT = 16
XSLT_TRACE_PI = 32
XSLT_TRACE_COPY_OF = 64
XSLT_TRACE_VALUE_OF = 128
XSLT_TRACE_CALL_TEMPLATE = 256
XSLT_TRACE_APPLY_TEMPLATES = 512
XSLT_TRACE_CHOOSE = 1024
XSLT_TRACE_IF = 2048
XSLT_TRACE_FOR_EACH = 4096
XSLT_TRACE_STRIP_SPACES = 8192
XSLT_TRACE_TEMPLATES = 16384
XSLT_TRACE_KEYS = 32768
XSLT_TRACE_VARIABLES = 65536