Skip to Content
Aug 17, 2016 at 12:44 PM

Including XML-Fragment into HTML-View


Hey everyone,

I have an issue while implementing SAPUI5 and I could not find an answer on the internet.

Maybe someone here can help me 😊

It's the following problem:

I have a fragment, written in XML (Head.fragment.xml) and a view, written in HTML (Overiew.view.html).

The other views I have are written in XML and there I can include my fragment with




<core:Fragment fragmentName="xy.view.Head" type="XML"/>




But how can I include it in an HTML-View?

I tried

<div data-sap-ui-type="sap.m.App">

<div data-sap-ui-type="sap.m.Page">

<div data-sap-ui-type="sap.ui.core.Fragment" data-fragment-name="xy.view.Header" data-type="XML">

But I get the error "please provide a fragment name".

I still use a controller for the view, so this answer sap - Using html fragments with declarative html views - Stack Overflow didn't work for me.

Thanks in advance for every answer!