Hello,

this little patch enable the the xi:include on the command-line.
The default is on, since I think in the normal case it is useful.
In the special case, the default has to be swiched off with -NIA.

In our project we want to include declarations in a programming language
in the xslt-file, so the option -XSLIA.

It would be great to include this patch in the next release - my boss
don't
believe that it is possible :-)

Greetings from Ravensburg, Germany

Rudolf Weber
http://www.infnet.verein.de


---
./src/org/apache/xalan/res/XSLTErrorResources.java.unvollstaendig       
2005-08-07 01:37:11.000000000 +0200
+++ ./src/org/apache/xalan/res/XSLTErrorResources.java  2005-11-08
08:45:52.000000000 +0100
@@ -1363,6 +1363,9 @@
   {  "optionCR", "   [-CR (Use carriage returns only on output {default
is CR/LF})]"},
   { "optionESCAPE", "   [-ESCAPE (Which characters to escape {default
is <>&\"\'\\r\\n}]"},
   { "optionINDENT", "   [-INDENT (Control how many spaces to indent
{default is 0})]"},
+  { "optionIA", "   [-IA (be aware of xinclude -default )]"},
+  { "optionNIA", "  [-NIA (don't be aware of xinclude )]"},
+  { "optionXSLIA","  [-XSLIA (handle xinclude in XSLT-Stylesheets)]"},
   { "optionTT", "   [-TT (Trace the templates as they are being
called.)]"},
   { "optionTG", "   [-TG (Trace each generation event.)]"},
   { "optionTS", "   [-TS (Trace each selection event.)]"},
---
./src/org/apache/xalan/res/XSLTErrorResources_de.java.unvollstaendig    
2005-08-07 01:37:11.000000000 +0200
+++ ./src/org/apache/xalan/res/XSLTErrorResources_de.java       2005-11-08
08:47:59.000000000 +0100
@@ -2328,6 +2328,9 @@
   {  "optionCR", "[-CR (Nur Zeilenschaltung bei Ausgabe verwenden
{Standardeinstellung ist CR/LF})]"},
   { "optionESCAPE", "[-ESCAPE (Zeichen, die mit einem Escapezeichen
angegeben werden m\u00fcssen {Standardeinstellung ist <>&\"\'\\r\\n}]"},
   { "optionINDENT", "[-INDENT (Steuerung, um wie viele Leerzeichen
einger\u00fcckt werden soll {Standardeinstellung ist 0})]"},
+  { "optionIA", "   [-IA ( Ber\u00fccksichtigung von xinclude -
Voreinstellung )]"},
+  { "optionNIA", "  [-NIA ( keine Ber\u00fccksichtigung von xinclude
)]"},
+  { "optionXSLIA","  [-XSLIA (Ber\u00fccksichtigung von xinclude in
XSLT-Stylesheets)]"},
   { "optionTT", "[-TT (Trace f\u00fcr Vorlagen ausf\u00fchren, wenn sie
aufgerufen werden.)]"},
   { "optionTG", "[-TG (Trace f\u00fcr jedes Generierungsereignis
durchf\u00fchren.)]"},
   { "optionTS", "[-TS (Trace f\u00fcr jedes Auswahlereignis
durchf\u00fchren.)]"},
---
./src/org/apache/xalan/res/XSLTErrorResources_pl.java.unvollstaendig    
2005-08-07 01:37:11.000000000 +0200
+++ ./src/org/apache/xalan/res/XSLTErrorResources_pl.java       2005-10-13
17:16:05.000000000 +0200
@@ -2328,6 +2328,8 @@
   {  "optionCR", "   [-LF (u\u017cycie tylko znak\u00f3w powrotu
karetki na wyj\u015bciu {domy\u015blnie CR/LF})]"},
   { "optionESCAPE", "   [-ESCAPE (znaki o zmienionym znaczeniu
{domy\u015blne <>&\"\'\\r\\n}]"},
   { "optionINDENT", "   [-INDENT (liczba znak\u00f3w wci\u0119cia
{domy\u015blnie 0})]"},
+  { "optionIA", "   [-IA ( Ber\u00fccksichtigung von xinclude -
Voreinstellung )]"},
+  { "optionNIA", "  [-NIA ( keine Ber\u00fccksichtigung von xinclude
)]"},
   { "optionTT", "   [-TT (\u015bledzenie szablon\u00f3w podczas ich
wywo\u0142ywania)]"},
   { "optionTG", "   [-TG (\u015bledzenie ka\u017cdego zdarzenia
generowania)]"},
   { "optionTS", "   [-TS (\u015bledzenie ka\u017cdego zdarzenia
wyboru)]"},
--- ./src/org/apache/xalan/xslt/Process.java.unvollstaendig     2005-08-07
01:37:11.000000000 +0200
+++ ./src/org/apache/xalan/xslt/Process.java    2005-10-19
12:13:53.000000000 +0200
@@ -94,7 +94,9 @@
     System.out.println(resbundle.getString("optionTEXT"));  //"  
