-
Notifications
You must be signed in to change notification settings - Fork 222
Adds pointer tag parsing implementation in parse_xml
#830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
b3eb22a
to
5e0828f
Compare
This PR is ready for review. |
15c9d82
to
cd7ba89
Compare
fd3b0eb
to
d247d0d
Compare
bc0a1f5
to
fe49706
Compare
I didn't test this PR manually, I am trusting Tayyab good domain knowledge and testing on it |
@kdmccormick |
fe49706
to
d8f02a9
Compare
Yep, this is in my queue Tayyab, sorry for my slowness. |
No worries |
def load_definition_xml(node, runtime, def_id): | ||
""" | ||
Parses and loads an XML definition file based on a given node, runtime | ||
environment, and definition ID. | ||
|
||
Arguments: | ||
node: XML element containing attributes for definition loading. | ||
runtime: The runtime environment that provides resource access. | ||
def_id: Unique identifier for the definition being loaded. | ||
|
||
Returns: | ||
tuple: A tuple containing the loaded XML definition and the | ||
corresponding file path. | ||
""" | ||
url_name = node.get('url_name') | ||
filepath = format_filepath(node.tag, name_to_pathname(url_name)) | ||
definition_xml = load_file(filepath, runtime.resources_fs, def_id) | ||
return definition_xml, filepath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this work in xblock-sdk as well, or is this logic specific to edx-platform?
If it is specific to edx-platform, then we want want to go through a Runtime method instead, so that edx-platform and xblock-sdk can implement it differently.
Co-authored-by: Kyle McCormick <[email protected]>
6139828
to
8f6f7e0
Compare
The implementation has been taken from
XmlMixin
's pointer tags parsing logic.Testing Notes:
Overall bug investigation ticket: openedx/edx-platform#36390