This file is indexed.

/usr/include/xalanc/XSLT/StylesheetConstructionContextDefault.hpp is in libxalan-c-dev 1.11-3.

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
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership. The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the  "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#if !defined(STYLESHEETCONSTRUCTIONCONTEXTDEFAULT_HEADER_GUARD_1357924680)
#define STYLESHEETCONSTRUCTIONCONTEXTDEFAULT_HEADER_GUARD_1357924680



// Base include file.  Must be first.
#include <xalanc/XSLT/XSLTDefinitions.hpp>



#include <xalanc/Include/XalanVector.hpp>



#include <xalanc/PlatformSupport/ArenaAllocator.hpp>
#include <xalanc/PlatformSupport/XalanArrayAllocator.hpp>
#include <xalanc/PlatformSupport/XalanDOMStringPool.hpp>



#if defined(XALAN_AUTO_PTR_REQUIRES_DEFINITION) || defined(XALAN_BUILD_DLL)
#include <xalanc/XPath/XPathProcessor.hpp>
#endif



#include <xalanc/Include/XalanMemMgrAutoPtr.hpp>



#include <xalanc/PlatformSupport/XalanDOMStringCache.hpp>



#include <xalanc/XPath/XalanQNameByReference.hpp>
#include <xalanc/XPath/XalanQNameByValue.hpp>
#include <xalanc/XPath/XalanQNameByValueAllocator.hpp>



// Base class header file...
#include <xalanc/XSLT/StylesheetConstructionContext.hpp>



#include <xalanc/XSLT/AVT.hpp>
#include <xalanc/XSLT/XalanAVTAllocator.hpp>
#include <xalanc/XSLT/AVTPartSimple.hpp>
#include <xalanc/XSLT/XalanAVTPartSimpleAllocator.hpp>
#include <xalanc/XSLT/AVTPartXPath.hpp>
#include <xalanc/XSLT/XalanAVTPartXPathAllocator.hpp>
#include <xalanc/XSLT/XalanElemApplyTemplatesAllocator.hpp>
#include <xalanc/XSLT/XalanElemAttributeAllocator.hpp>
#include <xalanc/XSLT/XalanElemAttributeSetAllocator.hpp>
#include <xalanc/XSLT/XalanElemCallTemplateAllocator.hpp>
#include <xalanc/XSLT/XalanElemElementAllocator.hpp>
#include <xalanc/XSLT/XalanElemLiteralResultAllocator.hpp>
#include <xalanc/XSLT/XalanElemTemplateAllocator.hpp>
#include <xalanc/XSLT/XalanElemTextLiteralAllocator.hpp>
#include <xalanc/XSLT/XalanElemValueOfAllocator.hpp>
#include <xalanc/XSLT/XalanElemVariableAllocator.hpp>
#include "xalanc/XSLT/XalanMatchPatternDataAllocator.hpp"



XALAN_CPP_NAMESPACE_BEGIN



class XPathEnvSupport;
class XPathFactory;
class XPathProcessor;
class XSLTEngineImpl;



/**
 *
 * An default implementation of an abtract class which provides support for
 * constructing the internal representation  of a stylesheet.
 *
 */
class XALAN_XSLT_EXPORT StylesheetConstructionContextDefault : public StylesheetConstructionContext
{
public:

    typedef XalanArrayAllocator<XalanDOMChar>           XalanDOMCharVectorAllocatorType;
    typedef XalanArrayAllocator<const void*>            PointerVectorAllocatorType;
    typedef XalanDOMCharVectorAllocatorType::size_type  VectorAllocatorSizeType;

    // Default size for vector allocation.
    enum {
            eDefaultXalanDOMCharVectorBlockSize = 1024,
            eDefaultAVTBlockSize = 128,
            eDefaultAVTPartSimpleBlockSize = 128,
            eDefaultAVTPartXPathBlockSize = 128,
            eDefaultXalanQNameByValueBlockSize = 32,
            eDefaultPointerVectorBlockSize = 512,
            eDefaultElemApplyTemplatesBlockSize = 10,
            eDefaultElemAttributeBlockSize = 10,
            eDefaultElemAttributeSetBlockSize = 10,
            eDefaultElemCallTemplateBlockSize = 10,
            eDefaultElemElementBlockSize = 10,
            eDefaultElemLiteralResultBlockSize = 20,
            eDefaultElemTemplateBlockSize = 10,
            eDefaultElemTextLiteralBlockSize = 20,
            eDefaultElemValueOfBlockSize = 10,
            eDefaultElemVariableBlockSize = 10,
            eDefaultMatchPatternDataBlockSize = 10 };

