How do I parse XML file from Wordpress for use in another CMS? The Next CEO of Stack OverflowHow does one parse XML files?How do I parse a string to a float or int in Python?How do I parse XML in Python?How do I get a YouTube video thumbnail from the YouTube API?How to parse JSON in JavaHow do I comment out a block of tags in XML?Why can't Python parse this JSON data?How Do You Parse and Process HTML/XML in PHP?PHP parse/syntax errors; and how to solve them?Wordpress XML Media Import with HTTP Authentication

Skipping indices in a product

How did the Bene Gesserit know how to make a Kwisatz Haderach?

Won the lottery - how do I keep the money?

Why am I allowed to create multiple unique pointers from a single object?

Is it my responsibility to learn a new technology in my own time my employer wants to implement?

What happened in Rome, when the western empire "fell"?

If/When UK leaves the EU, can a future goverment conduct a referendum to join the EU?

Why do we use the plural of movies in this phrase "We went to the movies last night."?

How to solve a differential equation with a term to a power?

Should I tutor a student who I know has cheated on their homework?

MessageLevel in QGIS3

Limits on contract work without pre-agreed price/contract (UK)

How to start emacs in "nothing" mode (`fundamental-mode`)

Help understanding this unsettling image of Titan, Epimetheus, and Saturn's rings?

What does convergence in distribution "in the Gromov–Hausdorff" sense mean?

In excess I'm lethal

To not tell, not take, and not want

Can I equip Skullclamp on a creature I am sacrificing?

Can you replace a racial trait cantrip when leveling up?

Sending manuscript to multiple publishers

WOW air has ceased operation, can I get my tickets refunded?

Can I run my washing machine drain line into a condensate pump so it drains better?

How do I avoid eval and parse?

How do scammers retract money, while you can’t?



How do I parse XML file from Wordpress for use in another CMS?



The Next CEO of Stack OverflowHow does one parse XML files?How do I parse a string to a float or int in Python?How do I parse XML in Python?How do I get a YouTube video thumbnail from the YouTube API?How to parse JSON in JavaHow do I comment out a block of tags in XML?Why can't Python parse this JSON data?How Do You Parse and Process HTML/XML in PHP?PHP parse/syntax errors; and how to solve them?Wordpress XML Media Import with HTTP Authentication










-1















I'm finding that the resources for doing this are sparse. I'm using MODX as a CMS and want to take my existing blogs from Wordpress and use them in the new CMS. The resources are abundant for going from MODX to WP, but there's only one published method for WP to MODX, using the Articles method, which unfortunately doesn't work anymore. Whether that is because Articles hasn't been updated or the XML file from WP is incompatible.



Anyway, I'm left now with trying to do this the old fashioned way and I will not be able to bring each article over one-by-one. I want to learn how to take the exported XML file from WP and parse it into MODX, probably using PHP. But I'm unsure where to start.



Any suggestions would be helpful...yes I tried Google already. I'm not sure what to start with.



Thanks!










