Announcement

Collapse
No announcement yet.

Create and Schedule XML Data Feed

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Create and Schedule XML Data Feed

    I've been working with the new data feed environment (Miva 9.0064) that is located in the Marketing area. I was able to create 2 different .txt data feeds and schedule them for weekly updates (works perfect). However, I need to setup a .xml data feed for another company that is still using a data feed that I originally created using the old technology (module). I want to be able to set a weekly update schedule so I need to create a new .xml within the new Marketing environment. Once I've created it, run and scheduled then I try to view it, it throws a parsing error. Anyone have any suggestions?
    Thanks, Candy
    http://www.lorisgolfshoppe.com

    #2
    Well, I think to give someone an idea we'd need to see the actual feed.
    Bruce Golub
    Phosphor Media - "Your Success is our Business"

    Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
    phosphormedia.com

    Comment


      #3
      This is the original feed - http://lorisgolfshoppe.com/lorisgolf...-brainsins.xml

      I'm using this code to generate:

      <entity name="product">
      <property name="idProduct">%product:id%</property>
      <property name="name">%product:name%</property>
      <property name="url">http://lorisgolfshoppe.com/p/%product:code%.html</property>
      <property name="imageUrl">%image:custom_required%</property>
      <property name="price">%product:price%</property>
      <property name="categories">%category:name%</property>
      </entity>

      Because the new data feed environment is so much easier, I don't know how to apply this code to it and get an .xml data feed in return.
      Thanks, Candy
      http://www.lorisgolfshoppe.com

      Comment


        #4
        You probably need to wrap things like name, url, image, in CDATA, i.e.:

        <property name="url"><![CDATA[ http://lorisgolfshoppe.com/p/%product:code%.html ]]</property>
        (Add bolded)
        Bruce Golub
        Phosphor Media - "Your Success is our Business"

        Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
        phosphormedia.com

        Comment


          #5
          I am using the new data feed under marketing. It's like a wizard where you SELECT each variable. Where/How would I do this? Have you used the new data feed environment?
          Thanks, Candy
          http://www.lorisgolfshoppe.com

          Comment


            #6
            No, sorry. I haven't used any of the built in feeds. I was just responding to your example output.
            Bruce Golub
            Phosphor Media - "Your Success is our Business"

            Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
            phosphormedia.com

            Comment


              #7
              when editing the feed page you can click on advanced module to see the template code generating the feed. Here is where you can customize the feed template to add the cdata tags. Miva has a new function you can use

              http://docs.miva.com/mivascript/miva_cdata_encode

              Or you can manually add them wrapped around the variables you need.
              Brennan Heyde
              VP Product
              Miva, Inc.
              [email protected]
              https://www.miva.com

              Comment


                #8
                I see where I can change to the advanced module area and input my own code. I followed your lead but not sure it's correct:

                <entity name="product">
                <property name="idProduct"><![CDATA[ %product:id%]]</property>
                <property name="name"><![CDATA[ %product:name%]]</property>
                <property name="url"><![CDATA[ http://lorisgolfshoppe.com/p/%product:code%.html]]</property>
                <property name="imageUrl"><![CDATA[ %image:custom_required%]]</property>
                <property name="price"><![CDATA[ %product:price%]]</property>
                <property name="categories"><![CDATA[ %category:name%]]</property>
                </entity>


                Here's a link to the feed:
                http://lorisgolfshoppe.com/lorisgolf...-brainsins.xml

                When I view the feed, it shows this error:
                XML Parsing Error: unclosed CDATA section
                Location: http://lorisgolfshoppe.com/lorisgolf...-brainsins.xml
                Line Number 20780, Column 11:</recsins>
                ----------^

                Really appreciate you help! I am way out of my league on this one.
                Thanks, Candy
                http://www.lorisgolfshoppe.com

                Comment


                  #9
                  Your output looks like the 'tokens' you are using are not being evaluated. They remain "<![CDATA[ %product:id%]]</property>" Again, I haven't used the miva feeds, but you may need to use standard SMT variables like &mvt:product:id; instead of %product:id%
                  Bruce Golub
                  Phosphor Media - "Your Success is our Business"

                  Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
                  phosphormedia.com

                  Comment


                    #10
                    This is the code I used but the only thing that shows is <property name="url"><![CDATA[&mvt:record:url;]]</property>. Everything else is blank.


                    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
                    <recsins version="0.1">
                    <entities>
                    <entity name="product">
                    <property name="idProduct"><![CDATA[&mvt:record:code]]</property>
                    <property name="name"><![CDATA[&mvt:record:name]]</property>
                    <property name="url"><![CDATA[&mvt:record:url;]]</property>
                    <property name="imageUrl"><![CDATA[&mvt:record:image%]]</property>
                    <property name="price"><![CDATA[&mvt:record:price]]</property>
                    <property name="categories"><![CDATA[&mvt:record:canonical_category]]</property>
                    </entity>
                    </entities>
                    </recsins>

                    Sorry, but I really need help. Appreciate your help!!!
                    Thanks, Candy
                    http://www.lorisgolfshoppe.com

                    Comment


                      #11
                      You're missing the semicolons after all of the SMT variables except the url which is why it is woking, ie. &mvt:record:name;

                      Comment


                        #12
                        OK...we are getting there!!! Looks like something I'm missing something at the end of the code. Here's the error message:

                        XML Parsing Error: unclosed CDATA section
                        Location: http://lorisgolfshoppe.com/lorisgolf...-brainsins.xml
                        Line Number 20752, Column 11:</recsins>
                        ----------^

                        Thanks, Candy
                        http://www.lorisgolfshoppe.com

                        Comment


                          #13
                          CDATA sections are not properly closed:
                          <![CDATA[ CONTENTS ]]>

                          Comment


                            #14
                            I know this is terribly old thread. But I"m curious about the miva_cdata_encode

                            When would you actually want to use this?

                            For example, this is a snippet of a template ...
                            Code:
                            <firstname><mvt:eval expr="miva_cdata_encode( l.settings:order:bill_fname )" /></firstname>&mvt:global:mseol; &mvt:global:tab; <lastname><mvt:eval expr="miva_cdata_encode( l.settings:order:bill_lname )" /></lastname>&mvt:global:mseol; &mvt:global:tab; <fullname><mvt:eval expr="miva_cdata_encode( l.settings:order:bill_fname $ ' ' $ l.settings:order:bill_lname )" /></fullname>&mvt:global:mseol; &mvt:global:tab; <email><mvt:eval expr="miva_cdata_encode( l.settings:order:bill_email )" /></email> &mvt:global:mseol; <mvt:comment>change this to account password email so accounts will always sync up</mvt:comment>
                            BUT, what if someone uses a bracket in their company name or some weird thing...

                            I guess I don't understand how miva_cdata_encode works.

                            if I have
                            bill_fname = 'bill'


                            does
                            Code:
                            <mvt:eval expr="miva_cdata_encode( l.settings:order:bill_fname )" />
                            output
                            <!CDATA[[bill]]>

                            and if bill_fname='bill[[bob]]smith'
                            would it output
                            <!CDATA[[bill[[bob]]><!CDATA[[smith]]>
                            ?

                            I'm trying to understand Brennans explanation and the dev docs.

                            Comment


                              #15
                              My understanding of your question and what the doc says, the output would/should be:

                              Code:
                               <!CDATA[[bill[[bob]]smith]]>
                              Skipping ahead, It's possible it would break the XML for that tag. When this is read by the XML parsing function I am guessing the issue would be the first set of closing square brackets after bob. I am not sure if escaping the characters would work for that scenario. Depends on what your CDATA string value should be.

                              Scott





                              Need to offer Shipping Insurance?
                              Interactive Design Solutions https://www.myids.net
                              MivaMerchant Business Partner | Certified MivaMerchant Web Developer
                              Competitive Rates, Custom Modules and Integrations, Store Integration
                              AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
                              My T-shirt Collection is mostly MivaCon T-shirts!!

                              Comment

                              Working...
                              X