How to preserve Empty XML Tags after XSLT - prevent collapsing them from to

后端 未结 10 2614
不思量自难忘°
不思量自难忘° 2020-12-18 22:31

Say I have a very simple XML with an empty tag \'B\':


  foo
  
  bar

         


        
10条回答
  •  感情败类
    2020-12-18 22:59

    There is no standard way, as they are equivalent; You might be able to find an XSLT engine that has an option for this behaviour, but I'm not aware of any.

    If you're passing this to a third party that cannot accept empty tags using this syntax, then you may have to post-process the output yourself (or convince the third party to fix their XML parsing)

提交回复
热议问题