Moodle
  1. Moodle
  2. MDL-13157

Create a standard method of writing xml files

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Inactive
    • Affects Version/s: 2.0
    • Fix Version/s: STABLE backlog
    • Component/s: Libraries
    • Labels:
    • Affected Branches:
      MOODLE_20_STABLE

      Description

      Currently we create xml files in a number of different places ( e.g. gradebook, database presets, backups, choices, xmldb) and we haven't got a standard solid way to do it. == bugs and inconsistencies

      We should probably come up with a standard method of writing xml files and covert all previous locations to use it.

        Gliffy Diagrams

          Issue Links

            Activity

            Dan Poltawski created issue -
            Dan Poltawski made changes -
            Field Original Value New Value
            Link This issue has a non-specific relationship to MDL-13088 [ MDL-13088 ]
            Dan Poltawski made changes -
            Issue Type Bug [ 1 ] Improvement [ 4 ]
            Hide
            Penny Leach added a comment -

            Any examples of a good way you think? I need to add this for writing LEAP in the portfolio stuff.

            Show
            Penny Leach added a comment - Any examples of a good way you think? I need to add this for writing LEAP in the portfolio stuff.
            Hide
            Penny Leach added a comment -

            I kind of want to tear out the Mahara LEAP export into a LEAP writing library actually and then just use that in Moodle... it uses smarty at the moment, which I guess isn't an option.

            Show
            Penny Leach added a comment - I kind of want to tear out the Mahara LEAP export into a LEAP writing library actually and then just use that in Moodle... it uses smarty at the moment, which I guess isn't an option.
            Hide
            Sam Marshall added a comment -

            backuplib.php has functions full_tag, start_tag, end_tag, xml_safe_content or something.

            these are not appropriate for use elsewhere but could be the basis for a simple class. Making a stream-based XML-writer is not exactly rocket science - a nice class for it (so that it can do pretty-print and stuff, and throw errors if you write the close tags in the wrong order) should probably be under 100 lines.

            Also note in cases where a (php5) DOM representation already exists in memory then the DOMDocument::saveXML method should be used, regardless of any other stream-based writer implementation that might get done. however if you want to write in a stream way, it isn't efficient to construct an in-memory DOM first, so this may not be a good general approach.

            Show
            Sam Marshall added a comment - backuplib.php has functions full_tag, start_tag, end_tag, xml_safe_content or something. these are not appropriate for use elsewhere but could be the basis for a simple class. Making a stream-based XML-writer is not exactly rocket science - a nice class for it (so that it can do pretty-print and stuff, and throw errors if you write the close tags in the wrong order) should probably be under 100 lines. Also note in cases where a (php5) DOM representation already exists in memory then the DOMDocument::saveXML method should be used, regardless of any other stream-based writer implementation that might get done. however if you want to write in a stream way, it isn't efficient to construct an in-memory DOM first, so this may not be a good general approach.
            Martin Dougiamas made changes -
            Fix Version/s 2.0.1 [ 10420 ]
            Fix Version/s 2.0 [ 10122 ]
            Martin Dougiamas made changes -
            Fix Version/s STABLE backlog [ 10463 ]
            Fix Version/s 2.0.1 [ 10420 ]
            Hide
            Eloy Lafuente (stronk7) added a comment -

            NOTE: This issue was assigned to the STABLE backlog without complete triaging process. Marking it as triaged, but with this note for future reference.

            Show
            Eloy Lafuente (stronk7) added a comment - NOTE: This issue was assigned to the STABLE backlog without complete triaging process. Marking it as triaged, but with this note for future reference.
            Eloy Lafuente (stronk7) made changes -
            Labels triaged
            Martin Dougiamas made changes -
            Workflow jira [ 24544 ] MDL Workflow [ 42959 ]
            Martin Dougiamas made changes -
            Workflow MDL Workflow [ 42959 ] MDL Full Workflow [ 71366 ]
            Martin Dougiamas made changes -
            Assignee Martin Dougiamas [ dougiamas ] moodle.com [ moodle.com ]
            Hide
            Marina Glancy added a comment -

            We have detected that this issue has been inactive for over two years and also did not collect many votes. It is possible that it has been already implemented in a more recent version of Moodle, or it is not highly demanded. There are unlimited number of ways Moodle functinality can be expanded and improved but we would like to concentrate on the features that will benefit majority of users, and which can not be implemented as plugins. If you have a suggestion for improving Moodle core, and there is no open issue for it in the tracker, please start a new forum discussion to see how many other users agree with you, and then create a new issue providing as many details as possible.

            ==BLK2YIMP20141121==

            Show
            Marina Glancy added a comment - We have detected that this issue has been inactive for over two years and also did not collect many votes. It is possible that it has been already implemented in a more recent version of Moodle, or it is not highly demanded. There are unlimited number of ways Moodle functinality can be expanded and improved but we would like to concentrate on the features that will benefit majority of users, and which can not be implemented as plugins. If you have a suggestion for improving Moodle core, and there is no open issue for it in the tracker, please start a new forum discussion to see how many other users agree with you, and then create a new issue providing as many details as possible. ==BLK2YIMP20141121==
            Marina Glancy made changes -
            Status Open [ 1 ] Closed [ 6 ]
            Assignee moodle.com [ moodle.com ]
            Resolution Inactive [ 10000 ]

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: