XSLT Transform multiple files from subdirectory

前端 未结 2 1266
天涯浪人
天涯浪人 2021-02-06 00:53

I have created a XSLT file that can transform a single XML file. However, I have several hundred directories with multiple xml files. Is there a way in XSLT to transform all the

2条回答
  •  温柔的废话
    2021-02-06 01:15

    Here is probably the simplest example how to process all the xml files in a file system subtree (using the collection() function as implemented in Saxon):

    
        
    
     
         
           
         
     
    
     
       
     
    
    

    When applied on any XML document (not used, ignored), this transformation applies the identity rule to every XML document contained in any of the *.xml files in the C:/Temp subtree of the file system.

    To do more neaningful processing, one needs to override the identity template -- in the inFile mode.

    In your specific case I believe you can simply replace:

                     
    

    with

                    
    

    and this applies the desired templates on the nodes selected off the current (document) node.

提交回复
热议问题