dbertoni    2003/03/27 16:04:51

  Modified:    c/src/XSLT FunctionDocument.cpp FunctionDocument.hpp
  Log:
  Fix for XSLT erratum E14.
  
  Revision  Changes    Path
  1.33      +21 -14    xml-xalan/c/src/XSLT/FunctionDocument.cpp
  
  Index: FunctionDocument.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionDocument.cpp,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- FunctionDocument.cpp      25 Nov 2002 18:11:52 -0000      1.32
  +++ FunctionDocument.cpp      28 Mar 2003 00:04:51 -0000      1.33
  @@ -261,6 +261,8 @@
   
        XalanDOMString  base;
   
  +     bool                    fNoRelativeURI = false;
  +
        if (context == 0)
        {
                executionContext.error(
  @@ -285,12 +287,9 @@
   
                        if (nodeset.getLength() == 0)
                        {
  -                             executionContext.warn("Ignoring the empty 
node-set provided as the second argument to the function document()",
  -                                                                       
context);
  -
  -                             assert(executionContext.getPrefixResolver() != 
0);
  -
  -                             base = 
executionContext.getPrefixResolver()->getURI();
  +                             // The errata require that we refuse to resolve 
a relative URI if
  +                             // an empty node-set is provided as the second 
argument.
  +                             fNoRelativeURI = true;
                        }
                        else
                        {
  @@ -310,19 +309,20 @@
                }
        }
   
  -     return doExecute(executionContext, context, arg1, &base, 2, locator);
  +     return doExecute(executionContext, context, arg1, &base, 2, locator, 
fNoRelativeURI);
   }
   
   
   
   XObjectPtr
   FunctionDocument::doExecute(
  -                     XPathExecutionContext&                  
executionContext,
  -                     XalanNode*                                              
context,
  -                     const XObjectPtr                                arg,
  -                     XalanDOMString*                                 base,
  -                     int                                                     
        argCount,
  -                     const LocatorType*                              
locator) const
  +                     XPathExecutionContext&  executionContext,
  +                     XalanNode*                              context,
  +                     const XObjectPtr&               arg,
  +                     XalanDOMString*                 base,
  +                     int                                             
argCount,
  +                     const LocatorType*              locator,
  +                     bool                                    fNoRelativeURI) 
const
   {
        typedef XPathExecutionContext::BorrowReturnMutableNodeRefList   
BorrowReturnMutableNodeRefList;
   
  @@ -401,7 +401,14 @@
                        {
                                // The ref is relative.  If there was a base URI
                                // provided, use that...
  -                             if (base != 0)
  +                             if (fNoRelativeURI == true)
  +                             {
  +                                     executionContext.warn(
  +                                             "Cannot resolve a relative URI 
when the node-set provided as the second argument to the function document() is 
empty",
  +                                             context,
  +                                             locator);
  +                             }
  +                             else if (base != 0)
                                {
                                        getDoc(executionContext, ref, *base, 
mnl, context, locator);
                                }
  
  
  
  1.11      +3 -2      xml-xalan/c/src/XSLT/FunctionDocument.hpp
  
  Index: FunctionDocument.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XSLT/FunctionDocument.hpp,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- FunctionDocument.hpp      13 Feb 2003 02:44:45 -0000      1.10
  +++ FunctionDocument.hpp      28 Mar 2003 00:04:51 -0000      1.11
  @@ -124,10 +124,11 @@
        doExecute(
                        XPathExecutionContext&  executionContext,
                        XalanNode*                              context,        
                
  -                     const XObjectPtr                arg,
  +                     const XObjectPtr&               arg,
                        XalanDOMString*                 base,
                        int                                             
argCount,
  -                     const LocatorType*              locator) const;
  +                     const LocatorType*              locator,
  +                     bool                                    fNoRelativeURI 
= false) const;
   
        // Not implemented...
        FunctionDocument&
  
  
  

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

Reply via email to