Search

Hi. I’m going to port my blog from Wordpress to Symphony. I tried to import the entries using bauhouse tutorial but I have a problems.

I get an error:

XSLTProcessor::transformToXml(): runtime error: file /Users/antonio/Sites/MAMP/symphony206/workspace/pages/import.xsl line 24 element choose

Line 24 says:

<xsl:choose>
        <xsl:when test="$a"><xsl:value-of select="$a"/></xsl:when>
        <xsl:otherwise>1</xsl:otherwise>
    </xsl:choose>

Any ideas? Thanks

Is it possible that the $a parameter isn’t being set in your URL?

I have the same issue, and I am new to Symphony. How the $a parameter can be set in URL? Can you give an example? Thank you.

i think what craig is referring to are the URL Parameters when you create a page. the variable a could be set as a URL Parameter, which in turn would have its value set in the url of that page.

as far as i understand it, in order for some variable to be referenced, it has to be created prior to it’s use, even if there is no set value to the variable. To ensure that you have access to $a, you can set it as a xsl:param outside of any template so that it will be global variable:

<xsl:param name="a" />
<xsl:template match="data">
...

Thanks wtdtan, that helped with the error.

Now, I can see import page. I see all the data from my WD xml, but clicking Publish doesn’t do anything, and not entries appear in my Entries section.

Do I have to create matching Fields in Entries section before importing data? Right now only essentials are there.

Thanks for your help! Also my error is gone. I can see the entries in the bottom of the page, but clicking Next ore clicking on the Entries title does not change the content of the fields. Only the content of the first Entry is shown and, like, taiga, no action is performed when hitting the Publish button.

I get the error:

Entry encountered errors when saving.

Category and Section dropdown are void and nothing can be selected.

It seems that no save action is performed, and clicking next, the id on the URL does not chage. Clicking on the titles of the entries result in a new page load (this time with correct id) but the fields report the fist-article content.

I followed Stefen’s tutorial, but there is something I’m doing wrong. Maybe some experienced users can undestand the problem or giving more step-by-step instruction to get an XML imported as Articles.

edit: solved the problem of the ID, I hadn’t specified the URL parameter.

Still getting the:

Entry encountered errors when saving.

Maybe I have to create a specific “Content type” with exact fields? I’m using default Articles as destination Type for import the entries.

not sure if this will show up or not, but is there anything in your manifest/logs/main file?

No, the file exist, there is something like an header but no errors.

Log Created: 2009-09-03T15:28:53+02:00
Symphony Log
Version: 2.0.6

At the moment, this behavior appers to me like magic. If I had more skill on symphony maybe I could give more info.

sigh! :-(

Is the event attached to the page? Is the name of the submit button correct?

puleddu: when you see the error on the page, can you look at your HTML page source? At the bottom should be a bunch of event result data. That should shed some light to the issue.

Woops, I missed a few posts… disregard earlier comment.

For a working example of the WordPress import you could try out the DesignProjectX ensemble. Once you see how this is working, you can duplicate the behaviour in your own Symphony install.

@puleddu You should take a look in this post.

Thank you for your help. Allen’s advice was the way, that’s my first try of Symphony and I didn’t know about those debug info in the bottom. I was wondering, in fact, why error messages were kind a mistery! :-)

<body type="invalid" message="&quot;Body&quot; contains invalid XML. 
The following error was returned:&lt;code&gt;loadXML(): Opening and ending tag mismatch: 
 rootelement line 1 and p in Entity, line: 6&lt;/code&gt;" />

That was my problem, a <p> and </p> tag, I don’t know why. Is there a way to import those html entities the right way? Now I have to understand why the Category and Section dropdown are not populated: they are empty. So is for the Tags input field.

While I’m looking for a solution, if somebody has an idea, it’ll be very appreciated.

By the way, thanks for your help.

I am also struggling with Categories menu. Can somebody explain this code? Where $sym-data/data/categories/entry comes from? Why @id = 15? In case of multiple categories, how should the code look?

<select name="fields[category]">
    <option value=""></option>
    <xsl:for-each select="$sym-data/data/categories/entry">
        <option value="{@id}">
            <xsl:if test="@id = 15">
                <xsl:attribute name="selected">selected</xsl:attribute>
            </xsl:if>
            <xsl:value-of select="title"/>
        </option>
    </xsl:for-each>
</select>

The reason for the $sym-data parameter is to be able to refer to the Symphony-generated XML data while in a for-each instruction that is referring to the imported XML file. This allows the ability to switch the context node within the same template.

The WordPress XML gets imported with this parameter:

<xsl:param name="wordpress-xml" select="document('../assets/xml/wordpress.2009-05-11.xml')"/>

The root node of the Symphony XML data is referred to by this parameter:

<xsl:param name="sym-data" select="/"/>

For the WordPress import, I got lazy when it came to importing categories. But partly because I wanted to assign different categories in Symphony than I had created in WordPress. So, I created a section for Categories before importing the WordPress XML. My Categories XML looks like this:

<categories>
    <section id="3" handle="categories">Categories</section>
    <entry id="11" entries="0" items="0">
        <title handle="applications">Applications</title>
    </entry>
    <entry id="12" entries="0" items="0">
        <title handle="design">Design</title>
    </entry>
    <entry id="13" entries="0" items="0">
        <title handle="history">History</title>
    </entry>
    <entry id="14" entries="0" items="0">
        <title handle="ideas">Ideas</title>
    </entry>
    <entry id="15" entries="36" items="0">
        <title handle="technology">Technology</title>
    </entry>
</categories>

So, if test="@id = 15" simply means that I want the Categories select menu to default to the Technology category. I’ve left the task of pulling in the categories from the WordPress XML as homework. If you successfully complete your homework, please share with the class.

Why I do not have any Category XML in my workspace folder? I have a Category section with 2 Categories in it, but I do not know how is structured the XML as ther is no related XML.

Mmmm…

Another thing, after I import an entry, it is visible on the home page, qhen I click on the title to go inside the article page I have an error:

loadXML(): XML declaration allowed only at the start of the document in Entity, line: 3

Ideas?

So, you have created a Categories section? You have created a Categories data source? And you have added the Categories data source to the page?

Are you using the DesignProjectX ensemble? When I upgraded to Symphony 2.0.4, I omitted the devkits for debugging and viewing profile information. I’ll have to patch that up by adding the Debug DevKit and Profile DevKit extensions.

Not knowing how you are building your XML and XSLT templates, it’s hard to know what might be causing the errors. It sounds like you have included another XML declaration where it should not be:

<?xml version="1.0" encoding="UTF-8"?>

This should only be at the top of your XSL files, like this import.xsl file.

Can you provide a link to your XML and XSLT, using something like Pastie?

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details