'Format and indent' does not work with leading spaces
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 97
- Joined: Tue Apr 22, 2008 9:31 am
'Format and indent' does not work with leading spaces
I found that if spaces are before the XML document type declaration, it makes the XML document 'not well formed'. In addition the action 'Format and indent' does not work.
Leading spaces are superfluous but should they make the XML document 'not well formed'?
And could the 'Format and Indent' action add in a first step to remove leading spaces? So regardless of leading spaces make the XML document invalid or not, they are first removed and then the action 'Format and Indent' succeeds.
I know this is a small thing. It is that have been cutting and pasting XML from run-time logs and I always manage to paste leading spaces that I manually must remove.
Leading spaces are superfluous but should they make the XML document 'not well formed'?
And could the 'Format and Indent' action add in a first step to remove leading spaces? So regardless of leading spaces make the XML document invalid or not, they are first removed and then the action 'Format and Indent' succeeds.
I know this is a small thing. It is that have been cutting and pasting XML from run-time logs and I always manage to paste leading spaces that I manually must remove.
-
- Posts: 9447
- Joined: Fri Jul 09, 2004 5:18 pm
Re: 'Format and indent' does not work with leading spaces
Hi,
Spaces are allowed before the document type declaration.
But they are not allowed before the XML declaration:
The production in the XML specification:
http://www.w3.org/TR/xml/#sec-prolog-dtd
specifies that if the xml declaration is present, no other character must precede it. This is useful for parsers to determine the encoding of the XML file.
If you add any space before the declaration, it makes the XML document not wellformed.
The format and indent needs the XML document to be well formed in order for it to work. Also the action does not format and indent spaces or other content which occurs before the root element, they are preserved untouched.
Regards,
Radu
Spaces are allowed before the document type declaration.
But they are not allowed before the XML declaration:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
http://www.w3.org/TR/xml/#sec-prolog-dtd
specifies that if the xml declaration is present, no other character must precede it. This is useful for parsers to determine the encoding of the XML file.
If you add any space before the declaration, it makes the XML document not wellformed.
The format and indent needs the XML document to be well formed in order for it to work. Also the action does not format and indent spaces or other content which occurs before the root element, they are preserved untouched.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service