diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2004-11-08 12:18:29 +0300 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2004-11-08 12:18:29 +0300 |
commit | f6a6ca4b9328c276fade68f32b1a3bdaeb54e54c (patch) | |
tree | c5eb44d580e1fb6f778999b3d10e4d50782c1a46 /mcs/class/System.XML/System.Xml/DTDObjectModel.cs | |
parent | 7f373943c74546b976f31a6bc1afea0b60545d81 (diff) |
2004-11-08 Atsushi Enomoto <atsushi@ximian.com>
* DTDObjectModel.cs,
DTDReader.cs,
XmlReader.cs,
XmlTextReader.cs,
XmlException.cs :
Added support for 2.0 XmlException.SourceUri property. Improved
exception handling to contain BaseURI everywhere in the parser.
svn path=/trunk/mcs/; revision=35820
Diffstat (limited to 'mcs/class/System.XML/System.Xml/DTDObjectModel.cs')
-rw-r--r-- | mcs/class/System.XML/System.Xml/DTDObjectModel.cs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/mcs/class/System.XML/System.Xml/DTDObjectModel.cs b/mcs/class/System.XML/System.Xml/DTDObjectModel.cs index ccaa28bc340..dba05d65c19 100644 --- a/mcs/class/System.XML/System.Xml/DTDObjectModel.cs +++ b/mcs/class/System.XML/System.Xml/DTDObjectModel.cs @@ -559,6 +559,11 @@ namespace Mono.Xml protected DTDObjectModel Root { get { return root; } } + + internal XmlException NotWFError (string message) + { + return new XmlException (this as IXmlLineInfo, BaseURI, message); + } } internal class DTDElementDeclaration : DTDNode @@ -887,7 +892,7 @@ namespace Mono.Xml loadException = ex; LiteralEntityValue = String.Empty; LoadFailed = true; -// throw new XmlException (this, "Cannot resolve external entity. URI is " + absPath + " ."); +// throw NotWFError ("Cannot resolve external entity. URI is " + absPath + " ."); } finally { if (s != null) s.Close (); @@ -957,13 +962,13 @@ namespace Mono.Xml hasExternalReference = true; if (recursed) - throw new XmlException ("Entity recursion was found."); + throw NotWFError ("Entity recursion was found."); recursed = true; if (scanned) { foreach (string referenced in refs) if (this.ReferencingEntities.Contains (referenced)) - throw new XmlException (String.Format ( + throw NotWFError (String.Format ( "Nested entity was found between {0} and {1}", referenced, Name)); recursed = false; @@ -982,7 +987,7 @@ namespace Mono.Xml break; string name = value.Substring (start, i - start); if (name.Length == 0) - throw new XmlException (this as IXmlLineInfo, "Entity reference name is missing."); + throw NotWFError ("Entity reference name is missing."); if (name [0] == '#') break; // character reference if (XmlChar.GetPredefinedEntity (name) >= 0) |