[mythtv-commits] Ticket #3931: PATCH: Add <include_file src="includefile.xml"/> functionality to xmlparser

MythTV mythtv at cvs.mythtv.org
Tue Sep 4 13:42:00 UTC 2007


#3931: PATCH: Add <include_file src="includefile.xml"/> functionality to xmlparser
--------------------------------------+-------------------------------------
 Reporter:  Roo <roo.watt at gmail.com>  |       Owner:  ijr 
     Type:  enhancement               |      Status:  new 
 Priority:  minor                     |   Milestone:  0.21
Component:  mythtv                    |     Version:  head
 Severity:  medium                    |     Mlocked:  0   
--------------------------------------+-------------------------------------
 The attached patch adds an <include_src> tag to the xmlparser in
 libmyth/xmlparse.cpp.

 parent_file,xml:
 {{{
 <mythuitheme>

     <include_file src="include_file.xml" />

     <!-- OR -->

     <include_file src="include_file.xml">
         Some comment text can go here.
     </include_file>

 </mythuitheme>
 }}}

 included_file.xml:
 {{{
 <container>
    <font name="title" face="Arial">
        <color>#ffff00</color>
        <dropcolor>#000000</dropcolor>
        <size>24</size>
        <shadow>3,3</shadow>
        <bold>yes</bold>
    </font>

    <font name="labels" face="Arial">
        <color>#ffff00</color>
        <dropcolor>#000000</dropcolor>
        <size>18</size>
        <shadow>3,3</shadow>
        <bold>yes</bold>
    </font>
 </container>
 }}}

 final_document:
 {{{
 <mythuitheme>

    <font name="title" face="Arial">
        <color>#ffff00</color>
        <dropcolor>#000000</dropcolor>
        <size>24</size>
        <shadow>3,3</shadow>
        <bold>yes</bold>
    </font>

    <font name="labels" face="Arial">
        <color>#ffff00</color>
        <dropcolor>#000000</dropcolor>
        <size>18</size>
        <shadow>3,3</shadow>
        <bold>yes</bold>
    </font>

     <!-- OR -->

    <font name="title" face="Arial">
        <color>#ffff00</color>
        <dropcolor>#000000</dropcolor>
        <size>24</size>
        <shadow>3,3</shadow>
        <bold>yes</bold>
    </font>

    <font name="labels" face="Arial">
        <color>#ffff00</color>
        <dropcolor>#000000</dropcolor>
        <size>18</size>
        <shadow>3,3</shadow>
        <bold>yes</bold>
    </font>

 </mythuitheme>
 }}}

 '''Include file requirements'''
  * The included file must be a well formed xml document, errors will be
 reported
  * All children (of the root element) of the included document will be
 inserted into the parent document
  * A recursion limit protects from circular includes

 '''Include search path'''
  * The included file will be searched for in the standard search path as
 used for the main xml file
  * If either the parent.xml file or any include_file.xml cannot be found
 in the search path then the file load fails


 One possible use would allow a theme developer to only "theme" the desired
 <window>'s in a plugin without a needing to theme the entire plugin. I
 believe this will enable a finer grained level of reuse for theme files
 than the current plugin level.

 eg The main mythmusic playback window could be themed but include the
 default/music-metadata.xml file for the meta data editor.

-- 
Ticket URL: <http://svn.mythtv.org/trac/ticket/3931>
MythTV <http://svn.mythtv.org/trac>
MythTV


More information about the mythtv-commits mailing list