    /*
     * Construct an instance.  If the stylesheet(s) constructed is/are meant to be reused (a.k.a. "compiled"),
     * the XObjectFactory and XPathFactory instance must exist for the lifetime of the construction context
     * and, therefore, for the lifetime of the stylesheet(s).  Otherwise, XObject and XPath instance will be
     * destroyed when the corresponding factories are destryed, leaving pointers to destroyed objects in the.
     * stylesheet(s).
     *
     * @param processor a reference to an XSLTEngineImpl instance.  Used for error reporting.
     * @param xpathFactory a reference to an XPathFactory instance.  See comments above for important details.
     * @param theXalanDOMCharVectorAllocatorBlockSize The block size to use for allocating vectors of XalanDOMChars
     * @param theAVTAllocatorBlockSize The block size to use for allocating AVT instances.
     * @param theAVTPartSimpleAllocatorBlockSize The block size to use for allocating AVTPartSimple instances.
     * @param theAVTPartXPathAllocatorBlockSize The block size to use for allocating AVTPartXPath instances.
     * @param theXalanQNameByValueAllocatorBlockSize The block size to use for allocating XalanQNameByValue instances.
     * @param thePointerVectorAllocatorBlockSize The block size to use for allocating vectors of pointers.
     */
    StylesheetConstructionContextDefault(
            MemoryManager&                      theManager,
            XSLTEngineImpl&                         processor,
            XPathFactory&                           xpathFactory,
            VectorAllocatorSizeType                 theXalanDOMCharVectorAllocatorBlockSize = eDefaultXalanDOMCharVectorBlockSize,
            XalanAVTAllocator::size_type            theAVTAllocatorBlockSize = eDefaultAVTBlockSize,
            XalanAVTPartSimpleAllocator::size_type  theAVTPartSimpleAllocatorBlockSize = eDefaultAVTPartSimpleBlockSize,
            XalanAVTPartXPathAllocator::size_type   theAVTPartXPathAllocatorBlockSize = eDefaultAVTPartXPathBlockSize,
            XalanQNameByValueAllocator::size_type   theXalanQNameByValueAllocatorBlockSize = eDefaultXalanQNameByValueBlockSize,
            VectorAllocatorSizeType                 thePointerVectorAllocatorBlockSize = eDefaultPointerVectorBlockSize);

    virtual
    ~StylesheetConstructionContextDefault();


    // These interfaces are inherited from StylesheetConstructionContext...

    virtual void
    problem(
            eSource                 source,
            eClassification         classification,
            const XalanDOMString&   msg,
            const Locator*          locator,
            const XalanNode*        sourceNode);

    virtual void
    problem(
            eSource                 source,
            eClassification         classification,
            const XalanDOMString&   msg,
            const XalanNode*        sourceNode);

    virtual void
    reset();

    virtual const XalanDOMString&
    getPooledString(const XalanDOMString&   theString);

    virtual const XalanDOMString&
    getPooledString(
            const XalanDOMChar*         theString,
            XalanDOMString::size_type   theLength = XalanDOMString::npos);

    virtual XalanDOMString&
    getCachedString();

    virtual bool
    releaseCachedString(XalanDOMString&     theString);

    virtual StylesheetRoot*
    create(const XalanDOMString&    theBaseIdentifier);

    virtual StylesheetRoot*
    create(const XSLTInputSource&   theInputSource);

    virtual Stylesheet*
    create(
            StylesheetRoot&         theStylesheetRoot,
            const XalanDOMString&   theBaseIdentifier);

    virtual void
    destroy(StylesheetRoot*     theStylesheetRoot);

    virtual URLAutoPtrType
    getURLFromString(const XalanDOMString&  urlString);

