public static XDocument Load (string uri, LoadOptions options)
{
XmlReaderSettings s = new XmlReaderSettings ();
-#if !MOONLIGHT
s.ProhibitDtd = false; // see XNodeNavigatorTest.MoveToId().
-#endif
s.IgnoreWhitespace = (options & LoadOptions.PreserveWhitespace) == 0;
using (XmlReader r = XmlReader.Create (uri, s)) {
return LoadCore (r, options);
public static XDocument Load (TextReader textReader, LoadOptions options)
{
XmlReaderSettings s = new XmlReaderSettings ();
-#if !MOONLIGHT
s.ProhibitDtd = false; // see XNodeNavigatorTest.MoveToId().
-#endif
s.IgnoreWhitespace = (options & LoadOptions.PreserveWhitespace) == 0;
using (XmlReader r = XmlReader.Create (textReader, s)) {
return LoadCore (r, options);
static void DefineDefaultSettings (XmlReaderSettings settings, LoadOptions options)
{
-#if MOONLIGHT
- // 2.1 has a DtdProcessing property which defaults to DtdProcessing.Prohibit
- settings.DtdProcessing = DtdProcessing.Parse;
-#else
settings.ProhibitDtd = false;
-#endif
settings.IgnoreWhitespace = (options & LoadOptions.PreserveWhitespace) == 0;
}
}
}
-#if MOONLIGHT || MOBILE || NET_4_0
+#if MOBILE || NET_4_0
public static XElement Load (Stream stream)
{
return Load (stream, LoadOptions.None);
if ((options & SaveOptions.DisableFormatting) == SaveOptions.None)
s.Indent = true;
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
if ((options & SaveOptions.OmitDuplicateNamespaces) == SaveOptions.OmitDuplicateNamespaces)
s.NamespaceHandling |= NamespaceHandling.OmitDuplicates;
#endif
if ((options & SaveOptions.DisableFormatting) == SaveOptions.None)
s.Indent = true;
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
if ((options & SaveOptions.OmitDuplicateNamespaces) == SaveOptions.OmitDuplicateNamespaces)
s.NamespaceHandling |= NamespaceHandling.OmitDuplicates;
#endif
WriteTo (writer);
}
-#if NET_4_0 || MOONLIGHT || MOBILE
+#if NET_4_0 || MOBILE
public void Save (Stream stream)
{
Save (stream, SaveOptions.None);