xsl-list
[Top] [All Lists]

RE: with close

2003-06-10 10:18:16
I don't understand why this means you can't rename/copy/move
the file before each transformation...
It sounds like either you're trying to do something that XSL
can't do, or XSL can do it but you need to take a different
approach (e.g. renaming the xml file).

I don't really understand what you're trying to accomplish so
it's hard to make any more recommendations.


but the content of the file must be modified dynamiquely during xsl
transformation,

Why?  Why can't you read the content of the file from compte-in.xml,
create a variable that contains the modified data, use the variable
for whatever you need, and write the modified data to compte.xml?

Your stylesheet only accesses the input data once and writes the
output once, so there's no reason I can see that you need to
modify the contents of the file dynamically in any sense
other than the usual input->processing->output that has been
suggested.
I see that you want the resulting file to have the same name
as the input file, and that can be accomplished by renaming a file
before or after the transformation.

what i need is to know how much characters i have write in
the output file
each time, because i want to make a table of contents like this:
paragraph1  begining  end
---------     ------    ----
paragraph i  ------     ----

the begining and the end  position are exprimed in characters.

so for this reason i want to use an extern file named compte.xml
which i will use in my stylesheet every time(read/write) for
knowing the
position.


Lars Huttar a écrit :

i don't understand how can i rename a file in my stylesheet,

I don't mean to rename a file in your stylesheet.
I mean rename a file from the command line.

Earlier you wrote,

my command line is:
java org.apache.xalan.xslt.Process -IN catalogue.xml -XSL
compte.xsl -OUT
compte.txt -TEXT -PARAM file_cnf compte.xml

How are you running this command?  From a batch file or script?
Whatever it is, use the same method to first rename or copy
compte.xml to something else.  E.g. (for a DOS batch file)

  rename compte.xml compte-in.xml
  java org.apache.xalan.xslt.Process -IN catalogue.xml -XSL
    compte.xsl -OUT compte.txt -TEXT -PARAM file-in compte-in.xml
    -PARAM file-out compte.xml

Whatever method you are using to run Xalan,
right before you do that, use a similar method to
rename compte.xml
to something else.
Then, in effect, compte.xml will be overwritten each time.

And of course make sure that your stylesheet reads from the
renamed file, not from compte.xml.

If this is impossible, please explain more why you
can't do this.

HTH,
Lars




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>
  • RE: with close, Lars Huttar <=