Document/Source/Format and Indent

Oxygen general issues.
sderrick
Posts: 264
Joined: Sat Jul 10, 2010 4:03 pm

Document/Source/Format and Indent

Post 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>
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: Document/Source/Format and Indent

Post 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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
sderrick
Posts: 264
Joined: Sat Jul 10, 2010 4:03 pm

Re: Document/Source/Format and Indent

Post 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
Post Reply