div
The HTML<div> element with its nested XML Data island element becomes an editable Xopus Canvas when it has xopus="true" set. It wraps the Xopus configuration directives for an Canvas inside an ordinary HTML webpage.
The contents of the <xml> element must be well formed XML. So empty elements must be closed: <empty/> and &, < and > must be escaped: &, < and >.
<!DOCTYPE html>
<title>Edit with Xopus</title>
<script src="../xopus/xopus.js"></script>
<h1>Edit this page</h1>
<div xopus="true">
<xml>
<config version="1.0" xmlns="http://www.xopus.com/xmlns/config">
<import src="config.xml"/>
</config>
</xml>
</div>
While Xopus isn't started, the contents of the XML Data island are ignored by the browser. All HTML content around the canvas is visible in Xopus, but you cannot edit it. The HTML content in the div is visible until Xopus renders the view. You can delay this rendering process with the showhtmlcontent option.
<!DOCTYPE html>
<title>Edit with Xopus</title>
<script src="../xopus/xopus.js"></script>
<div xopus="true" showhtmlcontent="true">
<xml>
<config version="1.0" xmlns="http://www.xopus.com/xmlns/config">
<import src="config.xml"/>
</config>
</xml>
<h1>My document</h1>
<p>This document content is immediately rendered by the browser. Once the
author clicks here, Xopus will start its own rendering process. </p>
</div>
- Documentation
- › Configuration
- › Elements
- › div
div element
Allowed Children
Attributes
- xopus
- This attribute must be set to
truefor Xopus to identify it as a Xopus canvas. - autostart
- Xopus automatically starts in edit mode. When
autostartis set tofalse, the transformed XML document will be shown with an Edit button. Once the user clicks this button, the WYSIWYG view will be editable. Xopus 4 no longer shows the Edit button , instead the author needs to doubleclick the view to enable edit mode. (Optional) - showhtmlcontent
- By default, Xopus replaces the HTML content of the
<div>element with the view output as soon as the canvas is editable in the startup process. This takes more time to render, with Xopus' XSLT process, than you normally would expect with the complete HTML coming from the webserver. By settingshowhtmlcontenttotrue, you can tell the browser to first render all HTML. This delays the XSLT transformation until the user starts editing. This makes it much faster to open and close documents without editing in situations where the author wants to browse through documents without leaving the Xopus environment. (Optional)