From 57d05a2378114770c92d0c8619153b4df01478d3 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 28 Jul 2012 20:36:22 +0300 Subject: [PATCH] Update mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng/RelaxngPattern.cs - Choice of using the parser for compact syntax or not based on the file extension, in order to allow mixed grammars (e.g. including RNG from RNC). - Correction in base URI for compact syntax in order to allow including grammar files located in different directories. --- .../Commons.Xml.Relaxng/Commons.Xml.Relaxng/RelaxngPattern.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng/RelaxngPattern.cs b/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng/RelaxngPattern.cs index a6e19404b37..009c03b6bb7 100755 --- a/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng/RelaxngPattern.cs +++ b/mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng/RelaxngPattern.cs @@ -83,8 +83,8 @@ namespace Commons.Xml.Relaxng RelaxngGrammar g = null; RelaxngPattern p; try { - if (grammar.IsSourceCompactSyntax) { - p = RncParser.ParseRnc (new StreamReader ((Stream) grammar.Resolver.GetEntity (uri, null, typeof (Stream))), null, BaseUri, nsContext); + if (uri.AbsolutePath.EndsWith(".rnc", StringComparison.InvariantCultureIgnoreCase)) { + p = RncParser.ParseRnc (new StreamReader ((Stream) grammar.Resolver.GetEntity (uri, null, typeof (Stream))), null, uri.AbsoluteUri, nsContext); } else { xtr = new XmlTextReader (uri.AbsoluteUri, (Stream) grammar.Resolver.GetEntity (uri, null, typeof (Stream))); RelaxngReader r = new RelaxngReader (xtr, nsContext, grammar.Resolver); -- 2.25.1