You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by zo...@apache.org on 2003/09/09 19:18:20 UTC

cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util ErrorMessages.java ErrorMsg.java

zongaro     2003/09/09 10:18:20

  Modified:    java/xdocs/sources/xalan commandline_xsltc.xml faq.xml
                        xsltc_usage.xml
               java/src/org/apache/xalan/xsltc/compiler/util
                        ErrorMessages.java ErrorMsg.java
  Log:
  Updated documentation to describe behaviour of XSLTC when the translet name
  specified by the user contains characters that are not permitted as part of a
  Java class name.
  
  Reviewed by Sarah McNamara (mcnamara@ca.ibm.com).
  
  Revision  Changes    Path
  1.8       +9 -0      xml-xalan/java/xdocs/sources/xalan/commandline_xsltc.xml
  
  Index: commandline_xsltc.xml
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan/commandline_xsltc.xml,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- commandline_xsltc.xml	10 Apr 2003 14:34:58 -0000	1.7
  +++ commandline_xsltc.xml	9 Sep 2003 17:18:20 -0000	1.8
  @@ -107,6 +107,15 @@
     <li><code>-XT</code><br/>
     Use translet to transform if possible</li>
   </ul>
  +<note>The translet name is the same as the name of the Java class that
  +implements the translet.  If the name specified by the <code>-XO</code> option
  +or derived from the URL for the stylesheet contains characters that are not
  +permitted in a Java class name, any such character will be replaced with an
  +underscore.  For example, if the translet name specified by the <code>-XO</code>
  +option is <code>my-stylesheet</code>, or if the URL of the stylesheet is
  +<code>http://example.org/my-stylesheet.xsl</code>, the translet will actually
  +be named<code>my_stylesheet</code>.
  +</note>
   </s2>
   
   <anchor name="examples"/>
  
  
  
  1.37      +13 -0     xml-xalan/java/xdocs/sources/xalan/faq.xml
  
  Index: faq.xml
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan/faq.xml,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- faq.xml	7 Jun 2003 21:12:15 -0000	1.36
  +++ faq.xml	9 Sep 2003 17:18:20 -0000	1.37
  @@ -754,5 +754,18 @@
           <p>Thanks to Gunnlauger Thor Briem (gthb@dimon.is) for providing this information.</p>
         </a>
       </faq>
  +    <faq title="Translet name doesn't match stylesheet name">
  +      <q>My stylesheet is named <code>foo-bar.xsl</code>, but &xslt4jc-short;
  +         created a translet named <code>foo_bar</code>.  Is that a bug?</q>
  +      <a>
  +        <p>No.  The name of a translet is usually the name of the stylesheet,
  +           the name specified using the <code>translet-name</code> attribute on
  +           the &xslt4jc-short; <code>TransformerFactory</code> or the name
  +           specified for the translet on the command-line invocation.
  +           However, the name of the translet is also the name of a Java class.
  +           Any character that is not permitted in a class name is replaced with
  +           an underscore.</p>
  +      </a>
  +    </faq>
     </group>
   </faqs>
  
  
  
  1.37      +16 -0     xml-xalan/java/xdocs/sources/xalan/xsltc_usage.xml
  
  Index: xsltc_usage.xml
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/xdocs/sources/xalan/xsltc_usage.xml,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- xsltc_usage.xml	7 Jun 2003 21:01:26 -0000	1.36
  +++ xsltc_usage.xml	9 Sep 2003 17:18:20 -0000	1.37
  @@ -244,6 +244,15 @@
   
   -h Prints usage statement</source>
   
  +<note>The translet name is the same as the name of the Java class that
  +implements the translet.  If the name specified by the <code>-o</code> option
  +or derived from the URL for the stylesheet contains characters that are not
  +permitted in a Java class name, any such character will be replaced with an
  +underscore.  For example, if the translet name specified by the <code>-o</code>
  +option is <code>my-stylesheet</code>, or if the URL of the stylesheet is
  +<code>http://example.org/my-stylesheet.xsl</code>, the translet will actually
  +be named <code>my_stylesheet</code>.
  +</note>
   </s3><anchor name="comp-examples"/>
   <s3 title="Examples">
       <p>The following examples assume that you have already set the
  @@ -499,6 +508,13 @@
   They only apply to the next invocation of either the <code>newTemplates</code>
   or the <code>newTransformer</code> method on that
   <code>TransformerFactory</code>.</p>
  +<note>The translet name is the same as the name of the Java class that
  +implements the translet.  If the value specified for the
  +<code>translet-name</code> attribute contains characters that are not
  +permitted in a Java class name, any such character will be replaced with an
  +underscore.  For example, if the translet name specified was
  +<code>my-stylesheet</code>, the translet will actually be named
  +<code>my_stylesheet</code>.</note>
   </s3><anchor name="api-examples"/>
   <s3 title="Examples">
   <p><em>Example 1:</em> Using a translet/Templates object for multiple
  
  
  
  1.21      +16 -3     xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/ErrorMessages.java
  
  Index: ErrorMessages.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/ErrorMessages.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- ErrorMessages.java	11 Jul 2003 17:13:38 -0000	1.20
  +++ ErrorMessages.java	9 Sep 2003 17:18:20 -0000	1.21
  @@ -707,8 +707,8 @@
           "      [-n] [-x] [-s] [-u] [-v] [-h] { <stylesheet> | -i }\n\n"+
           "OPTIONS\n"+
           "   -o <output>    assigns the name <output> to the generated\n"+
  -        "                  translet. By default the translet name\n"+
  -        "                  is taken from the <stylesheet> name. This option\n"+
  +        "                  translet.  By default the translet name is\n"+
  +        "                  derived from the <stylesheet> name.  This option\n"+
           "                  is ignored if compiling multiple stylesheets.\n"+
           "   -d <directory> specifies a destination directory for translet\n"+
           "   -j <jarfile>   packages translet classes into a jar file of the\n"+
  @@ -894,6 +894,18 @@
           "Could not create an instance of the TransformerFactory class ''{0}''."},
   
           /*
  +         * Note to translators:  This message is produced when the user
  +         * specified a name for the translet class that contains characters
  +         * that are not permitted in a Java class name.  The substitution
  +         * text "{0}" specifies the name the user requested, while "{1}"
  +         * specifies the name the processor used instead.
  +         */
  +        {ErrorMsg.TRANSLET_NAME_JAVA_CONFLICT,
  +         "The name ''{0}'' could not be used as the name of the translet "+
  +         "class because it contains characters that are not permitted in the "+
  +         "name of Java class.  The name ''{1}'' was used instead."},
  +
  +        /*
            * Note to translators:  The following message is used as a header.
            * All the error messages are collected together and displayed beneath
            * this message.
  @@ -918,6 +930,7 @@
            */
           {ErrorMsg.RUNTIME_ERROR_KEY,
           "Translet errors:"}
  +
       };
   
   
  
  
  
  1.22      +3 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/ErrorMsg.java
  
  Index: ErrorMsg.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/util/ErrorMsg.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- ErrorMsg.java	11 Jul 2003 17:13:38 -0000	1.21
  +++ ErrorMsg.java	9 Sep 2003 17:18:20 -0000	1.22
  @@ -181,6 +181,8 @@
       public static final String TRANSFORM_WITH_TRANSLET_STR = "TRANSFORM_WITH_TRANSLET_STR";
       public static final String TRANSFORM_WITH_JAR_STR = "TRANSFORM_WITH_JAR_STR";
       public static final String COULD_NOT_CREATE_TRANS_FACT = "COULD_NOT_CREATE_TRANS_FACT";
  +    public static final String TRANSLET_NAME_JAVA_CONFLICT =
  +                                                 "TRANSLET_NAME_JAVA_CONFLICT";
       
       // All error messages are localized and are stored in resource bundles.
       // This array and the following 4 strings are read from that bundle.
  
  
  

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