| View previous topic :: View next topic |
| Author |
Message |
eger
Joined: 04 Mar 2010 Posts: 5
|
Posted: Tue Mar 30, 2010 5:55 pm Post subject: Including external XML files for cleaner config? |
|
|
I found an old forum post (http://icecast.imux.net/viewtopic.php?t=324) which asked a question about including external XML files for cleaner configs with lots of mounts.
I tried doing the following per XML standards:
Added to top of icecast.xml:
<!DOCTYPE icecast
<!ENTITY dance SYSTEM "/etc/icecast/dance.xml">
]>
Then inside the <icecast> near bottom added:
&dance;
I then reloaded icecast using -HUP. But the changes do not get picked up. It does work if I include the dance.xml contents in the icecast.xml itself.
I am wondering if this is supported and if anyone has successfully implemented include files in their setup? If so, do you have an example?
Thanks! |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Tue Mar 30, 2010 8:36 pm Post subject: |
|
|
not sure if anyone has tried it. It could be related to the api used, instead of (in cfgfile.c)
doc = xmlParseFile(filename);
try
doc = xmlReadFile (filename, NULL, 0);
The third arg is a bitwise or | of the options in http://xmlsoft.org/html/libxml-parser.html#xmlParserOption
karl. |
|
| Back to top |
|
 |
eger
Joined: 04 Mar 2010 Posts: 5
|
Posted: Wed Apr 07, 2010 8:08 pm Post subject: |
|
|
| karlH wrote: |
not sure if anyone has tried it. It could be related to the api used, instead of (in cfgfile.c)
doc = xmlParseFile(filename);
try
doc = xmlReadFile (filename, NULL, 0);
The third arg is a bitwise or | of the options in http://xmlsoft.org/html/libxml-parser.html#xmlParserOption
karl. |
Do you mean to use this right in the XML config as:
doc = xmlReadFile (/etc/myicecastextra.xml, NULL, 0);
and reference as &doc; ?
Just confirming as adding code to the XML file sounds a little strange to me! |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Wed Apr 07, 2010 8:14 pm Post subject: |
|
|
yes it would be weird which is why I said cfgfile.c which is in the src directory.
karl. |
|
| Back to top |
|
 |
Yahav
Joined: 19 Apr 2010 Posts: 2
|
Posted: Mon Apr 19, 2010 9:57 pm Post subject: |
|
|
hey mate, its not a problem with the XML parser,
its your syntax!
Here's Your Code:
| Code: |
<!DOCTYPE icecast
<!ENTITY dance SYSTEM "/etc/icecast/dance.xml">
]> |
and here's the correct one:
| Code: |
<!DOCTYPE icecast [
<!ENTITY dance SYSTEM "/etc/icecast/dance.xml">
]>
|
good luck mate.
yahav |
|
| Back to top |
|
 |
|