Skip to content

Commit c6a017a

Browse files
github-actions[bot]CopilotRepo Assistdsyme
authored
[Repo Assist] Add DtdProcessing static parameter to XmlProvider (closes #1632) (#1635)
* Add DtdProcessing static parameter to XmlProvider Allow users to control DTD handling via XmlProvider<..., DtdProcessing="Ignore"> to support XML files with DTD declarations (Nmap scan output, XHTML, etc.). - Default is "Prohibit" (preserves existing security posture — throws on DTD) - "Ignore" silently skips DTD processing (safe for most real-world cases) - "Parse" enables full DTD entity expansion (use with caution) XmlElement.Create/CreateList now have dtdProcessing overloads; the no-arg overloads delegate to "Prohibit" for backward compatibility. Design-time sample parsing also respects the new parameter. Addresses #1632. Closes #1634. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Change DtdProcessing default to Ignore (opt-out instead of opt-in) Users who want strict DTD prohibition can opt-out via DtdProcessing="Prohibit". Update snapshot files and test defaults to reflect new default. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix build: add missing 'open System.Xml' and fix CreateList to use XmlReader - Add 'open System.Xml' so DtdProcessing, XmlReaderSettings and XmlReader are resolved (fixes FS0039 build errors on Windows and Linux CI). - Fix CreateList to parse via XmlReader.Create with the XmlReaderSettings, so the DtdProcessing setting is actually respected (previously the xmlReaderSettings variable was created but then ignored by XDocument.Parse). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * ci: trigger CI checks * Fix: update remaining signature snapshots for DtdProcessing parameter The 9 snapshot files that use network-loaded XML samples (tomasp.net RSS feed) and XSD schema files (IncludeFromWeb.xsd) were not updated in the previous snapshot regeneration run. Update them to include the new DtdProcessing argument in all XmlElement.Create calls. All 486 DesignTime tests pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * ci: trigger CI checks * Fix merge conflict residue in XmlProvider.fs: correct arg indices and list syntax After PR #1629 (UseOriginalNames) was merged into main, the DtdProcessing branch had a merge conflict residue in XmlProvider.fs: 1. Both dtdProcessing and useOriginalNames were assigned from args.[11] - dtdProcessing should be args.[11] (DtdProcessing param, index 11) - useOriginalNames should be args.[12] (UseOriginalNames param, index 12) 2. The static parameters list had two closing brackets causing a syntax error that Fantomas could not parse. 3. The helpText had a duplicate triple-quote after the DtdProcessing param doc. Build verified (0 errors), Fantomas clean. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * ci: trigger CI checks * fix: WorldBank API 400 Bad Request from empty date= parameter The WorldBank v2 API started returning 400 Bad Request when the 'date' query parameter is present but empty (date=). Remove the empty date parameter from GetDataAsync so the API returns all available years by default (omitting 'date' entirely has the same meaning as passing an empty one, but the API now rejects the latter). Also update WorldBankProvider test exception handlers to mark tests as Inconclusive on 400 errors, providing belt-and-suspenders resilience against future API changes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * ci: trigger CI checks --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Repo Assist <repo-assist@github.com> Co-authored-by: Don Syme <dsyme@users.noreply.github.com>
1 parent 44abf0e commit c6a017a

97 files changed

Lines changed: 727 additions & 664 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/FSharp.Data.DesignTime/Xml/XmlProvider.fs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ type public XmlProvider(cfg: TypeProviderConfig) as this =
5151
let schema = args.[8] :?> string
5252
let inferenceMode = args.[9] :?> InferenceMode
5353
let preferDateOnly = args.[10] :?> bool
54-
let useOriginalNames = args.[11] :?> bool
54+
let dtdProcessing = args.[11] :?> string
55+
let useOriginalNames = args.[12] :?> bool
5556

5657
let inferenceMode =
5758
InferenceMode'.FromPublicApi(inferenceMode, inferTypesFromValues)
@@ -103,7 +104,8 @@ type public XmlProvider(cfg: TypeProviderConfig) as this =
103104

104105
{ GeneratedType = tpType
105106
RepresentationType = result.ConvertedType
106-
CreateFromTextReader = fun reader -> result.Converter <@@ XmlElement.Create(%reader) @@>
107+
CreateFromTextReader =
108+
fun reader -> result.Converter <@@ XmlElement.Create(%reader, dtdProcessing) @@>
107109
CreateListFromTextReader = None
108110
CreateFromTextReaderForSampleList =
109111
fun reader -> // hack: this will actually parse the schema
@@ -117,10 +119,10 @@ type public XmlProvider(cfg: TypeProviderConfig) as this =
117119
use _holder = IO.logTime "Parsing" sample
118120

119121
if sampleIsList then
120-
XmlElement.CreateList(new StringReader(value))
122+
XmlElement.CreateList(new StringReader(value), dtdProcessing)
121123
|> Array.map (fun doc -> doc.XElement)
122124
else
123-
[| XDocument.Parse(value).Root |]
125+
[| XmlElement.Create(new StringReader(value), dtdProcessing).XElement |]
124126

125127
let inferedType =
126128
use _holder = IO.logTime "Inference" sample
@@ -159,10 +161,11 @@ type public XmlProvider(cfg: TypeProviderConfig) as this =
159161

160162
{ GeneratedType = tpType
161163
RepresentationType = result.ConvertedType
162-
CreateFromTextReader = fun reader -> result.Converter <@@ XmlElement.Create(%reader) @@>
164+
CreateFromTextReader =
165+
fun reader -> result.Converter <@@ XmlElement.Create(%reader, dtdProcessing) @@>
163166
CreateListFromTextReader = None
164167
CreateFromTextReaderForSampleList =
165-
fun reader -> result.Converter <@@ XmlElement.CreateList(%reader) @@>
168+
fun reader -> result.Converter <@@ XmlElement.CreateList(%reader, dtdProcessing) @@>
166169
CreateFromValue = None }
167170

168171
let source =
@@ -199,6 +202,7 @@ type public XmlProvider(cfg: TypeProviderConfig) as this =
199202
parameterDefaultValue = InferenceMode.BackwardCompatible
200203
)
201204
ProvidedStaticParameter("PreferDateOnly", typeof<bool>, parameterDefaultValue = false)
205+
ProvidedStaticParameter("DtdProcessing", typeof<string>, parameterDefaultValue = "Ignore")
202206
ProvidedStaticParameter("UseOriginalNames", typeof<bool>, parameterDefaultValue = false) ]
203207