    virtual XalanDOMString&
    getURLStringFromString(
            const XalanDOMString&   urlString,
            XalanDOMString&         theResult);

    virtual URLAutoPtrType
    getURLFromString(
            const XalanDOMString&   urlString,
            const XalanDOMString&   base);

    virtual XalanDOMString&
    getURLStringFromString(
            const XalanDOMString&   urlString,
            const XalanDOMString&   base,
            XalanDOMString& theResult);

    virtual const XalanDOMString&
    getXSLTNamespaceURI() const;

    virtual XPath*
    createMatchPattern(
            const Locator*          locator,
            const XalanDOMString&   str,
            const PrefixResolver&   resolver,
            bool                    allowVariableReferences = true,
            bool                    allowKeyFunction = true);

    virtual XPath*
    createMatchPattern(
            const Locator*          locator,
            const XalanDOMChar*     str,
            const PrefixResolver&   resolver,
            bool                    allowVariableReferences = true,
            bool                    allowKeyFunction = true);

    virtual XPath*
    createXPath(
            const Locator*          locator,
            const XalanDOMString&   str,
            const PrefixResolver&   resolver,
            bool                    allowVariableReferences = true,
            bool                    allowKeyFunction = true);

    virtual XPath*
    createXPath(
            const Locator*          locator,
            const XalanDOMChar*     str,
            const PrefixResolver&   resolver,
            bool                    allowVariableReferences = true,
            bool                    allowKeyFunction = true);

    virtual XPath*
    createXPath(
            const Locator*              locator,
            const XalanDOMChar*         str,
            XalanDOMString::size_type   len,
            const PrefixResolver&       resolver,
            bool                        allowVariableReferences = true,
            bool                        allowKeyFunction = true);

    virtual const Locator*
    getLocatorFromStack() const;

    virtual void
    pushLocatorOnStack(const Locator*   locator);

    virtual void
    popLocatorStack();

    virtual const XalanDOMString&
    getXalanXSLNameSpaceURL() const;

    virtual XalanDocument*
    parseXML(
            const XalanDOMString&   urlString,
            DocumentHandler*        docHandler, 
            XalanDocument*          docToRegister,
            ErrorHandler*           theErrorHandler = 0);

    virtual bool
    isXMLSpaceAttribute(
            const XalanDOMChar*     theAttributeName,
            const Stylesheet&       theStylesheet,
            const Locator*          theLocator = 0);

    virtual bool
    isXSLUseAttributeSetsAttribute(
            const XalanDOMChar*     theAttributeName,
            const Stylesheet&       theStylesheet,
            const Locator*          theLocator = 0);

    virtual bool
    isValidQName(
            const XalanDOMChar*     theName,
            const Stylesheet&       theStylesheet,
            const Locator*          theLocator = 0);

    virtual eElementToken
    getElementToken(const XalanDOMString&   name) const;

    virtual double
    getXSLTVersionSupported() const;

    virtual XalanDOMChar*
    allocateXalanDOMCharVector(XalanDOMString::size_type    theLength);

    virtual XalanDOMChar*
    allocateXalanDOMCharVector(
            const XalanDOMChar*         theString,
            XalanDOMString::size_type   theLength = XalanDOMString::npos,
            bool                        fTerminate = true);

    virtual const AVT*
    createAVT(
            const Locator*          locator,
            const XalanDOMChar*     name,
            const XalanDOMChar*     stringedValue,
            const PrefixResolver&   resolver);

    virtual const AVTPart*
    createAVTPart(
            const XalanDOMChar*         theString,
            XalanDOMString::size_type   theLength = XalanDOMString::npos);

    virtual const AVTPart*
    createAVTPart(
            const Locator*              locator,
            const XalanDOMChar*         str,
            XalanDOMString::size_type   len,
            const PrefixResolver&       resolver);

    virtual const AVT**
    allocateAVTPointerVector(size_type  theLength);

    virtual const AVTPart**
    allocateAVTPartPointerVector(size_type  theLength);

    virtual const XalanQName*
    createXalanQName(
            const XalanDOMString&       qname,
            const NamespacesStackType&  namespaces,
            const Locator*              locator = 0,
            bool                        fUseDefault = false);