share|improve this question


























    -1















    I'm finding that the resources for doing this are sparse. I'm using MODX as a CMS and want to take my existing blogs from Wordpress and use them in the new CMS. The resources are abundant for going from MODX to WP, but there's only one published method for WP to MODX, using the Articles method, which unfortunately doesn't work anymore. Whether that is because Articles hasn't been updated or the XML file from WP is incompatible.



    Anyway, I'm left now with trying to do this the old fashioned way and I will not be able to bring each article over one-by-one. I want to learn how to take the exported XML file from WP and parse it into MODX, probably using PHP. But I'm unsure where to start.



    Any suggestions would be helpful...yes I tried Google already. I'm not sure what to start with.



    Thanks!










    share|improve this question
























      -1












      -1








      -1








      I'm finding that the resources for doing this are sparse. I'm using MODX as a CMS and want to take my existing blogs from Wordpress and use them in the new CMS. The resources are abundant for going from MODX to WP, but there's only one published method for WP to MODX, using the Articles method, which unfortunately doesn't work anymore. Whether that is because Articles hasn't been updated or the XML file from WP is incompatible.



      Anyway, I'm left now with trying to do this the old fashioned way and I will not be able to bring each article over one-by-one. I want to learn how to take the exported XML file from WP and parse it into MODX, probably using PHP. But I'm unsure where to start.



      Any suggestions would be helpful...yes I tried Google already. I'm not sure what to start with.



      Thanks!










      share|improve this question














      I'm finding that the resources for doing this are sparse. I'm using MODX as a CMS and want to take my existing blogs from Wordpress and use them in the new CMS. The resources are abundant for going from MODX to WP, but there's only one published method for WP to MODX, using the Articles method, which unfortunately doesn't work anymore. Whether that is because Articles hasn't been updated or the XML file from WP is incompatible.



      Anyway, I'm left now with trying to do this the old fashioned way and I will not be able to bring each article over one-by-one. I want to learn how to take the exported XML file from WP and parse it into MODX, probably using PHP. But I'm unsure where to start.



      Any suggestions would be helpful...yes I tried Google already. I'm not sure what to start with.



      Thanks!







      php xml wordpress parsing modx






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 7 at 15:26









      Jeff SydorJeff Sydor

      297




      297






















          1 Answer
          1






          active

          oldest

          votes


















          0














          getFeed snippet code can be helpful for you here. You can take it's code, modify a bit and process WP feed items, something like the next:



          if (!empty($url) && $modx->getService('rss', 'xmlrss.modRSSParser')) {
          $rss = $modx->rss->parse($url);
          if (!empty($rss) && isset($rss->items))
          while (list($itemKey, $item) = each($rss->items))
          foreach ($item as $k => $v)
          $item[$k] = str_replace(array('[',']'),array('[',']'),$item[$k]);

          /// process rss items here
          // f.e. add new modx resources
          $newArticle = $this->modx->newObject('modResource'); //new article
          $newArticle->set( 'template', ARTICLE_TEMPLATE_ID ); // replace ARTICLE_TEMPLATE_ID with actual article template id
          $newArticle->set( 'pagetitle', $item['title'] ); // pagetitle
          $newArticle->set( 'parent', ARTICLE_CONTAINTER_ID);
          $newArticle->set( 'content', $item['description'] );

          //add other valuable fields

          if(!$newArticle->save())
          // modx error









          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55047322%2fhow-do-i-parse-xml-file-from-wordpress-for-use-in-another-cms%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            getFeed snippet code can be helpful for you here. You can take it's code, modify a bit and process WP feed items, something like the next:



            if (!empty($url) && $modx->getService('rss', 'xmlrss.modRSSParser')) {
            $rss = $modx->rss->parse($url);
            if (!empty($rss) && isset($rss->items))
            while (list($itemKey, $item) = each($rss->items))
            foreach ($item as $k => $v)
            $item[$k] = str_replace(array('[',']'),array('[',']'),$item[$k]);

            /// process rss items here
            // f.e. add new modx resources
            $newArticle = $this->modx->newObject('modResource'); //new article
            $newArticle->set( 'template', ARTICLE_TEMPLATE_ID ); // replace ARTICLE_TEMPLATE_ID with actual article template id
            $newArticle->set( 'pagetitle', $item['title'] ); // pagetitle
            $newArticle->set( 'parent', ARTICLE_CONTAINTER_ID);
            $newArticle->set( 'content', $item['description'] );

            //add other valuable fields

            if(!$newArticle->save())
            // modx error









            share|improve this answer



























              0














              getFeed snippet code can be helpful for you here. You can take it's code, modify a bit and process WP feed items, something like the next:



              if (!empty($url) && $modx->getService('rss', 'xmlrss.modRSSParser')) {
              $rss = $modx->rss->parse($url);
              if (!empty($rss) && isset($rss->items))
              while (list($itemKey, $item) = each($rss->items))
              foreach ($item as $k => $v)
              $item[$k] = str_replace(array('[',']'),array('[',']'),$item[$k]);

              /// process rss items here
              // f.e. add new modx resources
              $newArticle = $this->modx->newObject('modResource'); //new article
              $newArticle->set( 'template', ARTICLE_TEMPLATE_ID ); // replace ARTICLE_TEMPLATE_ID with actual article template id
              $newArticle->set( 'pagetitle', $item['title'] ); // pagetitle
              $newArticle->set( 'parent', ARTICLE_CONTAINTER_ID);
              $newArticle->set( 'content', $item['description'] );

              //add other valuable fields

              if(!$newArticle->save())
              // modx error









              share|improve this answer

























                0












                0








                0







                getFeed snippet code can be helpful for you here. You can take it's code, modify a bit and process WP feed items, something like the next:



                if (!empty($url) && $modx->getService('rss', 'xmlrss.modRSSParser')) {
                $rss = $modx->rss->parse($url);
                if (!empty($rss) && isset($rss->items))
                while (list($itemKey, $item) = each($rss->items))
                foreach ($item as $k => $v)
                $item[$k] = str_replace(array('[',']'),array('[',']'),$item[$k]);

                /// process rss items here
                // f.e. add new modx resources
                $newArticle = $this->modx->newObject('modResource'); //new article
                $newArticle->set( 'template', ARTICLE_TEMPLATE_ID ); // replace ARTICLE_TEMPLATE_ID with actual article template id
                $newArticle->set( 'pagetitle', $item['title'] ); // pagetitle
                $newArticle->set( 'parent', ARTICLE_CONTAINTER_ID);
                $newArticle->set( 'content', $item['description'] );

                //add other valuable fields

                if(!$newArticle->save())
                // modx error









                share|improve this answer













                getFeed snippet code can be helpful for you here. You can take it's code, modify a bit and process WP feed items, something like the next:



                if (!empty($url) && $modx->getService('rss', 'xmlrss.modRSSParser')) {
                $rss = $modx->rss->parse($url);
                if (!empty($rss) && isset($rss->items))
                while (list($itemKey, $item) = each($rss->items))
                foreach ($item as $k => $v)
                $item[$k] = str_replace(array('[',']'),array('[',']'),$item[$k]);

                /// process rss items here
                // f.e. add new modx resources
                $newArticle = $this->modx->newObject('modResource'); //new article
                $newArticle->set( 'template', ARTICLE_TEMPLATE_ID ); // replace ARTICLE_TEMPLATE_ID with actual article template id
                $newArticle->set( 'pagetitle', $item['title'] ); // pagetitle
                $newArticle->set( 'parent', ARTICLE_CONTAINTER_ID);
                $newArticle->set( 'content', $item['description'] );

                //add other valuable fields

                if(!$newArticle->save())
                // modx error










                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 16 at 12:08









                Anton TarasovAnton Tarasov

                312




                312





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55047322%2fhow-do-i-parse-xml-file-from-wordpress-for-use-in-another-cms%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

                    Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

                    Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved