Skip to content
This repository was archived by the owner on Jun 25, 2020. It is now read-only.

Commit 360e0ee

Browse files
author
Jérémie Bertrand
committed
Merge pull request #257 from thiagoabreu/fix_256
Reading namespaces from attributes
2 parents 6f26330 + 437f7a4 commit 360e0ee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Pretzel.Logic/Import/WordpressImport.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ public void Import()
2626
var xml = fileSystem.File.ReadAllText(pathToImportFile);
2727
var root = XElement.Parse(CleanXml(xml));
2828

29-
XNamespace wp = "http://wordpress.org/export/1.1/";
30-
XNamespace content = "http://purl.org/rss/1.0/modules/content/";
29+
XNamespace wp = root.Attribute("{http://www.w3.org/2000/xmlns/}wp").Value;
30+
XNamespace content = root.Attribute("{http://www.w3.org/2000/xmlns/}content").Value;
3131

3232
var posts = from e in root.Descendants("item")
3333
select new WordpressPost

0 commit comments

Comments
 (0)