Page 1 of 1

Document/Source/Format and Indent

Posted: Thu Apr 28, 2011 7:40 pm
by sderrick
I load up a well formed xhtml or html document

I select Document/Source/Format and Indent or press Ctl-Shft-P

The previous existing closing <meta....</meta> and <link>..</link> tags are gone???

Is there a setting somewhere to tell Oxygen to not remove closing tags when it reformats a html or xhtml file?

here is a sample file

Code: Select all


<?xml version="1.0" encoding="us-ascii"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta><title>Science and Health with Key to the Scriptures Science and Health</title><link rel="stylesheet" href="csps.css" type="text/css" charset="utf-8"></link><link rel="stylesheet" href="epub.css" type="text/css" charset="utf-8"></link></head><body><div id="book-content"><div class="part"><h1><span class="small-caps">Science and Health </span></h1></div></div></body></html>

Re: Document/Source/Format and Indent

Posted: Fri Apr 29, 2011 3:30 pm
by adrian
Hello,

I'm afraid there isn't a formatting option in Oxygen that would allow you to preserve empty elements in their current representation form. There is a formatting option that forces all empty elements to be expanded(Options -> Preferences -> Editor -> Format -> XML, Expand empty elements) but unfortunately it doesn't apply to XHTML.

XHTML documents are formatted by Oxygen according to these guidelines:
http://www.w3.org/TR/xhtml1/#guidelines

But, if I may ask, why do you want to keep the end tags for these XHTML elements(meta and link)? Most guidelines recommend to keep them in the short form for better web browser compatibility.

Regards,
Adrian

Re: Document/Source/Format and Indent

Posted: Fri Apr 29, 2011 8:28 pm
by sderrick
Adrian,

You are perfectly correct!

I hadn't noticed that it closed the tag so /> I thought it had just dropped the closing tag..

Sorry for the false alarm.

and thank you for the help,

Scott