dbertoni    01/08/27 07:54:24

  Modified:    c/src/XalanTransformer XalanTransformer.cpp
  Log:
  Make sure system IDs are set on all input sources.  Load extension functions 
by default.
  
  Revision  Changes    Path
  1.31      +56 -8     xml-xalan/c/src/XalanTransformer/XalanTransformer.cpp
  
  Index: XalanTransformer.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XalanTransformer/XalanTransformer.cpp,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- XalanTransformer.cpp      2001/08/21 23:02:59     1.30
  +++ XalanTransformer.cpp      2001/08/27 14:54:24     1.31
  @@ -96,6 +96,10 @@
   
   
   
  +#include <XalanExtensions/XalanExtensions.hpp>
  +
  +
  +
   //#define XALAN_USE_ICU
   #if defined(XALAN_USE_ICU)
   #include <ICUBridge/ICUBridge.hpp>
  @@ -170,6 +174,38 @@
        // Initialize Xalan. 
        s_xsltInit = new XSLTInit;
   
  +     const XalanDOMString    
theXalanNamespace(StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("http://xml.apache.org/xalan";)));
  +
  +     XalanTransformer::installExternalFunctionGlobal(
  +                     theXalanNamespace,
  +                     
StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("difference")),
  +                     FunctionDifference());
  +
  +     XalanTransformer::installExternalFunctionGlobal(
  +                     theXalanNamespace,
  +                     
StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("distinct")),
  +                     FunctionDistinct());
  +
  +     XalanTransformer::installExternalFunctionGlobal(
  +                     theXalanNamespace,
  +                     
StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("evaluate")),
  +                     FunctionEvaluate());
  +
  +     XalanTransformer::installExternalFunctionGlobal(
  +                     theXalanNamespace,
  +                     
StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("hasSameNodes")),
  +                     FunctionHasSameNodes());
  +
  +     XalanTransformer::installExternalFunctionGlobal(
  +                     theXalanNamespace,
  +                     
StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("intersection")),
  +                     FunctionIntersection());
  +
  +     XalanTransformer::installExternalFunctionGlobal(
  +                     theXalanNamespace,
  +                     
StaticStringToDOMString(XALAN_STATIC_UCODE_STRING("nodeset")),
  +                     FunctionNodeSet());
  +
   #if defined(XALAN_USE_ICU)
        theICUFunctor = new ICUBridgeCollationCompareFunctor;
   
  @@ -255,11 +291,11 @@
   
                theXSLTProcessorEnvSupport.setProcessor(&theProcessor);
   
  -             const XalanDOMString&   theURI = theParsedXML.getURI();
  +             const XalanDOMString&   theSourceURI = theParsedXML.getURI();
   
  -             if (length(theURI) > 0)
  +             if (length(theSourceURI) > 0)
                {
  -                     theXSLTProcessorEnvSupport.setSourceDocument(theURI, 
theSourceDocument);
  +                     
theXSLTProcessorEnvSupport.setSourceDocument(theSourceURI, theSourceDocument);
                }
   
                // Create a problem listener and send output to a 
XalanDOMString.
  @@ -309,9 +345,15 @@
                                        *(m_functionPairs[f].second));
                }
   
  +             // Create an input source for the source document...
  +             XSLTInputSource         
theDocumentInputSource(theSourceDocument);
  +
  +             // Set the system ID, so relative URIs are resolved properly...
  +             theDocumentInputSource.setSystemId(c_wstr(theSourceURI));
  +
                // Do the transformation...
                theProcessor.process(
  -                                     theSourceDocument,
  +                                     theDocumentInputSource,
                                        theStylesheetSource,
                                        tempResultTarget,
                                        theStylesheetConstructionContext,
  @@ -428,11 +470,11 @@
   
                theXSLTProcessorEnvSupport.setProcessor(&theProcessor);
   
  -             const XalanDOMString&   theURI = theParsedXML.getURI();
  +             const XalanDOMString&   theSourceURI = theParsedXML.getURI();
   
  -             if (length(theURI) > 0)
  +             if (length(theSourceURI) > 0)
                {
  -                     theXSLTProcessorEnvSupport.setSourceDocument(theURI, 
theSourceDocument);
  +                     
theXSLTProcessorEnvSupport.setSourceDocument(theSourceURI, theSourceDocument);
                }
   
                // Create a problem listener and send output to a 
XalanDOMString.
  @@ -478,9 +520,15 @@
                                        *(m_functionPairs[f].second));
                }
   
  +             // Create an input source for the source document...
  +             XSLTInputSource         
theDocumentInputSource(theSourceDocument);
  +
  +             // Set the system ID, so relative URIs are resolved properly...
  +             theDocumentInputSource.setSystemId(c_wstr(theSourceURI));
  +
                // Do the transformation...
                theProcessor.process(
  -                                     theSourceDocument,
  +                                     theDocumentInputSource,
                                        tempResultTarget,                       
                
                                        *m_stylesheetExecutionContext);
        }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to