morten      01/09/18 01:25:34

  Modified:    java/src/org/apache/xalan/xsltc/compiler Parser.java
  Log:
  Added test in the method that handles stylesheet PIs in embedded stylesheets.
  This method did not properly test for the existence of stylesheets referenced
  in these PIs (ref. Sun's test embed09).
  PR:           n/a
  Obtained from:        n/a
  Submitted by: [EMAIL PROTECTED]
  Reviewed by:  [EMAIL PROTECTED]
  
  Revision  Changes    Path
  1.25      +5 -1      
xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java
  
  Index: Parser.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- Parser.java       2001/08/17 13:17:44     1.24
  +++ Parser.java       2001/09/18 08:25:34     1.25
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: Parser.java,v 1.24 2001/08/17 13:17:44 morten Exp $
  + * @(#)$Id: Parser.java,v 1.25 2001/09/18 08:25:34 morten Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -133,6 +133,8 @@
       private final static String MISSING_XSLT_URI_ERROR =
        "The input document is not a stylesheet "+
        "(the XSL namespace is not declared in the root element).";
  +    private final static String MISSING_XSLT_TARGET_ERROR =
  +     "Could not find stylesheet target ";
   
       public Parser(XSLTC xsltc) {
        _xsltc = xsltc;
  @@ -466,6 +468,8 @@
        // Find the xsl:stylesheet or xsl:transform with this reference
        if (_target.charAt(0) == '#') {
            SyntaxTreeNode element = findStylesheet(root, _target.substring(1));
  +         if (element == null)
  +             throw new CompilerException(MISSING_XSLT_TARGET_ERROR+_target);
            return(element);
        }
        else {
  
  
  

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

Reply via email to