Populate XML template-file from XPath Expressions?

后端 未结 2 866
离开以前
离开以前 2021-01-03 11:16

What would be the best way to populate (or generate) an XML template-file from a mapping of XPath expressions?

The requirements are that we will need to start with a

2条回答
  •  失恋的感觉
    2021-01-03 11:57

    This transformation creates from the "expressions" an XML document that has the structure of the wanted result -- it remains to transform this result into the final result:

    
     
    
     
        1
        bar
        foo
        00.00
        USD
        11.11
        AUD
        2
        some name
        some description
        00.01
        USD
     
    
     
      
     
    
     
      
    
      
        
         
           
             
    
              
            
           
           
            
           
         
         
      
     
    
    

    When this transformation is applied on any XML document (not used), the result is:

    
       
    1 bar foo 00.00 USD 11.11 AUD
    2 some name some description 00.01 USD

    Note:

    1. You need to transform the "expressions" you are given into the format used in this transformation -- this is easy and straightforward.

    2. In the final transformation you need to copy every node "as-is" (using the identity rule), with the exception that the top node should be generated in the "http://predic8.com/wsdl/material/ArticleService/1/" namespace. Note that the other namespaces present in the "template" are not used and can be safely ommitted.

提交回复
热议问题