Solution 1 :

Maybe have also a look to that Stack Overflow – How to add a newline (line break) in XML file?

And use instead of <br/>

Line Feed LF: "&#xA;"
Carriage Return CR: "&#xD;"

Solution 2 :

CDATA is not interpreted as markup, so your <br/> is only interpreted as Character DATA.

Change

<article-content>
    <![CDATA[TEXT, JUST A LOT OF TEXT<br/> EVEN MORE TEXT]]>
</article-content>

to

<article-content>
    TEXT, JUST A LOT OF TEXT<br/> EVEN MORE TEXT
</article-content>

or

<article-content>
    <![CDATA[TEXT, JUST A LOT OF TEXT
EVEN MORE TEXT]]>
</article-content>

or

<article-content>
    <![CDATA[TEXT, JUST A LOT OF TEXT]]><br/> <![CDATA[EVEN MORE TEXT]]>
</article-content>

to have <br/> be interpreted as markup.

See also

Problem :

I’m trying to write an XML-Newsfeed for WordPress that can be imported through a plugin and then put in to article-section where it can be edited and so on.

This is what i have:

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

<content>
<article id="1">
    <mainid>
        <![CDATA[DE20201201]]>
    </mainid>
    <titel>
        <![CDATA[Titel]]>
    </titel>
    <picture>
        <![CDATA[https://link.png]]>
    </picture>
    <article-content>
        <![CDATA[TEXT, JUST A LOT OF TEXT<br/> EVEN MORE TEXT]]>
    </article-content>
    <pubdate>2020-12-01 00:00:59</pubdate>
</article>
</content>

My Problem is that the “<br/>“‘s in the element are not interpreted as an actual new line in the article in WordPress.

I’m a total noob at this stuff, i know there’s stuff like xsl and xslt but I’m not sure how all of that is working.

Comments

Comment posted by KargWare

Have you tried the escapes r or n instead of

Comment posted by not sure

won’t work, the feed has to be in html

Comment posted by kjhughes

Plus one for the link to the canonical newline / line-break Q/A. 😉 Whether this will work will depend upon how the processing application treats the passed-through

Comment posted by KargWare

these old guys will never disappear

Comment posted by kjhughes

Lol, my old self or my my old answers?

Comment posted by KargWare

Sorry I did not recognize that I share your own answer! I was thinking about the old LF or CR stuff …

Comment posted by kjhughes

No problem, you recognized its relevance before I did!

By