    virtual const XalanQName*
    createXalanQName(
            const XalanDOMChar*         qname,
            const NamespacesStackType&  namespaces,
            const Locator*              locator = 0,
            bool                        fUseDefault = false);

    virtual const XalanQName**
    tokenizeQNames(
            size_type&                  count,
            const XalanDOMChar*         qnameTokens,
            const NamespacesStackType&  namespaces,
            const Locator*              locator = 0,
            bool                        fUseDefault = false);

    virtual ElemTemplateElement*
    createElement(
            int                         token,
            Stylesheet&                 stylesheetTree,
            const AttributeListType&    atts,
            const Locator*              locator = 0);

    virtual ElemTemplateElement*
    createElement(
            int                         token,
            Stylesheet&                 stylesheetTree,
            const XalanDOMChar*         name,
            const AttributeListType&    atts,
            const Locator*              locator = 0);

    virtual ElemTemplateElement*
    createElement(
            Stylesheet&                 stylesheetTree,
            const XalanDOMChar*         chars,
            XalanDOMString::size_type   length,
            bool                        preserveSpace,
            bool                        disableOutputEscaping,
            const Locator*              locator = 0);

    virtual ElemTemplateElement*
    createElement(
            Stylesheet&                 stylesheetTree,
            const XalanDOMChar*         name,
            const AttributeListType&    atts,
            ExtensionNSHandler&         handler,
            const Locator*              locator = 0);

    virtual const XalanMatchPatternData*
    createXalanMatchPatternData(
            const ElemTemplate&     theTemplate,
            size_type               thePosition,
            const XalanDOMString&   theTargetString,
            const XPath&            theMatchPattern,
            const XalanDOMString&   thePatternString,
            XPath::eMatchScore      thePriority);

    static eElementToken
    getElementNameToken(const XalanDOMString&   name);

    typedef XalanVector<StylesheetRoot*>            StylesheetVectorType;
    typedef XalanVector<ElemTemplateElement*>   ElemTemplateElementVectorType;

private:

    const AVT**
    doAllocateAVTPointerVector(size_type    theSize)
    {
        assert(sizeof(AVT**) == sizeof(PointerVectorAllocatorType::value_type));

        return reinterpret_cast<const AVT**>(m_pointerVectorAllocator.allocate(theSize));
    }

    const AVTPart**
    doAllocateAVTPartPointerVector(size_type    theSize)
    {
        assert(sizeof(AVTPart**) == sizeof(PointerVectorAllocatorType::value_type));

        return reinterpret_cast<const AVTPart**>(m_pointerVectorAllocator.allocate(theSize));
    }

    const XalanQName**
    doAllocateXalanQNamePointerVector(size_type theSize)
    {
        assert(sizeof(XalanQName**) == sizeof(PointerVectorAllocatorType::value_type));

        return reinterpret_cast<const XalanQName**>(m_pointerVectorAllocator.allocate(theSize));
    }


    XSLTEngineImpl&                         m_processor;

    XPathFactory&                           m_xpathFactory;

    typedef XalanMemMgrAutoPtr<XPathProcessor>  XPathProcessAutoPtr;

    XPathProcessAutoPtr                     m_xpathProcessor;

    StylesheetVectorType                    m_stylesheets;

    XalanDOMStringPool                      m_stringPool;

    XalanDOMCharVectorAllocatorType         m_xalanDOMCharVectorAllocator;

    mutable XalanDOMString                  m_tempBuffer;

    XalanQNameByValue                       m_scratchQName;

    XalanDOMStringCache                     m_stringCache;

    XalanAVTAllocator                       m_avtAllocator;

    XalanAVTPartSimpleAllocator             m_avtPartSimpleAllocator;

    XalanAVTPartXPathAllocator              m_avtPartXPathAllocator;

    XalanQNameByValueAllocator              m_xalanQNameByValueAllocator;

    const XalanQNameByReference             m_useAttributeSetsQName;

    PointerVectorAllocatorType              m_pointerVectorAllocator;

    ElemTemplateElementVectorType           m_allocatedElements;

    XalanElemApplyTemplatesAllocator        m_elemApplyTemplatesAllocator;

