POV-Ray : Newsgroups : povray.off-topic : The trouble with XSLT : Re: The trouble with XSLT Server Time
29 Jul 2024 14:19:30 EDT (-0400)
  Re: The trouble with XSLT  
From: Francois Labreque
Date: 21 Feb 2012 08:44:05
Message: <4f439fa5$1@news.povray.org>
Le 2012-02-21 04:12, Invisible a écrit :
>>> So it looks like I'm going to have to sit down and write a special tool
>>> to take an XML file and copy it, inserting the correct XSL reference
>>> into the header. How pathetic...
>>
>> That's merely a shell-script:
>> 1. find the closing of the first<?xml tag
>> 2. insert your xsl tokens
>> 3. copy verbatim the remaining document
>> 4.
>> 5. Profit.
>
> How the heck do you do that from a shell script?
>
> ...oh, wait. You probably meant a /real/ shell, not CMD.EXE, right?

1. write the program that will do it using your favorite language 
(*cough*Haskell*cough*) and name it BAR.EXE

2. FOR %FOO in (*.xml) DO TYPE %FOO | BAR > new%FOO

Assuming BAR.EXE reads from stdin and output to stdout, this will run it 
against all the .xml files in the directory and create a second set 
called new*.xml

Alternately, find Win32 versions of awk, sed, perl, or something like that.


-- 
/*Francois Labreque*/#local a=x+y;#local b=x+a;#local c=a+b;#macro P(F//
/*    flabreque    */L)polygon{5,F,F+z,L+z,L,F pigment{rgb 9}}#end union
/*        @        */{P(0,a)P(a,b)P(b,c)P(2*a,2*b)P(2*b,b+c)P(b+c,<2,3>)
/*   gmail.com     */}camera{orthographic location<6,1.25,-6>look_at a }


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.