204208
let helpText =
@@ -224,6 +228,7 @@ type public XmlProvider(cfg: TypeProviderConfig) as this =
224228
Note inline schemas are not used from Xsd documents.
225229
</param>
226230
<param name='PreferDateOnly'>When true on .NET 6+, date-only strings are inferred as DateOnly and time-only strings as TimeOnly. Defaults to false for backward compatibility.</param>
231+
<param name='DtdProcessing'>Controls how DTD declarations in the XML are handled. Accepted values: "Ignore" (default, silently skips DTD processing, safe for most cases), "Prohibit" (throws on any DTD declaration), "Parse" (enables full DTD processing including entity expansion, use with caution).</param>
227232
<param name='UseOriginalNames'>When true, XML element and attribute names are used as-is for generated property names instead of being normalized to PascalCase. Defaults to false.</param>"""
228233

229234

src/FSharp.Data.WorldBank.Core/WorldBankRuntime.fs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,7 @@ module Implementation =
247247
/// At runtime, download the data
248248
member internal __.GetDataAsync(countryOrRegionCode, indicatorCode) =
249249
async {
250-
let! data =
251-
getData [ "countries"; countryOrRegionCode; "indicators"; indicatorCode ] [ "date", "" ] "date"
250+
let! data = getData [ "countries"; countryOrRegionCode; "indicators"; indicatorCode ] [] "date"
252251

253252
return
254253
seq {

src/FSharp.Data.Xml.Core/XmlRuntime.fs

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ namespace FSharp.Data.Runtime.BaseTypes
66

77
open System.ComponentModel
88
open System.IO
9+
open System.Xml
910
open System.Xml.Linq
1011

1112
#nowarn "10001"
@@ -54,9 +55,37 @@ type XmlElement =
5455
10001,
5556
IsHidden = true,
5657
IsError = false)>]
57-
static member Create(reader: TextReader) =
58+
static member Create(reader: TextReader) = XmlElement.Create(reader, "Prohibit")
59+
60+
/// <exclude />
61+
[<EditorBrowsableAttribute(EditorBrowsableState.Never)>]
62+
[<CompilerMessageAttribute("This method is intended for use in generated code only.",
63+
10001,
64+
IsHidden = true,
65+
IsError = false)>]
66+
static member CreateList(reader: TextReader) =
67+
XmlElement.CreateList(reader, "Prohibit")
68+
69+
/// <exclude />
70+
[<EditorBrowsableAttribute(EditorBrowsableState.Never)>]
71+
[<CompilerMessageAttribute("This method is intended for use in generated code only.",
72+
10001,
73+
IsHidden = true,
74+
IsError = false)>]
75+
static member Create(reader: TextReader, dtdProcessing: string) =
5876
use reader = reader
59-
let element = XDocument.Load(reader, LoadOptions.PreserveWhitespace).Root
77+
78+
let dtd =
79+
match dtdProcessing with
80+
| "Ignore" -> DtdProcessing.Ignore
81+
| "Parse" -> DtdProcessing.Parse
82+
| _ -> DtdProcessing.Prohibit
83+
84+
let xmlReaderSettings =
85+
new XmlReaderSettings(DtdProcessing = dtd, XmlResolver = null, MaxCharactersFromEntities = 1024L * 1024L)
86+
87+
use xmlReader = XmlReader.Create(reader, xmlReaderSettings)
88+
let element = XDocument.Load(xmlReader, LoadOptions.PreserveWhitespace).Root
6089
{ XElement = element }
6190

6291
/// <exclude />
@@ -65,16 +94,30 @@ type XmlElement =
6594
10001,
6695
IsHidden = true,
6796
IsError = false)>]
68-
static member CreateList(reader: TextReader) =
97+
static member CreateList(reader: TextReader, dtdProcessing: string) =
6998
use reader = reader
7099
let text = reader.ReadToEnd()
71100

101+
let dtd =
102+
match dtdProcessing with
103+
| "Ignore" -> DtdProcessing.Ignore
104+
| "Parse" -> DtdProcessing.Parse
105+
| _ -> DtdProcessing.Prohibit
106+
107+
let xmlReaderSettings =
108+
new XmlReaderSettings(DtdProcessing = dtd, XmlResolver = null, MaxCharactersFromEntities = 1024L * 1024L)
109+
110+
let parseWithReader xmlText =
111+
use stringReader = new StringReader(xmlText)
112+
use xmlReader = XmlReader.Create(stringReader, xmlReaderSettings)
113+
XDocument.Load(xmlReader, LoadOptions.PreserveWhitespace)
114+
72115
try
73-
XDocument.Parse(text, LoadOptions.PreserveWhitespace).Root.Elements()
116+
(parseWithReader text).Root.Elements()
74117
|> Seq.map (fun value -> { XElement = value })
75118
|> Seq.toArray
76119
with _ when text.TrimStart().StartsWith "<" ->
77-
XDocument.Parse("<root>" + text + "</root>", LoadOptions.PreserveWhitespace).Root.Elements()
120+
(parseWithReader ("<root>" + text + "</root>")).Root.Elements()
78121
|> Seq.map (fun value -> { XElement = value })
79122
|> Seq.toArray
80123

tests/FSharp.Data.DesignTime.Tests/TypeProviderInstantiation.fs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ type internal XmlProviderArgs =
4242
Schema : string
4343
InferenceMode: InferenceMode
4444
PreferDateOnly : bool
45+
DtdProcessing : string
4546
UseOriginalNames : bool }
4647

4748
type internal JsonProviderArgs =
@@ -119,6 +120,7 @@ type internal TypeProviderInstantiation =
119120
box x.Schema
120121
box x.InferenceMode
121122
box x.PreferDateOnly
123+
box x.DtdProcessing
122124
box x.UseOriginalNames |]
123125
| Json x ->
124126
(fun cfg -> new JsonProvider(cfg) :> TypeProviderForNamespaces),
@@ -257,6 +259,7 @@ type internal TypeProviderInstantiation =
257259
Schema = args.[6]
258260
InferenceMode = args.[7] |> InferenceMode.Parse
259261
PreferDateOnly = false
262+
DtdProcessing = "Ignore"
260263
UseOriginalNames = false }
261264
| "Json" ->
262265
// Handle special case for Schema.json tests where some fields might be empty

tests/FSharp.Data.DesignTime.Tests/expected/Xml,,False,False,,False,IncludeFromWeb.xsd,BackwardCompatible.expected

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
class XmlProvider : obj
22
static member AsyncLoad: uri:string -> XmlProvider+Foo async
3-
let f = new Func<_,_>(fun (t:TextReader) -> XmlElement.Create(t))
3+
let f = new Func<_,_>(fun (t:TextReader) -> XmlElement.Create(t, "Ignore"))
44
TextRuntime.AsyncMap((IO.asyncReadTextAtRuntime false "<RESOLUTION_FOLDER>" "" "XSD" "" uri), f)
55

66
static member GetSchema: () -> System.Xml.Schema.XmlSchemaSet
77
(XmlSchema.parseSchemaFromTextReader "" FSharpAsync.RunSynchronously((IO.asyncReadTextAtRuntimeWithDesignTimeRules "<RESOLUTION_FOLDER>" "" "XSD" "" "IncludeFromWeb.xsd")))
88

99
static member Load: stream:System.IO.Stream -> XmlProvider+Foo
10-
XmlElement.Create(((new StreamReader(stream)) :> TextReader))
10+
XmlElement.Create(((new StreamReader(stream)) :> TextReader), "Ignore")
1111

1212
static member Load: reader:System.IO.TextReader -> XmlProvider+Foo
13-
XmlElement.Create(reader)
13+
XmlElement.Create(reader, "Ignore")
1414

1515
static member Load: uri:string -> XmlProvider+Foo
16-
XmlElement.Create(FSharpAsync.RunSynchronously((IO.asyncReadTextAtRuntime false "<RESOLUTION_FOLDER>" "" "XSD" "" uri)))
16+
XmlElement.Create(FSharpAsync.RunSynchronously((IO.asyncReadTextAtRuntime false "<RESOLUTION_FOLDER>" "" "XSD" "" uri)), "Ignore")
1717

1818
static member Parse: text:string -> XmlProvider+Foo
19-
XmlElement.Create(((new StringReader(text)) :> TextReader))
19+
XmlElement.Create(((new StringReader(text)) :> TextReader), "Ignore")
2020

2121

2222
class XmlProvider+Foo : FDR.BaseTypes.XmlElement

tests/FSharp.Data.DesignTime.Tests/expected/Xml,,False,False,,False,homonim.xsd,BackwardCompatible.expected

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
class XmlProvider : obj
22
static member AsyncLoad: uri:string -> XmlProvider+X async
3-
let f = new Func<_,_>(fun (t:TextReader) -> XmlElement.Create(t))
3+
let f = new Func<_,_>(fun (t:TextReader) -> XmlElement.Create(t, "Ignore"))
44
TextRuntime.AsyncMap((IO.asyncReadTextAtRuntime false "<RESOLUTION_FOLDER>" "" "XSD" "" uri), f)
55

66
static member GetSchema: () -> System.Xml.Schema.XmlSchemaSet
77
(XmlSchema.parseSchemaFromTextReader "" FSharpAsync.RunSynchronously((IO.asyncReadTextAtRuntimeWithDesignTimeRules "<RESOLUTION_FOLDER>" "" "XSD" "" "homonim.xsd")))
88

99
static member Load: stream:System.IO.Stream -> XmlProvider+X
10-
XmlElement.Create(((new StreamReader(stream)) :> TextReader))
10+
XmlElement.Create(((new StreamReader(stream)) :> TextReader), "Ignore")
1111

1212
static member Load: reader:System.IO.TextReader -> XmlProvider+X
13-
XmlElement.Create(reader)
13+
XmlElement.Create(reader, "Ignore")
1414

1515
static member Load: uri:string -> XmlProvider+X
16-
XmlElement.Create(FSharpAsync.RunSynchronously((IO.asyncReadTextAtRuntime false "<RESOLUTION_FOLDER>" "" "XSD" "" uri)))
16+
XmlElement.Create(FSharpAsync.RunSynchronously((IO.asyncReadTextAtRuntime false "<RESOLUTION_FOLDER>" "" "XSD" "" uri)), "Ignore")
1717

1818
static member Parse: text:string -> XmlProvider+X
19-
XmlElement.Create(((new StringReader(text)) :> TextReader))
19+
XmlElement.Create(((new StringReader(text)) :> TextReader), "Ignore")
2020

2121

2222
class XmlProvider+X : FDR.BaseTypes.XmlElement

tests/FSharp.Data.DesignTime.Tests/expected/Xml,,False,False,,False,po.xsd,BackwardCompatible.expected

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
class XmlProvider : obj
22
static member AsyncLoad: uri:string -> XmlProvider+PurchaseOrder async
3-
let f = new Func<_,_>(fun (t:TextReader) -> XmlElement.Create(t))
3+
let f = new Func<_,_>(fun (t:TextReader) -> XmlElement.Create(t, "Ignore"))
44
TextRuntime.AsyncMap((IO.asyncReadTextAtRuntime false "<RESOLUTION_FOLDER>" "" "XSD" "" uri), f)
55

66
static member GetSchema: () -> System.Xml.Schema.XmlSchemaSet
77
(XmlSchema.parseSchemaFromTextReader "" FSharpAsync.RunSynchronously((IO.asyncReadTextAtRuntimeWithDesignTimeRules "<RESOLUTION_FOLDER>" "" "XSD" "" "po.xsd")))
88

99
static member Load: stream:System.IO.Stream -> XmlProvider+PurchaseOrder
10-
XmlElement.Create(((new StreamReader(stream)) :> TextReader))
10+
XmlElement.Create(((new StreamReader(stream)) :> TextReader), "Ignore")
1111

1212
static member Load: reader:System.IO.TextReader -> XmlProvider+PurchaseOrder
13-
XmlElement.Create(reader)
13+
XmlElement.Create(reader, "Ignore")
1414

1515
static member Load: uri:string -> XmlProvider+PurchaseOrder
16-
XmlElement.Create(FSharpAsync.RunSynchronously((IO.asyncReadTextAtRuntime false "<RESOLUTION_FOLDER>" "" "XSD" "" uri)))
16+
XmlElement.Create(FSharpAsync.RunSynchronously((IO.asyncReadTextAtRuntime false "<RESOLUTION_FOLDER>" "" "XSD" "" uri)), "Ignore")
1717

1818
static member Parse: text:string -> XmlProvider+PurchaseOrder
19-
XmlElement.Create(((new StringReader(text)) :> TextReader))
19+
XmlElement.Create(((new StringReader(text)) :> TextReader), "Ignore")
2020

2121

2222
class XmlProvider+PurchaseOrder : FDR.BaseTypes.XmlElement

tests/FSharp.Data.DesignTime.Tests/expected/Xml,AnyFeed.xml,True,False,,True,,BackwardCompatible.expected

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
class XmlProvider : obj
22
static member AsyncGetSamples: () -> XmlProvider+XmlProvider+Choice[] async
3-
let f = new Func<_,_>(fun (t:TextReader) -> XmlElement.CreateList(t))
3+
let f = new Func<_,_>(fun (t:TextReader) -> XmlElement.CreateList(t, "Ignore"))
44
TextRuntime.AsyncMap((IO.asyncReadTextAtRuntimeWithDesignTimeRules "<RESOLUTION_FOLDER>" "" "XML" "" "AnyFeed.xml"), f)
55

66
static member AsyncLoad: uri:string -> XmlProvider+Choice async
7-
let f = new Func<_,_>(fun (t:TextReader) -> XmlElement.Create(t))
7+
let f = new Func<_,_>(fun (t:TextReader) -> XmlElement.Create(t, "Ignore"))
88
TextRuntime.AsyncMap((IO.asyncReadTextAtRuntime false "<RESOLUTION_FOLDER>" "" "XML" "" uri), f)
99

1010
static member GetSamples: () -> XmlProvider+XmlProvider+Choice[]
11-
XmlElement.CreateList(FSharpAsync.RunSynchronously((IO.asyncReadTextAtRuntimeWithDesignTimeRules "<RESOLUTION_FOLDER>" "" "XML" "" "AnyFeed.xml")))
11+
XmlElement.CreateList(FSharpAsync.RunSynchronously((IO.asyncReadTextAtRuntimeWithDesignTimeRules "<RESOLUTION_FOLDER>" "" "XML" "" "AnyFeed.xml")), "Ignore")
1212

1313
static member Load: stream:System.IO.Stream -> XmlProvider+Choice
14-
XmlElement.Create(((new StreamReader(stream)) :> TextReader))
14+
XmlElement.Create(((new StreamReader(stream)) :> TextReader), "Ignore")
1515

1616
static member Load: reader:System.IO.TextReader -> XmlProvider+Choice
17-
XmlElement.Create(reader)
17+
XmlElement.Create(reader, "Ignore")
1818

1919
static member Load: uri:string -> XmlProvider+Choice
20-
XmlElement.Create(FSharpAsync.RunSynchronously((IO.asyncReadTextAtRuntime false "<RESOLUTION_FOLDER>" "" "XML" "" uri)))
20+
XmlElement.Create(FSharpAsync.RunSynchronously((IO.asyncReadTextAtRuntime false "<RESOLUTION_FOLDER>" "" "XML" "" uri)), "Ignore")
2121

2222
static member Parse: text:string -> XmlProvider+Choice
23-
XmlElement.Create(((new StringReader(text)) :> TextReader))
23+
XmlElement.Create(((new StringReader(text)) :> TextReader), "Ignore")
2424

2525

2626
class XmlProvider+Choice : FDR.BaseTypes.XmlElement

tests/FSharp.Data.DesignTime.Tests/expected/Xml,AnyFeed.xml,True,False,,True,,ValuesAndInlineSchemasHints.expected

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
class XmlProvider : obj
22
static member AsyncGetSamples: () -> XmlProvider+XmlProvider+Choice[] async
3-
let f = new Func<_,_>(fun (t:TextReader) -> XmlElement.CreateList(t))
3+
let f = new Func<_,_>(fun (t:TextReader) -> XmlElement.CreateList(t, "Ignore"))
44
TextRuntime.AsyncMap((IO.asyncReadTextAtRuntimeWithDesignTimeRules "<RESOLUTION_FOLDER>" "" "XML" "" "AnyFeed.xml"), f)
55

66
static member AsyncLoad: uri:string -> XmlProvider+Choice async
7-
let f = new Func<_,_>(fun (t:TextReader) -> XmlElement.Create(t))
7+
let f = new Func<_,_>(fun (t:TextReader) -> XmlElement.Create(t, "Ignore"))
88
TextRuntime.AsyncMap((IO.asyncReadTextAtRuntime false "<RESOLUTION_FOLDER>" "" "XML" "" uri), f)
99

1010
static member GetSamples: () -> XmlProvider+XmlProvider+Choice[]
11-
XmlElement.CreateList(FSharpAsync.RunSynchronously((IO.asyncReadTextAtRuntimeWithDesignTimeRules "<RESOLUTION_FOLDER>" "" "XML" "" "AnyFeed.xml")))
11+
XmlElement.CreateList(FSharpAsync.RunSynchronously((IO.asyncReadTextAtRuntimeWithDesignTimeRules "<RESOLUTION_FOLDER>" "" "XML" "" "AnyFeed.xml")), "Ignore")
1212

1313
static member Load: stream:System.IO.Stream -> XmlProvider+Choice
14-
XmlElement.Create(((new StreamReader(stream)) :> TextReader))
14+
XmlElement.Create(((new StreamReader(stream)) :> TextReader), "Ignore")
1515

1616
static member Load: reader:System.IO.TextReader -> XmlProvider+Choice
17-
XmlElement.Create(reader)
17+
XmlElement.Create(reader, "Ignore")
1818

1919
static member Load: uri:string -> XmlProvider+Choice
20-
XmlElement.Create(FSharpAsync.RunSynchronously((IO.asyncReadTextAtRuntime false "<RESOLUTION_FOLDER>" "" "XML" "" uri)))
20+
XmlElement.Create(FSharpAsync.RunSynchronously((IO.asyncReadTextAtRuntime false "<RESOLUTION_FOLDER>" "" "XML" "" uri)), "Ignore")
2121

2222
static member Parse: text:string -> XmlProvider+Choice
23-
XmlElement.Create(((new StringReader(text)) :> TextReader))
23+
XmlElement.Create(((new StringReader(text)) :> TextReader), "Ignore")
2424

2525

2626
class XmlProvider+Choice : FDR.BaseTypes.XmlElement

tests/FSharp.Data.DesignTime.Tests/expected/Xml,AnyFeed.xml,True,False,,True,,ValuesAndInlineSchemasOverrides.expected

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
class XmlProvider : obj
22
static member AsyncGetSamples: () -> XmlProvider+XmlProvider+Choice[] async
3-
let f = new Func<_,_>(fun (t:TextReader) -> XmlElement.CreateList(t))
3+
let f = new Func<_,_>(fun (t:TextReader) -> XmlElement.CreateList(t, "Ignore"))
44
TextRuntime.AsyncMap((IO.asyncReadTextAtRuntimeWithDesignTimeRules "<RESOLUTION_FOLDER>" "" "XML" "" "AnyFeed.xml"), f)
55

66
static member AsyncLoad: uri:string -> XmlProvider+Choice async
7-
let f = new Func<_,_>(fun (t:TextReader) -> XmlElement.Create(t))
7+
let f = new Func<_,_>(fun (t:TextReader) -> XmlElement.Create(t, "Ignore"))
88
TextRuntime.AsyncMap((IO.asyncReadTextAtRuntime false "<RESOLUTION_FOLDER>" "" "XML" "" uri), f)
99

1010
static member GetSamples: () -> XmlProvider+XmlProvider+Choice[]
11-
XmlElement.CreateList(FSharpAsync.RunSynchronously((IO.asyncReadTextAtRuntimeWithDesignTimeRules "<RESOLUTION_FOLDER>" "" "XML" "" "AnyFeed.xml")))
11+
XmlElement.CreateList(FSharpAsync.RunSynchronously((IO.asyncReadTextAtRuntimeWithDesignTimeRules "<RESOLUTION_FOLDER>" "" "XML" "" "AnyFeed.xml")), "Ignore")
1212

1313
static member Load: stream:System.IO.Stream -> XmlProvider+Choice
14-
XmlElement.Create(((new StreamReader(stream)) :> TextReader))
14+
XmlElement.Create(((new StreamReader(stream)) :> TextReader), "Ignore")
1515

1616
static member Load: reader:System.IO.TextReader -> XmlProvider+Choice
17-
XmlElement.Create(reader)
17+
XmlElement.Create(reader, "Ignore")
1818

1919
static member Load: uri:string -> XmlProvider+Choice
20-
XmlElement.Create(FSharpAsync.RunSynchronously((IO.asyncReadTextAtRuntime false "<RESOLUTION_FOLDER>" "" "XML" "" uri)))
20+
XmlElement.Create(FSharpAsync.RunSynchronously((IO.asyncReadTextAtRuntime false "<RESOLUTION_FOLDER>" "" "XML" "" uri)), "Ignore")
2121

2222
static member Parse: text:string -> XmlProvider+Choice
23-
XmlElement.Create(((new StringReader(text)) :> TextReader))
23+
XmlElement.Create(((new StringReader(text)) :> TextReader), "Ignore")
2424

2525

2626
class XmlProvider+Choice : FDR.BaseTypes.XmlElement

0 commit comments

Comments
 (0)