Hi Shane.

Shane Curcuru:
> [...]
> Oh, wait, nevermind. 8-) testXSLT is Xalan-C 1.x.
> It is an interesting feature idea (having a -stdinXML
> arg somewhere on the command line of our command line
> Process classes that sucks the XML file from stdin
> instead of a file) - patches doing this are welcome.

This should do it.  If you use "-" as the filename for the XML file,
it'll get it from stdin.

--- xml-xalan/c/src/TestXSLT/process.cpp.orig   Sun Jun 17 13:00:35 2001
+++ xml-xalan/c/src/TestXSLT/process.cpp        Sun Jun 17 13:31:18 2001
@@ -360,7 +360,7 @@
                {
                        ++i;
 
-                       if(i < argc && argv[i][0] != '-')
+                       if(i < argc && !(argv[i][0] == '-' && argv[i][1] != 0))
                        {
                                CopyStringToVector(argv[i], p.inFileName);
                        }
@@ -964,7 +964,12 @@
        }
 
        // Do the transformation...
-       XSLTInputSource         theInputSource(c_str(params.inFileName));
+       XSLTInputSource *ptrInputSource;
+       if (strcmp(c_str(params.inFileName), "-") == 0)
+               ptrInputSource = new XSLTInputSource(&cin);
+       else
+               ptrInputSource = new XSLTInputSource(c_str(params.inFileName));
+       XSLTInputSource &theInputSource = *ptrInputSource;
 
 #if defined(XALAN_USE_ICU)
        ICUBridgeCollationCompareFunctor        theICUFunctor;

-- 
Cameron McCormack     [  e-mail :: [EMAIL PROTECTED]           ]
Melbourne, Australia  [     web :: http://yoyo.cc.monash.edu.au/~clm/  ]
                      [     icq :: 26955922                            ]

Reply via email to