Preserving attribute whitespace

前端 未结 4 1292
说谎
说谎 2020-12-01 18:54

Disclaimer: the following is a sin against XML. That\'s why I\'m trying to change it with XSLT :)

My XML currently looks like this:


            


        
4条回答
  •  被撕碎了的回忆
    2020-12-01 19:39

    As others have pointed out, the XML spec doesn't allow for the preservation of spaces in attributes. In fact, this is one of the few differentiators between what you can do with attributes and elements (the other main one being that elements can contain other tags while attributes cannot).

    You will have to process the file outside of XML first in order to preserve the spaces.

提交回复
热议问题