Warning, file /include/libxslt/xsltInternals.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef __XML_XSLT_INTERNALS_H__
0014 #define __XML_XSLT_INTERNALS_H__
0015
0016 #include <libxml/tree.h>
0017 #include <libxml/hash.h>
0018 #include <libxml/xpath.h>
0019 #include <libxml/xmlerror.h>
0020 #include <libxml/dict.h>
0021 #include <libxml/xmlstring.h>
0022 #include <libxslt/xslt.h>
0023 #include "xsltexports.h"
0024 #include "numbersInternals.h"
0025
0026 #ifdef __cplusplus
0027 extern "C" {
0028 #endif
0029
0030
0031
0032
0033
0034
0035
0036
0037 #define XSLT_IS_TEXT_NODE(n) ((n != NULL) && \
0038 (((n)->type == XML_TEXT_NODE) || \
0039 ((n)->type == XML_CDATA_SECTION_NODE)))
0040
0041
0042
0043
0044
0045
0046
0047 #define XSLT_MARK_RES_TREE_FRAG(n) \
0048 (n)->name = (char *) xmlStrdup(BAD_CAST " fake node libxslt");
0049
0050
0051
0052
0053
0054
0055 #define XSLT_IS_RES_TREE_FRAG(n) \
0056 ((n != NULL) && ((n)->type == XML_DOCUMENT_NODE) && \
0057 ((n)->name != NULL) && ((n)->name[0] == ' '))
0058
0059
0060
0061
0062
0063
0064
0065 #define XSLT_REFACTORED_KEYCOMP
0066
0067
0068
0069
0070
0071
0072
0073 #define XSLT_FAST_IF
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088 #define XSLT_REFACTORED_VARS
0089
0090 #ifdef XSLT_REFACTORED
0091
0092 extern const xmlChar *xsltXSLTAttrMarker;
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107 #ifdef XSLT_REFACTORED_XSLT_NSCOMP
0108
0109 extern const xmlChar *xsltConstNamespaceNameXSLT;
0110
0111
0112
0113
0114
0115
0116 #define IS_XSLT_ELEM_FAST(n) \
0117 (((n) != NULL) && ((n)->ns != NULL) && \
0118 ((n)->ns->href == xsltConstNamespaceNameXSLT))
0119
0120
0121
0122
0123
0124
0125 #define IS_XSLT_ATTR_FAST(a) \
0126 (((a) != NULL) && ((a)->ns != NULL) && \
0127 ((a)->ns->href == xsltConstNamespaceNameXSLT))
0128
0129
0130
0131
0132
0133
0134 #define XSLT_HAS_INTERNAL_NSMAP(s) \
0135 (((s) != NULL) && ((s)->principal) && \
0136 ((s)->principal->principalData) && \
0137 ((s)->principal->principalData->nsMap))
0138
0139
0140
0141
0142
0143
0144 #define XSLT_GET_INTERNAL_NSMAP(s) ((s)->principal->principalData->nsMap)
0145
0146 #else
0147
0148
0149
0150
0151
0152
0153 #define IS_XSLT_ELEM_FAST(n) \
0154 (((n) != NULL) && ((n)->ns != NULL) && \
0155 (xmlStrEqual((n)->ns->href, XSLT_NAMESPACE)))
0156
0157
0158
0159
0160
0161
0162 #define IS_XSLT_ATTR_FAST(a) \
0163 (((a) != NULL) && ((a)->ns != NULL) && \
0164 (xmlStrEqual((a)->ns->href, XSLT_NAMESPACE)))
0165
0166
0167 #endif
0168
0169
0170
0171
0172
0173
0174
0175
0176
0177
0178
0179
0180
0181
0182
0183
0184
0185 typedef struct _xsltPointerList xsltPointerList;
0186 typedef xsltPointerList *xsltPointerListPtr;
0187 struct _xsltPointerList {
0188 void **items;
0189 int number;
0190 int size;
0191 };
0192
0193 #endif
0194
0195
0196
0197
0198
0199
0200
0201
0202
0203
0204
0205
0206
0207
0208 #define XSLT_MAX_SORT 15
0209
0210
0211
0212
0213
0214
0215 #define XSLT_PAT_NO_PRIORITY -12345789
0216
0217
0218
0219
0220
0221
0222 typedef struct _xsltRuntimeExtra xsltRuntimeExtra;
0223 typedef xsltRuntimeExtra *xsltRuntimeExtraPtr;
0224 struct _xsltRuntimeExtra {
0225 void *info;
0226 xmlFreeFunc deallocate;
0227 union {
0228 void *ptr;
0229 int ival;
0230 } val;
0231 };
0232
0233
0234
0235
0236
0237
0238
0239
0240 #define XSLT_RUNTIME_EXTRA_LST(ctxt, nr) (ctxt)->extras[(nr)].info
0241
0242
0243
0244
0245
0246
0247
0248 #define XSLT_RUNTIME_EXTRA_FREE(ctxt, nr) (ctxt)->extras[(nr)].deallocate
0249
0250
0251
0252
0253
0254
0255
0256 #define XSLT_RUNTIME_EXTRA(ctxt, nr, typ) (ctxt)->extras[(nr)].val.typ
0257
0258
0259
0260
0261
0262
0263 typedef struct _xsltTemplate xsltTemplate;
0264 typedef xsltTemplate *xsltTemplatePtr;
0265 struct _xsltTemplate {
0266 struct _xsltTemplate *next;
0267 struct _xsltStylesheet *style;
0268 xmlChar *match;
0269 float priority;
0270 const xmlChar *name;
0271 const xmlChar *nameURI;
0272 const xmlChar *mode;
0273 const xmlChar *modeURI;
0274 xmlNodePtr content;
0275 xmlNodePtr elem;
0276
0277
0278
0279
0280
0281 int inheritedNsNr;
0282 xmlNsPtr *inheritedNs;
0283
0284
0285 int nbCalls;
0286 unsigned long time;
0287 void *params;
0288
0289 int templNr;
0290 int templMax;
0291 xsltTemplatePtr *templCalledTab;
0292 int *templCountTab;
0293
0294
0295 int position;
0296 };
0297
0298
0299
0300
0301
0302
0303 typedef struct _xsltDecimalFormat xsltDecimalFormat;
0304 typedef xsltDecimalFormat *xsltDecimalFormatPtr;
0305 struct _xsltDecimalFormat {
0306 struct _xsltDecimalFormat *next;
0307 xmlChar *name;
0308
0309 xmlChar *digit;
0310 xmlChar *patternSeparator;
0311
0312 xmlChar *minusSign;
0313 xmlChar *infinity;
0314 xmlChar *noNumber;
0315
0316 xmlChar *decimalPoint;
0317 xmlChar *grouping;
0318 xmlChar *percent;
0319 xmlChar *permille;
0320 xmlChar *zeroDigit;
0321 const xmlChar *nsUri;
0322 };
0323
0324
0325
0326
0327
0328
0329 typedef struct _xsltDocument xsltDocument;
0330 typedef xsltDocument *xsltDocumentPtr;
0331 struct _xsltDocument {
0332 struct _xsltDocument *next;
0333 int main;
0334 xmlDocPtr doc;
0335 void *keys;
0336 struct _xsltDocument *includes;
0337 int preproc;
0338 int nbKeysComputed;
0339 };
0340
0341
0342
0343
0344
0345
0346 typedef struct _xsltKeyDef xsltKeyDef;
0347 typedef xsltKeyDef *xsltKeyDefPtr;
0348 struct _xsltKeyDef {
0349 struct _xsltKeyDef *next;
0350 xmlNodePtr inst;
0351 xmlChar *name;
0352 xmlChar *nameURI;
0353 xmlChar *match;
0354 xmlChar *use;
0355 xmlXPathCompExprPtr comp;
0356 xmlXPathCompExprPtr usecomp;
0357 xmlNsPtr *nsList;
0358 int nsNr;
0359 };
0360
0361
0362
0363
0364
0365
0366
0367 typedef struct _xsltKeyTable xsltKeyTable;
0368 typedef xsltKeyTable *xsltKeyTablePtr;
0369 struct _xsltKeyTable {
0370 struct _xsltKeyTable *next;
0371 xmlChar *name;
0372 xmlChar *nameURI;
0373 xmlHashTablePtr keys;
0374 };
0375
0376
0377
0378
0379
0380
0381 typedef struct _xsltStylesheet xsltStylesheet;
0382 typedef xsltStylesheet *xsltStylesheetPtr;
0383
0384 typedef struct _xsltTransformContext xsltTransformContext;
0385 typedef xsltTransformContext *xsltTransformContextPtr;
0386
0387
0388
0389
0390
0391
0392
0393 typedef struct _xsltElemPreComp xsltElemPreComp;
0394 typedef xsltElemPreComp *xsltElemPreCompPtr;
0395
0396
0397
0398
0399
0400
0401
0402
0403
0404
0405
0406 typedef void (*xsltTransformFunction) (xsltTransformContextPtr ctxt,
0407 xmlNodePtr node,
0408 xmlNodePtr inst,
0409 xsltElemPreCompPtr comp);
0410
0411
0412
0413
0414
0415
0416
0417
0418
0419 typedef void (*xsltSortFunc) (xsltTransformContextPtr ctxt, xmlNodePtr *sorts,
0420 int nbsorts);
0421
0422 typedef enum {
0423 XSLT_FUNC_COPY=1,
0424 XSLT_FUNC_SORT,
0425 XSLT_FUNC_TEXT,
0426 XSLT_FUNC_ELEMENT,
0427 XSLT_FUNC_ATTRIBUTE,
0428 XSLT_FUNC_COMMENT,
0429 XSLT_FUNC_PI,
0430 XSLT_FUNC_COPYOF,
0431 XSLT_FUNC_VALUEOF,
0432 XSLT_FUNC_NUMBER,
0433 XSLT_FUNC_APPLYIMPORTS,
0434 XSLT_FUNC_CALLTEMPLATE,
0435 XSLT_FUNC_APPLYTEMPLATES,
0436 XSLT_FUNC_CHOOSE,
0437 XSLT_FUNC_IF,
0438 XSLT_FUNC_FOREACH,
0439 XSLT_FUNC_DOCUMENT,
0440 XSLT_FUNC_WITHPARAM,
0441 XSLT_FUNC_PARAM,
0442 XSLT_FUNC_VARIABLE,
0443 XSLT_FUNC_WHEN,
0444 XSLT_FUNC_EXTENSION
0445 #ifdef XSLT_REFACTORED
0446 ,
0447 XSLT_FUNC_OTHERWISE,
0448 XSLT_FUNC_FALLBACK,
0449 XSLT_FUNC_MESSAGE,
0450 XSLT_FUNC_INCLUDE,
0451 XSLT_FUNC_ATTRSET,
0452 XSLT_FUNC_LITERAL_RESULT_ELEMENT,
0453 XSLT_FUNC_UNKOWN_FORWARDS_COMPAT
0454 #endif
0455 } xsltStyleType;
0456
0457
0458
0459
0460
0461
0462
0463 typedef void (*xsltElemPreCompDeallocator) (xsltElemPreCompPtr comp);
0464
0465
0466
0467
0468
0469
0470
0471
0472
0473 struct _xsltElemPreComp {
0474 xsltElemPreCompPtr next;
0475
0476 xsltStyleType type;
0477 xsltTransformFunction func;
0478 xmlNodePtr inst;
0479
0480
0481
0482 xsltElemPreCompDeallocator free;
0483 };
0484
0485
0486
0487
0488
0489
0490
0491
0492
0493
0494 typedef struct _xsltStylePreComp xsltStylePreComp;
0495 typedef xsltStylePreComp *xsltStylePreCompPtr;
0496
0497 #ifdef XSLT_REFACTORED
0498
0499
0500
0501
0502 XSLTPUBFUN xsltPointerListPtr XSLTCALL
0503 xsltPointerListCreate (int initialSize);
0504 XSLTPUBFUN void XSLTCALL
0505 xsltPointerListFree (xsltPointerListPtr list);
0506 XSLTPUBFUN void XSLTCALL
0507 xsltPointerListClear (xsltPointerListPtr list);
0508 XSLTPUBFUN int XSLTCALL
0509 xsltPointerListAddSize (xsltPointerListPtr list,
0510 void *item,
0511 int initialSize);
0512
0513
0514
0515
0516
0517
0518
0519 typedef struct _xsltNsListContainer xsltNsListContainer;
0520 typedef xsltNsListContainer *xsltNsListContainerPtr;
0521 struct _xsltNsListContainer {
0522 xmlNsPtr *list;
0523 int totalNumber;
0524 int xpathNumber;
0525 };
0526
0527
0528
0529
0530
0531
0532
0533
0534
0535
0536 #define XSLT_ITEM_COMPATIBILITY_FIELDS \
0537 xsltElemPreCompPtr next;\
0538 xsltStyleType type;\
0539 xsltTransformFunction func;\
0540 xmlNodePtr inst;
0541
0542
0543
0544
0545
0546
0547
0548 #define XSLT_ITEM_NAVIGATION_FIELDS
0549
0550
0551
0552
0553
0554
0555
0556
0557
0558
0559
0560 #define XSLT_ITEM_NSINSCOPE_FIELDS xsltNsListContainerPtr inScopeNs;
0561
0562
0563
0564
0565
0566
0567 #define XSLT_ITEM_COMMON_FIELDS \
0568 XSLT_ITEM_COMPATIBILITY_FIELDS \
0569 XSLT_ITEM_NAVIGATION_FIELDS \
0570 XSLT_ITEM_NSINSCOPE_FIELDS
0571
0572
0573
0574
0575
0576
0577
0578
0579
0580
0581
0582
0583
0584
0585 struct _xsltStylePreComp {
0586 xsltElemPreCompPtr next;
0587
0588 xsltStyleType type;
0589 xsltTransformFunction func;
0590 xmlNodePtr inst;
0591
0592
0593 xsltNsListContainerPtr inScopeNs;
0594 };
0595
0596
0597
0598
0599
0600
0601
0602
0603
0604 typedef struct _xsltStyleBasicEmptyItem xsltStyleBasicEmptyItem;
0605 typedef xsltStyleBasicEmptyItem *xsltStyleBasicEmptyItemPtr;
0606
0607 struct _xsltStyleBasicEmptyItem {
0608 XSLT_ITEM_COMMON_FIELDS
0609 };
0610
0611
0612
0613
0614
0615
0616
0617 typedef struct _xsltStyleBasicExpressionItem xsltStyleBasicExpressionItem;
0618 typedef xsltStyleBasicExpressionItem *xsltStyleBasicExpressionItemPtr;
0619
0620 struct _xsltStyleBasicExpressionItem {
0621 XSLT_ITEM_COMMON_FIELDS
0622
0623 const xmlChar *select;
0624 xmlXPathCompExprPtr comp;
0625 };
0626
0627
0628
0629
0630
0631
0632
0633
0634
0635
0636
0637
0638
0639
0640
0641
0642
0643
0644 typedef struct _xsltStyleItemElement xsltStyleItemElement;
0645 typedef xsltStyleItemElement *xsltStyleItemElementPtr;
0646
0647 struct _xsltStyleItemElement {
0648 XSLT_ITEM_COMMON_FIELDS
0649
0650 const xmlChar *use;
0651 int has_use;
0652 const xmlChar *name;
0653 int has_name;
0654 const xmlChar *ns;
0655 const xmlChar *nsPrefix;
0656 int has_ns;
0657 };
0658
0659
0660
0661
0662
0663
0664
0665
0666
0667
0668
0669 typedef struct _xsltStyleItemAttribute xsltStyleItemAttribute;
0670 typedef xsltStyleItemAttribute *xsltStyleItemAttributePtr;
0671
0672 struct _xsltStyleItemAttribute {
0673 XSLT_ITEM_COMMON_FIELDS
0674 const xmlChar *name;
0675 int has_name;
0676 const xmlChar *ns;
0677 const xmlChar *nsPrefix;
0678 int has_ns;
0679 };
0680
0681
0682
0683
0684
0685
0686
0687
0688
0689
0690 typedef struct _xsltStyleItemText xsltStyleItemText;
0691 typedef xsltStyleItemText *xsltStyleItemTextPtr;
0692
0693 struct _xsltStyleItemText {
0694 XSLT_ITEM_COMMON_FIELDS
0695 int noescape;
0696 };
0697
0698
0699
0700
0701
0702
0703
0704
0705
0706 typedef xsltStyleBasicEmptyItem xsltStyleItemComment;
0707 typedef xsltStyleItemComment *xsltStyleItemCommentPtr;
0708
0709
0710
0711
0712
0713
0714
0715
0716
0717
0718 typedef struct _xsltStyleItemPI xsltStyleItemPI;
0719 typedef xsltStyleItemPI *xsltStyleItemPIPtr;
0720
0721 struct _xsltStyleItemPI {
0722 XSLT_ITEM_COMMON_FIELDS
0723 const xmlChar *name;
0724 int has_name;
0725 };
0726
0727
0728
0729
0730
0731
0732
0733 typedef xsltStyleBasicEmptyItem xsltStyleItemApplyImports;
0734 typedef xsltStyleItemApplyImports *xsltStyleItemApplyImportsPtr;
0735
0736
0737
0738
0739
0740
0741
0742
0743
0744
0745
0746 typedef struct _xsltStyleItemApplyTemplates xsltStyleItemApplyTemplates;
0747 typedef xsltStyleItemApplyTemplates *xsltStyleItemApplyTemplatesPtr;
0748
0749 struct _xsltStyleItemApplyTemplates {
0750 XSLT_ITEM_COMMON_FIELDS
0751
0752 const xmlChar *mode;
0753 const xmlChar *modeURI;
0754 const xmlChar *select;
0755 xmlXPathCompExprPtr comp;
0756
0757 };
0758
0759
0760
0761
0762
0763
0764
0765
0766
0767
0768 typedef struct _xsltStyleItemCallTemplate xsltStyleItemCallTemplate;
0769 typedef xsltStyleItemCallTemplate *xsltStyleItemCallTemplatePtr;
0770
0771 struct _xsltStyleItemCallTemplate {
0772 XSLT_ITEM_COMMON_FIELDS
0773
0774 xsltTemplatePtr templ;
0775 const xmlChar *name;
0776 int has_name;
0777 const xmlChar *ns;
0778 int has_ns;
0779
0780 };
0781
0782
0783
0784
0785
0786
0787
0788
0789
0790
0791 typedef struct _xsltStyleItemCopy xsltStyleItemCopy;
0792 typedef xsltStyleItemCopy *xsltStyleItemCopyPtr;
0793
0794 struct _xsltStyleItemCopy {
0795 XSLT_ITEM_COMMON_FIELDS
0796 const xmlChar *use;
0797 int has_use;
0798 };
0799
0800
0801
0802
0803
0804
0805
0806
0807
0808
0809 typedef struct _xsltStyleItemIf xsltStyleItemIf;
0810 typedef xsltStyleItemIf *xsltStyleItemIfPtr;
0811
0812 struct _xsltStyleItemIf {
0813 XSLT_ITEM_COMMON_FIELDS
0814
0815 const xmlChar *test;
0816 xmlXPathCompExprPtr comp;
0817 };
0818
0819
0820
0821
0822
0823
0824
0825
0826
0827 typedef xsltStyleBasicExpressionItem xsltStyleItemCopyOf;
0828 typedef xsltStyleItemCopyOf *xsltStyleItemCopyOfPtr;
0829
0830
0831
0832
0833
0834
0835
0836
0837
0838 typedef struct _xsltStyleItemValueOf xsltStyleItemValueOf;
0839 typedef xsltStyleItemValueOf *xsltStyleItemValueOfPtr;
0840
0841 struct _xsltStyleItemValueOf {
0842 XSLT_ITEM_COMMON_FIELDS
0843
0844 const xmlChar *select;
0845 xmlXPathCompExprPtr comp;
0846 int noescape;
0847 };
0848
0849
0850
0851
0852
0853
0854
0855
0856
0857
0858
0859
0860
0861
0862
0863
0864 typedef struct _xsltStyleItemNumber xsltStyleItemNumber;
0865 typedef xsltStyleItemNumber *xsltStyleItemNumberPtr;
0866
0867 struct _xsltStyleItemNumber {
0868 XSLT_ITEM_COMMON_FIELDS
0869 xsltNumberData numdata;
0870 };
0871
0872
0873
0874
0875
0876
0877
0878
0879
0880 typedef xsltStyleBasicEmptyItem xsltStyleItemChoose;
0881 typedef xsltStyleItemChoose *xsltStyleItemChoosePtr;
0882
0883
0884
0885
0886
0887
0888
0889
0890
0891 typedef xsltStyleBasicEmptyItem xsltStyleItemFallback;
0892 typedef xsltStyleItemFallback *xsltStyleItemFallbackPtr;
0893
0894
0895
0896
0897
0898
0899
0900
0901
0902
0903 typedef xsltStyleBasicExpressionItem xsltStyleItemForEach;
0904 typedef xsltStyleItemForEach *xsltStyleItemForEachPtr;
0905
0906
0907
0908
0909
0910
0911
0912
0913
0914
0915 typedef struct _xsltStyleItemMessage xsltStyleItemMessage;
0916 typedef xsltStyleItemMessage *xsltStyleItemMessagePtr;
0917
0918 struct _xsltStyleItemMessage {
0919 XSLT_ITEM_COMMON_FIELDS
0920 int terminate;
0921 };
0922
0923
0924
0925
0926
0927
0928 typedef struct _xsltStyleItemDocument xsltStyleItemDocument;
0929 typedef xsltStyleItemDocument *xsltStyleItemDocumentPtr;
0930
0931 struct _xsltStyleItemDocument {
0932 XSLT_ITEM_COMMON_FIELDS
0933 int ver11;
0934
0935
0936 const xmlChar *filename;
0937 int has_filename;
0938 };
0939
0940
0941
0942
0943
0944
0945
0946
0947
0948
0949
0950
0951
0952
0953
0954
0955
0956
0957
0958 typedef struct _xsltStyleBasicItemVariable xsltStyleBasicItemVariable;
0959 typedef xsltStyleBasicItemVariable *xsltStyleBasicItemVariablePtr;
0960
0961 struct _xsltStyleBasicItemVariable {
0962 XSLT_ITEM_COMMON_FIELDS
0963
0964 const xmlChar *select;
0965 xmlXPathCompExprPtr comp;
0966
0967 const xmlChar *name;
0968 int has_name;
0969 const xmlChar *ns;
0970 int has_ns;
0971 };
0972
0973
0974
0975
0976
0977
0978
0979
0980
0981
0982
0983 typedef xsltStyleBasicItemVariable xsltStyleItemVariable;
0984 typedef xsltStyleItemVariable *xsltStyleItemVariablePtr;
0985
0986
0987
0988
0989
0990
0991
0992
0993
0994
0995
0996 typedef struct _xsltStyleItemParam xsltStyleItemParam;
0997 typedef xsltStyleItemParam *xsltStyleItemParamPtr;
0998
0999 struct _xsltStyleItemParam {
1000 XSLT_ITEM_COMMON_FIELDS
1001
1002 const xmlChar *select;
1003 xmlXPathCompExprPtr comp;
1004
1005 const xmlChar *name;
1006 int has_name;
1007 const xmlChar *ns;
1008 int has_ns;
1009 };
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020 typedef xsltStyleBasicItemVariable xsltStyleItemWithParam;
1021 typedef xsltStyleItemWithParam *xsltStyleItemWithParamPtr;
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035 typedef struct _xsltStyleItemSort xsltStyleItemSort;
1036 typedef xsltStyleItemSort *xsltStyleItemSortPtr;
1037
1038 struct _xsltStyleItemSort {
1039 XSLT_ITEM_COMMON_FIELDS
1040
1041 const xmlChar *stype;
1042 int has_stype;
1043 int number;
1044 const xmlChar *order;
1045 int has_order;
1046 int descending;
1047 const xmlChar *lang;
1048 int has_lang;
1049 const xmlChar *case_order;
1050 int lower_first;
1051
1052 const xmlChar *use;
1053 int has_use;
1054
1055 const xmlChar *select;
1056
1057 xmlXPathCompExprPtr comp;
1058 };
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070 typedef struct _xsltStyleItemWhen xsltStyleItemWhen;
1071 typedef xsltStyleItemWhen *xsltStyleItemWhenPtr;
1072
1073 struct _xsltStyleItemWhen {
1074 XSLT_ITEM_COMMON_FIELDS
1075
1076 const xmlChar *test;
1077 xmlXPathCompExprPtr comp;
1078 };
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088 typedef struct _xsltStyleItemOtherwise xsltStyleItemOtherwise;
1089 typedef xsltStyleItemOtherwise *xsltStyleItemOtherwisePtr;
1090
1091 struct _xsltStyleItemOtherwise {
1092 XSLT_ITEM_COMMON_FIELDS
1093 };
1094
1095 typedef struct _xsltStyleItemInclude xsltStyleItemInclude;
1096 typedef xsltStyleItemInclude *xsltStyleItemIncludePtr;
1097
1098 struct _xsltStyleItemInclude {
1099 XSLT_ITEM_COMMON_FIELDS
1100 xsltDocumentPtr include;
1101 };
1102
1103
1104
1105
1106
1107
1108
1109 typedef struct _xsltStyleItemUknown xsltStyleItemUknown;
1110 typedef xsltStyleItemUknown *xsltStyleItemUknownPtr;
1111 struct _xsltStyleItemUknown {
1112 XSLT_ITEM_COMMON_FIELDS
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 typedef struct _xsltStyleItemExtElement xsltStyleItemExtElement;
1143 typedef xsltStyleItemExtElement *xsltStyleItemExtElementPtr;
1144 struct _xsltStyleItemExtElement {
1145 XSLT_ITEM_COMMON_FIELDS
1146 xsltElemPreCompPtr item;
1147 };
1148
1149
1150
1151
1152
1153
1154
1155 typedef struct _xsltEffectiveNs xsltEffectiveNs;
1156 typedef xsltEffectiveNs *xsltEffectiveNsPtr;
1157 struct _xsltEffectiveNs {
1158 xsltEffectiveNsPtr nextInStore;
1159 xsltEffectiveNsPtr next;
1160 const xmlChar *prefix;
1161 const xmlChar *nsName;
1162
1163
1164
1165
1166 int holdByElem;
1167 };
1168
1169
1170
1171
1172
1173
1174
1175
1176 typedef struct _xsltStyleItemLRElementInfo xsltStyleItemLRElementInfo;
1177 typedef xsltStyleItemLRElementInfo *xsltStyleItemLRElementInfoPtr;
1178 struct _xsltStyleItemLRElementInfo {
1179 XSLT_ITEM_COMMON_FIELDS
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189 xsltEffectiveNsPtr effectiveNs;
1190
1191 };
1192
1193 #ifdef XSLT_REFACTORED
1194
1195 typedef struct _xsltNsAlias xsltNsAlias;
1196 typedef xsltNsAlias *xsltNsAliasPtr;
1197 struct _xsltNsAlias {
1198 xsltNsAliasPtr next;
1199 xmlNsPtr literalNs;
1200 xmlNsPtr targetNs;
1201 xmlDocPtr docOfTargetNs;
1202 };
1203 #endif
1204
1205 #ifdef XSLT_REFACTORED_XSLT_NSCOMP
1206
1207 typedef struct _xsltNsMap xsltNsMap;
1208 typedef xsltNsMap *xsltNsMapPtr;
1209 struct _xsltNsMap {
1210 xsltNsMapPtr next;
1211 xmlDocPtr doc;
1212 xmlNodePtr elem;
1213 xmlNsPtr ns;
1214 const xmlChar *origNsName;
1215 const xmlChar *newNsName;
1216 };
1217 #endif
1218
1219
1220
1221
1222
1223
1224
1225 typedef struct _xsltPrincipalStylesheetData xsltPrincipalStylesheetData;
1226 typedef xsltPrincipalStylesheetData *xsltPrincipalStylesheetDataPtr;
1227
1228 typedef struct _xsltNsList xsltNsList;
1229 typedef xsltNsList *xsltNsListPtr;
1230 struct _xsltNsList {
1231 xsltNsListPtr next;
1232 xmlNsPtr ns;
1233 };
1234
1235
1236
1237
1238
1239
1240 typedef struct _xsltVarInfo xsltVarInfo;
1241 typedef xsltVarInfo *xsltVarInfoPtr;
1242 struct _xsltVarInfo {
1243 xsltVarInfoPtr next;
1244 xsltVarInfoPtr prev;
1245 int depth;
1246 const xmlChar *name;
1247 const xmlChar *nsName;
1248 };
1249
1250
1251
1252
1253
1254
1255 typedef struct _xsltCompilerNodeInfo xsltCompilerNodeInfo;
1256 typedef xsltCompilerNodeInfo *xsltCompilerNodeInfoPtr;
1257 struct _xsltCompilerNodeInfo {
1258 xsltCompilerNodeInfoPtr next;
1259 xsltCompilerNodeInfoPtr prev;
1260 xmlNodePtr node;
1261 int depth;
1262 xsltTemplatePtr templ;
1263 int category;
1264
1265 xsltStyleType type;
1266 xsltElemPreCompPtr item;
1267
1268 xsltNsListContainerPtr inScopeNs;
1269
1270 xsltPointerListPtr exclResultNs;
1271
1272 xsltPointerListPtr extElemNs;
1273
1274
1275 xsltStyleItemLRElementInfoPtr litResElemInfo;
1276
1277
1278
1279
1280
1281
1282
1283 int nsChanged;
1284 int preserveWhitespace;
1285 int stripWhitespace;
1286 int isRoot;
1287 int forwardsCompat;
1288
1289 int extContentHandled;
1290
1291 xsltStyleType curChildType;
1292 };
1293
1294
1295
1296
1297
1298
1299 #define XSLT_CCTXT(style) ((xsltCompilerCtxtPtr) style->compCtxt)
1300
1301 typedef enum {
1302 XSLT_ERROR_SEVERITY_ERROR = 0,
1303 XSLT_ERROR_SEVERITY_WARNING
1304 } xsltErrorSeverityType;
1305
1306 typedef struct _xsltCompilerCtxt xsltCompilerCtxt;
1307 typedef xsltCompilerCtxt *xsltCompilerCtxtPtr;
1308 struct _xsltCompilerCtxt {
1309 void *errorCtxt;
1310
1311
1312 xsltErrorSeverityType errSeverity;
1313 int warnings;
1314
1315 int errors;
1316
1317 xmlDictPtr dict;
1318 xsltStylesheetPtr style;
1319 int simplified;
1320
1321 int depth;
1322
1323 xsltCompilerNodeInfoPtr inode;
1324 xsltCompilerNodeInfoPtr inodeList;
1325 xsltCompilerNodeInfoPtr inodeLast;
1326 xsltPointerListPtr tmpList;
1327
1328
1329
1330 int isInclude;
1331 int hasForwardsCompat;
1332
1333 int maxNodeInfos;
1334 int maxLREs;
1335
1336
1337
1338
1339
1340 int strict;
1341 xsltPrincipalStylesheetDataPtr psData;
1342 xsltStyleItemUknownPtr unknownItem;
1343 int hasNsAliases;
1344 xsltNsAliasPtr nsAliases;
1345 xsltVarInfoPtr ivars;
1346 xsltVarInfoPtr ivar;
1347 };
1348
1349 #else
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360 struct _xsltStylePreComp {
1361 xsltElemPreCompPtr next;
1362 xsltStyleType type;
1363 xsltTransformFunction func;
1364 xmlNodePtr inst;
1365
1366
1367
1368
1369
1370 const xmlChar *stype;
1371 int has_stype;
1372 int number;
1373 const xmlChar *order;
1374 int has_order;
1375 int descending;
1376 const xmlChar *lang;
1377 int has_lang;
1378 const xmlChar *case_order;
1379 int lower_first;
1380
1381 const xmlChar *use;
1382 int has_use;
1383
1384 int noescape;
1385
1386 const xmlChar *name;
1387 int has_name;
1388 const xmlChar *ns;
1389 int has_ns;
1390
1391 const xmlChar *mode;
1392 const xmlChar *modeURI;
1393
1394 const xmlChar *test;
1395
1396 xsltTemplatePtr templ;
1397
1398 const xmlChar *select;
1399
1400 int ver11;
1401 const xmlChar *filename;
1402 int has_filename;
1403
1404 xsltNumberData numdata;
1405
1406 xmlXPathCompExprPtr comp;
1407 xmlNsPtr *nsList;
1408 int nsNr;
1409 };
1410
1411 #endif
1412
1413
1414
1415
1416
1417
1418 typedef struct _xsltStackElem xsltStackElem;
1419 typedef xsltStackElem *xsltStackElemPtr;
1420 struct _xsltStackElem {
1421 struct _xsltStackElem *next;
1422 xsltStylePreCompPtr comp;
1423 int computed;
1424 const xmlChar *name;
1425 const xmlChar *nameURI;
1426 const xmlChar *select;
1427 xmlNodePtr tree;
1428
1429 xmlXPathObjectPtr value;
1430 xmlDocPtr fragment;
1431
1432 int level;
1433
1434 xsltTransformContextPtr context;
1435
1436 int flags;
1437 };
1438
1439 #ifdef XSLT_REFACTORED
1440
1441 struct _xsltPrincipalStylesheetData {
1442
1443
1444
1445
1446
1447 xmlDictPtr namespaceDict;
1448
1449
1450
1451 xsltPointerListPtr inScopeNamespaces;
1452
1453
1454
1455 xsltPointerListPtr exclResultNamespaces;
1456
1457
1458
1459 xsltPointerListPtr extElemNamespaces;
1460 xsltEffectiveNsPtr effectiveNs;
1461 #ifdef XSLT_REFACTORED_XSLT_NSCOMP
1462
1463
1464
1465 xsltNsMapPtr nsMap;
1466 #endif
1467 };
1468
1469
1470 #endif
1471
1472
1473
1474
1475
1476 struct _xsltStylesheet {
1477
1478
1479
1480 struct _xsltStylesheet *parent;
1481 struct _xsltStylesheet *next;
1482 struct _xsltStylesheet *imports;
1483
1484 xsltDocumentPtr docList;
1485
1486
1487
1488
1489 xmlDocPtr doc;
1490 xmlHashTablePtr stripSpaces;
1491
1492 int stripAll;
1493 xmlHashTablePtr cdataSection;
1494
1495
1496
1497
1498 xsltStackElemPtr variables;
1499
1500
1501
1502
1503 xsltTemplatePtr templates;
1504 xmlHashTablePtr templatesHash;
1505
1506 struct _xsltCompMatch *rootMatch;
1507 struct _xsltCompMatch *keyMatch;
1508 struct _xsltCompMatch *elemMatch;
1509 struct _xsltCompMatch *attrMatch;
1510 struct _xsltCompMatch *parentMatch;
1511 struct _xsltCompMatch *textMatch;
1512 struct _xsltCompMatch *piMatch;
1513
1514 struct _xsltCompMatch *commentMatch;
1515
1516
1517
1518
1519
1520 xmlHashTablePtr nsAliases;
1521
1522
1523
1524
1525 xmlHashTablePtr attributeSets;
1526
1527
1528
1529
1530
1531 xmlHashTablePtr nsHash;
1532
1533
1534
1535
1536
1537
1538 void *nsDefs;
1539
1540
1541
1542
1543
1544
1545
1546 void *keys;
1547
1548
1549
1550
1551 xmlChar *method;
1552 xmlChar *methodURI;
1553 xmlChar *version;
1554 xmlChar *encoding;
1555 int omitXmlDeclaration;
1556
1557
1558
1559
1560 xsltDecimalFormatPtr decimalFormat;
1561 int standalone;
1562 xmlChar *doctypePublic;
1563 xmlChar *doctypeSystem;
1564 int indent;
1565 xmlChar *mediaType;
1566
1567
1568
1569
1570 xsltElemPreCompPtr preComps;
1571 int warnings;
1572 int errors;
1573
1574 xmlChar *exclPrefix;
1575 xmlChar **exclPrefixTab;
1576 int exclPrefixNr;
1577 int exclPrefixMax;
1578
1579 void *_private;
1580
1581
1582
1583
1584 xmlHashTablePtr extInfos;
1585 int extrasNr;
1586
1587
1588
1589
1590 xsltDocumentPtr includes;
1591
1592
1593
1594
1595 xmlDictPtr dict;
1596
1597
1598
1599 void *attVTs;
1600
1601
1602
1603
1604 const xmlChar *defaultAlias;
1605
1606
1607
1608 int nopreproc;
1609
1610
1611
1612 int internalized;
1613
1614
1615
1616 int literal_result;
1617
1618
1619
1620 xsltStylesheetPtr principal;
1621 #ifdef XSLT_REFACTORED
1622
1623
1624
1625 xsltCompilerCtxtPtr compCtxt;
1626
1627 xsltPrincipalStylesheetDataPtr principalData;
1628 #endif
1629
1630
1631
1632 int forwards_compatible;
1633
1634 xmlHashTablePtr namedTemplates;
1635
1636 xmlXPathContextPtr xpathCtxt;
1637
1638 unsigned long opLimit;
1639 unsigned long opCount;
1640 };
1641
1642 typedef struct _xsltTransformCache xsltTransformCache;
1643 typedef xsltTransformCache *xsltTransformCachePtr;
1644 struct _xsltTransformCache {
1645 xmlDocPtr RVT;
1646 int nbRVT;
1647 xsltStackElemPtr stackItems;
1648 int nbStackItems;
1649 #ifdef XSLT_DEBUG_PROFILE_CACHE
1650 int dbgCachedRVTs;
1651 int dbgReusedRVTs;
1652 int dbgCachedVars;
1653 int dbgReusedVars;
1654 #endif
1655 };
1656
1657
1658
1659
1660 typedef enum {
1661 XSLT_OUTPUT_XML = 0,
1662 XSLT_OUTPUT_HTML,
1663 XSLT_OUTPUT_TEXT
1664 } xsltOutputType;
1665
1666 typedef void *
1667 (*xsltNewLocaleFunc)(const xmlChar *lang, int lowerFirst);
1668 typedef void
1669 (*xsltFreeLocaleFunc)(void *locale);
1670 typedef xmlChar *
1671 (*xsltGenSortKeyFunc)(void *locale, const xmlChar *lang);
1672
1673 typedef enum {
1674 XSLT_STATE_OK = 0,
1675 XSLT_STATE_ERROR,
1676 XSLT_STATE_STOPPED
1677 } xsltTransformState;
1678
1679 struct _xsltTransformContext {
1680 xsltStylesheetPtr style;
1681 xsltOutputType type;
1682
1683 xsltTemplatePtr templ;
1684 int templNr;
1685 int templMax;
1686 xsltTemplatePtr *templTab;
1687
1688 xsltStackElemPtr vars;
1689 int varsNr;
1690 int varsMax;
1691 xsltStackElemPtr *varsTab;
1692 int varsBase;
1693
1694
1695
1696
1697 xmlHashTablePtr extFunctions;
1698 xmlHashTablePtr extElements;
1699 xmlHashTablePtr extInfos;
1700
1701 const xmlChar *mode;
1702 const xmlChar *modeURI;
1703
1704 xsltDocumentPtr docList;
1705
1706 xsltDocumentPtr document;
1707 xmlNodePtr node;
1708 xmlNodeSetPtr nodeList;
1709
1710
1711 xmlDocPtr output;
1712 xmlNodePtr insert;
1713
1714 xmlXPathContextPtr xpathCtxt;
1715 xsltTransformState state;
1716
1717
1718
1719
1720 xmlHashTablePtr globalVars;
1721
1722 xmlNodePtr inst;
1723
1724 int xinclude;
1725
1726 const char * outputFile;
1727
1728 int profile;
1729 long prof;
1730 int profNr;
1731 int profMax;
1732 long *profTab;
1733
1734 void *_private;
1735
1736 int extrasNr;
1737 int extrasMax;
1738 xsltRuntimeExtraPtr extras;
1739
1740 xsltDocumentPtr styleList;
1741 void * sec;
1742
1743 xmlGenericErrorFunc error;
1744 void * errctx;
1745
1746 xsltSortFunc sortfunc;
1747
1748
1749
1750
1751
1752 xmlDocPtr tmpRVT;
1753 xmlDocPtr persistRVT;
1754 int ctxtflags;
1755
1756
1757
1758
1759 const xmlChar *lasttext;
1760 int lasttsize;
1761 int lasttuse;
1762
1763
1764
1765 int debugStatus;
1766 unsigned long* traceCode;
1767
1768 int parserOptions;
1769
1770
1771
1772
1773 xmlDictPtr dict;
1774 xmlDocPtr tmpDoc;
1775
1776
1777
1778 int internalized;
1779 int nbKeys;
1780 int hasTemplKeyPatterns;
1781 xsltTemplatePtr currentTemplateRule;
1782 xmlNodePtr initialContextNode;
1783 xmlDocPtr initialContextDoc;
1784 xsltTransformCachePtr cache;
1785 void *contextVariable;
1786 xmlDocPtr localRVT;
1787
1788
1789 xmlDocPtr localRVTBase;
1790 int keyInitLevel;
1791 int depth;
1792 int maxTemplateDepth;
1793 int maxTemplateVars;
1794 unsigned long opLimit;
1795 unsigned long opCount;
1796 int sourceDocDirty;
1797 unsigned long currentId;
1798
1799 xsltNewLocaleFunc newLocale;
1800 xsltFreeLocaleFunc freeLocale;
1801 xsltGenSortKeyFunc genSortKey;
1802 };
1803
1804
1805
1806
1807
1808
1809
1810 #define CHECK_STOPPED if (ctxt->state == XSLT_STATE_STOPPED) return;
1811
1812
1813
1814
1815
1816
1817
1818 #define CHECK_STOPPEDE if (ctxt->state == XSLT_STATE_STOPPED) goto error;
1819
1820
1821
1822
1823
1824
1825
1826 #define CHECK_STOPPED0 if (ctxt->state == XSLT_STATE_STOPPED) return(0);
1827
1828
1829
1830
1831
1832
1833
1834 #ifndef XML_CAST_FPTR
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848 #define XML_CAST_FPTR(fptr) fptr
1849 #endif
1850
1851
1852
1853
1854
1855 XSLTPUBFUN xsltStylesheetPtr XSLTCALL
1856 xsltNewStylesheet (void);
1857 XSLTPUBFUN xsltStylesheetPtr XSLTCALL
1858 xsltParseStylesheetFile (const xmlChar* filename);
1859 XSLTPUBFUN void XSLTCALL
1860 xsltFreeStylesheet (xsltStylesheetPtr style);
1861 XSLTPUBFUN int XSLTCALL
1862 xsltIsBlank (xmlChar *str);
1863 XSLTPUBFUN void XSLTCALL
1864 xsltFreeStackElemList (xsltStackElemPtr elem);
1865 XSLTPUBFUN xsltDecimalFormatPtr XSLTCALL
1866 xsltDecimalFormatGetByName(xsltStylesheetPtr style,
1867 xmlChar *name);
1868 XSLTPUBFUN xsltDecimalFormatPtr XSLTCALL
1869 xsltDecimalFormatGetByQName(xsltStylesheetPtr style,
1870 const xmlChar *nsUri,
1871 const xmlChar *name);
1872
1873 XSLTPUBFUN xsltStylesheetPtr XSLTCALL
1874 xsltParseStylesheetProcess(xsltStylesheetPtr ret,
1875 xmlDocPtr doc);
1876 XSLTPUBFUN void XSLTCALL
1877 xsltParseStylesheetOutput(xsltStylesheetPtr style,
1878 xmlNodePtr cur);
1879 XSLTPUBFUN xsltStylesheetPtr XSLTCALL
1880 xsltParseStylesheetDoc (xmlDocPtr doc);
1881 XSLTPUBFUN xsltStylesheetPtr XSLTCALL
1882 xsltParseStylesheetImportedDoc(xmlDocPtr doc,
1883 xsltStylesheetPtr style);
1884 XSLTPUBFUN int XSLTCALL
1885 xsltParseStylesheetUser(xsltStylesheetPtr style,
1886 xmlDocPtr doc);
1887 XSLTPUBFUN xsltStylesheetPtr XSLTCALL
1888 xsltLoadStylesheetPI (xmlDocPtr doc);
1889 XSLTPUBFUN void XSLTCALL
1890 xsltNumberFormat (xsltTransformContextPtr ctxt,
1891 xsltNumberDataPtr data,
1892 xmlNodePtr node);
1893 XSLTPUBFUN xmlXPathError XSLTCALL
1894 xsltFormatNumberConversion(xsltDecimalFormatPtr self,
1895 xmlChar *format,
1896 double number,
1897 xmlChar **result);
1898
1899 XSLTPUBFUN void XSLTCALL
1900 xsltParseTemplateContent(xsltStylesheetPtr style,
1901 xmlNodePtr templ);
1902 XSLTPUBFUN int XSLTCALL
1903 xsltAllocateExtra (xsltStylesheetPtr style);
1904 XSLTPUBFUN int XSLTCALL
1905 xsltAllocateExtraCtxt (xsltTransformContextPtr ctxt);
1906
1907
1908
1909 XSLTPUBFUN xmlDocPtr XSLTCALL
1910 xsltCreateRVT (xsltTransformContextPtr ctxt);
1911 XSLTPUBFUN int XSLTCALL
1912 xsltRegisterTmpRVT (xsltTransformContextPtr ctxt,
1913 xmlDocPtr RVT);
1914 XSLTPUBFUN int XSLTCALL
1915 xsltRegisterLocalRVT (xsltTransformContextPtr ctxt,
1916 xmlDocPtr RVT);
1917 XSLTPUBFUN int XSLTCALL
1918 xsltRegisterPersistRVT (xsltTransformContextPtr ctxt,
1919 xmlDocPtr RVT);
1920 XSLTPUBFUN int XSLTCALL
1921 xsltExtensionInstructionResultRegister(
1922 xsltTransformContextPtr ctxt,
1923 xmlXPathObjectPtr obj);
1924 XSLTPUBFUN int XSLTCALL
1925 xsltExtensionInstructionResultFinalize(
1926 xsltTransformContextPtr ctxt);
1927 XSLTPUBFUN int XSLTCALL
1928 xsltFlagRVTs(
1929 xsltTransformContextPtr ctxt,
1930 xmlXPathObjectPtr obj,
1931 int val);
1932 XSLTPUBFUN void XSLTCALL
1933 xsltFreeRVTs (xsltTransformContextPtr ctxt);
1934 XSLTPUBFUN void XSLTCALL
1935 xsltReleaseRVT (xsltTransformContextPtr ctxt,
1936 xmlDocPtr RVT);
1937
1938
1939
1940 XSLTPUBFUN void XSLTCALL
1941 xsltCompileAttr (xsltStylesheetPtr style,
1942 xmlAttrPtr attr);
1943 XSLTPUBFUN xmlChar * XSLTCALL
1944 xsltEvalAVT (xsltTransformContextPtr ctxt,
1945 void *avt,
1946 xmlNodePtr node);
1947 XSLTPUBFUN void XSLTCALL
1948 xsltFreeAVTList (void *avt);
1949
1950
1951
1952
1953
1954 XSLTPUBFUN void XSLTCALL
1955 xsltUninit (void);
1956
1957
1958
1959
1960
1961
1962
1963 #ifdef XSLT_REFACTORED
1964 XSLTPUBFUN void XSLTCALL
1965 xsltParseSequenceConstructor(
1966 xsltCompilerCtxtPtr cctxt,
1967 xmlNodePtr start);
1968 XSLTPUBFUN int XSLTCALL
1969 xsltParseAnyXSLTElem (xsltCompilerCtxtPtr cctxt,
1970 xmlNodePtr elem);
1971 #ifdef XSLT_REFACTORED_XSLT_NSCOMP
1972 XSLTPUBFUN int XSLTCALL
1973 xsltRestoreDocumentNamespaces(
1974 xsltNsMapPtr ns,
1975 xmlDocPtr doc);
1976 #endif
1977 #endif
1978
1979
1980
1981
1982
1983
1984 XSLTPUBFUN int XSLTCALL
1985 xsltInitCtxtKey (xsltTransformContextPtr ctxt,
1986 xsltDocumentPtr doc,
1987 xsltKeyDefPtr keyd);
1988 XSLTPUBFUN int XSLTCALL
1989 xsltInitAllDocKeys (xsltTransformContextPtr ctxt);
1990 #ifdef __cplusplus
1991 }
1992 #endif
1993
1994 #endif
1995