Android: How to inject a element into another element in XML?

后端 未结 4 631

I would like to know whether there is a way to insert/inject a element defined in an XML file into another element, d

4条回答
  •  一个人的身影
    2020-12-14 05:32

    If I understand what you are looking to do, then internal (parsed) general entities might help you achieve what you are looking for.

    An example of how you can define the value "Francesco" as an entity called "auth" and then use it in your XML:

    
    
    ]>
    
      &auth;
      Author: &auth;
    
    

    When read by an XML parser, the document will be parsed and evaluated, or "seen", as:

    
    
      Francesco
      Author: Francesco
    
    

提交回复
热议问题