You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by dl...@apache.org on 2001/06/05 16:41:31 UTC

cvs commit: xml-xalan/java/samples/servlet ApplyXSLT.java

dleslie     01/06/05 07:41:31

  Modified:    java/samples/servlet ApplyXSLT.java
  Log:
  Enabled servlet to sometimes use a default Tem0lates object
  and sometimes use (in the same sessions) an embedded
  stylesheet PI.
  
  Revision  Changes    Path
  1.18      +12 -10    xml-xalan/java/samples/servlet/ApplyXSLT.java
  
  Index: ApplyXSLT.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/samples/servlet/ApplyXSLT.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- ApplyXSLT.java	2001/04/24 13:16:56	1.17
  +++ ApplyXSLT.java	2001/06/05 14:41:30	1.18
  @@ -550,22 +550,24 @@
         String xslURL = ((DefaultApplyXSLTProperties) ourDefaultParameters).getXSLRequestURL(request);
   
         if (xslURL != null)
  +      {
           listener.out.println("Parsing XSL Stylesheet Document from request parameter: "
                                + xslURL);
  +        useDefaultTemplates = false;
  +      }
         else 
         {
           // find stylesheet from XML Document, Media tag preference
  -        if (!useDefaultTemplates)
  +        SAXTransformerFactory stf = (SAXTransformerFactory)tFactory;
  +        Source styleSource =
  +               stf.getAssociatedStylesheet(xmlSource,getMedia(request), null, null);
  +        if (styleSource != null)
           {
  -          SAXTransformerFactory stf = (SAXTransformerFactory)tFactory;
  -          Source styleSource =
  -                stf.getAssociatedStylesheet(xmlSource,getMedia(request), null, null);
  -          if (styleSource != null)
  -          {
  -            listener.out.println("Parsing XSL Stylesheet from XML document stylesheet PI.");
  -            return styleSource;
  -          }
  -        }      
  +          listener.out.println("Parsing XSL Stylesheet from XML document stylesheet PI.");
  +          useDefaultTemplates = false;
  +          return styleSource;
  +        }
  +        
           // Configuration Default
           if ((xslURL = ourDefaultParameters.getXSLurl(null)) != null)
           {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org