Skip to content

Commit

Permalink
Merge pull request #102 from ElderVivot/master
Browse files Browse the repository at this point in the history
feat: implement config in XmlParser from_xml
  • Loading branch information
rvalyi committed May 26, 2024
2 parents 5baba19 + 3d37984 commit 5c34247
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions nfelib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ class CommonMixin:
namespace = None

@classmethod
def from_xml(cls, xml: str) -> Any:
def from_xml(cls, xml: str, config=None) -> Any:
"""Parse xml and retun an instance of the class."""
return XmlParser().from_string(xml)
if config is None:
return XmlParser().from_string(xml)
else:
return XmlParser(config=config).from_string(xml)

@classmethod
def from_path(cls, path: str) -> Any:
Expand Down

0 comments on commit 5c34247

Please sign in to comment.