Closed hobbeshunter closed 8 years ago
I believe any file content should be wrapped in a <template>
tag. Like so:
header.xml
<?xml version="1.0"?>
<template>
<meta charset="utf-8" />
<title>Title</title>
</template>
Scott
This needs updating, the problem initially is that
<meta charset="utf-8" />
<title>Title</title>
On its own is not valid XML. The rule needs to be either the template needs to be a valid XML file (with a root element) or it needs to be wrapped in tags. I need to do some tests/tweaks for this as the behavior is different for files and strings.
I've updated this to work in a better way. It now acts identically for files and strings.
Templates are wrapped in <template>
tags if there is no <!DOCTYPE
or <?xml
declaration. If you supply a file/string with a doctype or XML declaration it's treated as an entire document, rather than a partial.
Good solution Tom. :+1:
Scott
Hi,
I did something like this:
I had a main html file with an empty
<head>
tag, which I then filled withAdmin\Head.html was just the usual stuff like
Then I got a warning:
Which is quite logic, as the DOMDocument couldn't find a root element. Usually transphporm wraps xml in a
<template>
tag, but not xml from a file as it looks in Builder.php:35I'm not sure if this is wanted behaviour.
Cheers, Martin