16
|
1 // This file (IBBXmlResolver.cs) is a part of the IBBoard library and is copyright 2009 IBBoard.
|
|
2 //
|
|
3 // The file and the library/program it is in are licensed under the GNU LGPL license, either version 3 of the License or (at your option) any later version. Please see COPYING.LGPL for more information and the full license.
|
|
4
|
37
|
5 using System;
|
|
6 using System.Xml;
|
|
7
|
|
8 namespace IBBoard.Xml
|
|
9 {
|
|
10 /// <summary>
|
|
11 /// Summary description for IBBXmlResolver.
|
|
12 /// </summary>
|
|
13 public class IBBXmlResolver : XmlUrlResolver
|
|
14 {
|
|
15 private string baseFilePath = "";
|
|
16
|
|
17 public IBBXmlResolver(string basePath)
|
|
18 {
|
|
19 baseFilePath = basePath;
|
|
20 }
|
|
21
|
|
22 public override Uri ResolveUri(Uri baseUri, string relativeUri)
|
|
23 {
|
|
24 if (relativeUri.StartsWith("dtds/"))
|
|
25 {
|
|
26 //Uri uri = base.ResolveUri(baseUri, relativeUri);
|
|
27 return new Uri(Uri.UriSchemeFile + "://" + baseFilePath + Constants.DirectoryString + relativeUri);
|
|
28 }
|
|
29 else
|
|
30 {
|
|
31 return base.ResolveUri(baseUri, relativeUri);
|
|
32 }
|
|
33 }
|
|
34 }
|
|
35 }
|