    XalanElemAttributeAllocator             m_elemAttributeAllocator;

    XalanElemAttributeSetAllocator          m_elemAttributeSetAllocator;

    XalanElemCallTemplateAllocator          m_elemCallTemplateAllocator;

    XalanElemElementAllocator               m_elemElementAllocator;

    XalanElemLiteralResultAllocator         m_elemLiteralResultAllocator;

    XalanElemTemplateAllocator              m_elemTemplateAllocator;

    XalanElemTextLiteralAllocator           m_elemTextLiteralAllocator;

    XalanElemValueOfAllocator               m_elemValueOfAllocator;

    XalanElemVariableAllocator              m_elemVariableAllocator;

    XalanMatchPatternDataAllocator          m_matchPatternDataAllocator;

    const XalanQNameByReference             m_spaceAttrQName;

    // Static strings for stylesheet compilation...

    // The string "if"
    static const XalanDOMChar   s_if[];

    // The string "key"
    static const XalanDOMChar   s_key[];

    // The string "copy"
    static const XalanDOMChar   s_copy[];

    // The string "sort"
    static const XalanDOMChar   s_sort[];

    // The string "text"
    static const XalanDOMChar   s_text[];

    // The string "when"
    static const XalanDOMChar   s_when[];

    // The string "empty"
    static const XalanDOMChar   s_empty[];

    // The string "param"
    static const XalanDOMChar   s_param[];

    // The string "choose"
    static const XalanDOMChar   s_choose[];

    // The string "import"
    static const XalanDOMChar   s_import[];

    // The string "number"
    static const XalanDOMChar   s_number[];

    // The string "output"
    static const XalanDOMChar   s_output[];

    // The string "comment"
    static const XalanDOMChar   s_comment[];

    // The string "copy-of"
    static const XalanDOMChar   s_copyOf[];

    // The string "element"
    static const XalanDOMChar   s_element[];

    // The string "include"
    static const XalanDOMChar   s_include[];

    // The string "message"
    static const XalanDOMChar   s_message[];

    // The string "fallback"
    static const XalanDOMChar   s_fallback[];

    // The string "for-each"
    static const XalanDOMChar   s_forEach[];

    // The string "template"
    static const XalanDOMChar   s_template[];

    // The string "value-of"
    static const XalanDOMChar   s_valueOf[];

    // The string "variable"
    static const XalanDOMChar   s_variable[];

    // The string "attribute"
    static const XalanDOMChar   s_attribute[];

    // The string "otherwise"
    static const XalanDOMChar   s_otherwise[];

    // The string "transform"
    static const XalanDOMChar   s_transform[];

    // The string "stylesheet"
    static const XalanDOMChar   s_stylesheet[];

    // The string "with-param"
    static const XalanDOMChar   s_withParam[];

    // The string "strip-space"
    static const XalanDOMChar   s_stripSpace[];

    // The string "apply-imports"
    static const XalanDOMChar   s_applyImports[];

    // The string "attribute-set"
    static const XalanDOMChar   s_attributeSet[];

    // The string "call-template"
    static const XalanDOMChar   s_callTemplate[];

    // The string "decimal-format"
    static const XalanDOMChar   s_decimalFormat[];

    // The string "preserve-space"
    static const XalanDOMChar   s_preserveSpace[];

    // The string "apply-templates"
    static const XalanDOMChar   s_applyTemplates[];

    // The string "namespace-alias"
    static const XalanDOMChar   s_namespaceAlias[];

    // The string "processing-instruction"
    static const XalanDOMChar   s_processingInstruction[];

    // A struct for an array that maps stylesheet element names
    // to int tokens.
    struct ElementTokenTableEntry
    {
        const XalanDOMChar*     m_name;

        eElementToken           m_token;
    };

    static const ElementTokenTableEntry     s_elementTokenTable[];

    static const XalanSize_t                s_elementTokenTableSize;

    static const ElementTokenTableEntry&    s_elementTokenTableLast;

    static const ElementTokenTableEntry&    s_elementTokenTableDummy;
};



XALAN_CPP_NAMESPACE_END



#endif  // STYLESHEETCONSTRUCTIONCONTEXTDEFAULT_HEADER_GUARD_1357924680