[-TEXT (Use simple Text formatter.)]");
     System.out.println(resbundle.getString("optionHTML"));  //"  
[-HTML (Use HTML formatter.)]");
     System.out.println(resbundle.getString("optionPARAM"));  //"  
[-PARAM name expression (Set a stylesheet parameter)]");
-    
+    System.out.println(resbundle.getString("optionIA"));  //"   [-IA
(XIncludeAware- default]");
+    System.out.println(resbundle.getString("optionNIA"));  //"   [-NIA
(XIncludeAware]");
+    System.out.println(resbundle.getString("optionXSLIA"));  //"  
[-XSLIA (XSL XIncludeAware]");
     System.out.println(resbundle.getString("optionMEDIA"));
     System.out.println(resbundle.getString("optionFLAVOR"));
     System.out.println(resbundle.getString("optionDIAG"));
@@ -154,6 +156,8 @@
     boolean doDiag = false;
     String msg = null;
     boolean isSecureProcessing = false;
+    boolean isXIncludeAware = true;
+    boolean isXSLXIncludeAware=false;
 
     // Runtime.getRuntime().traceMethodCalls(false);
     // Runtime.getRuntime().traceInstructions(false);
@@ -382,9 +386,21 @@
           // TBD:
           // xmlProcessorLiaison.setShouldExpandEntityRefs(false);
         }
+       else if ("-IA".equalsIgnoreCase(argv[i]))
+       {
+           isXIncludeAware = true;
+       }
+       else if ("-NIA".equalsIgnoreCase(argv[i]))
+       {
+           isXIncludeAware = false;
+       }
+       else if ("-XSLIA".equalsIgnoreCase(argv[i]))
+       {
+               isXSLXIncludeAware=true;
+       }
         else if ("-V".equalsIgnoreCase(argv[i]))
         {
-          diagnosticsWriter.println(resbundle.getString("version") 
//">>>>>>> Xalan Version "
+         
diagnosticsWriter.println(resbundle.getString("version")+"-rw" 
//">>>>>>> Xalan Version "
                                     + Version.getVersion() + ", " +
 
           /* xmlProcessorLiaison.getParserDescription()+ */
@@ -705,6 +721,7 @@
         doExit(msg);
       }
 
+      
       // Note that there are usage cases for calling us without a -IN
arg
       // The main XSL transformation occurs here!
       try
@@ -728,7 +745,7 @@
               DocumentBuilderFactory.newInstance();
 
             dfactory.setNamespaceAware(true);
-
+            dfactory.setXIncludeAware(isXSLXIncludeAware);
             if (isSecureProcessing)
             {
               try
@@ -746,6 +763,7 @@
           }
           else
           {
+               //??? in the case of isXSLXIncludeAware - parsing und via
SAXSource 
             // System.out.println("Calling newTemplates:
"+xslFileName);
             stylesheet = tfactory.newTemplates(new
StreamSource(xslFileName));
             // System.out.println("Done calling newTemplates:
"+xslFileName);
@@ -855,7 +873,13 @@
 
               dfactory.setCoalescing(true);
               dfactory.setNamespaceAware(true);
-
+             try
+             {
+                 dfactory.setXIncludeAware(isXIncludeAware);
+             }
+             catch(UnsupportedOperationException uoe)
+             {
+             }
               if (isSecureProcessing)
               {
                 try
@@ -973,9 +997,7 @@
               reader.parse(new InputSource(inFileName));
               }                            
             }
-            else
-            {
-              if (entityResolver != null)
+            else // default i.e. flavor=="s2s"
               {
                 XMLReader reader = null;
 
@@ -986,6 +1008,7 @@
                     javax.xml.parsers.SAXParserFactory.newInstance();
 
                   factory.setNamespaceAware(true);
+                  factory.setXIncludeAware(isXIncludeAware);
 
                   if (isSecureProcessing)
                   {
@@ -1011,6 +1034,8 @@
                 }
                 catch (NoSuchMethodError ex2){}
                 catch (AbstractMethodError ame){}
+              if (entityResolver != null)
+              {
 
                 if (null == reader)
                 {
@@ -1043,7 +1068,7 @@
               else
               {
                 // System.out.println("Starting transform");
-                transformer.transform(new StreamSource(inFileName),
+                transformer.transform(new SAXSource(reader,new
InputSource(inFileName)),
                                       strResult);
                 // System.out.println("Done with transform");
               }



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

Reply via email to