1

I have to pass multiple input xml files and generate multiple xml files as output.

If 'm having 3 files as 'File1.xml', 'File2.xml' and 'File3.xml', I need to copy the full content of those xml's and also add a node to each xml and then display the output files as 'File1_op.xml', 'File2_op.xml' and 'File3_op.xml'. The output files will have a extra node added like

    <Product>45896</Product>

I can't pass the file names as static, because it may change. So I need to pass the directory itself and process all the xml files in that particular directory.

Is this possible in xslt? Any help please.

2
  • Which XSLT processor do you use? One embedded in a host language as Libxslt in PHP or a standalone like Saxon or just processing through the Browser built-in? Which XSLT Version? Be aware that XSLT itself is independet from it's environment which means it doesn't know anything about the file system. What's available to deal with that depends on the hosting system. Commented Nov 19, 2013 at 8:18
  • I'm using XSLT 2.0 , Standalone SAXON Commented Nov 19, 2013 at 9:08

1 Answer 1

0

Using Saxon XSLT 2.0 you're on the bright side - I don't have this on hand so I can't give detailled help. My suggestions are
for input file names Running a single stylesheet on multiple input documents and placing all their outputs in a single file
for output Why does Saxon evaluate the result-document URI to be the same?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.