Pretty printing for DTDs

Are you missing a feature? Request it's implementation here.
Frank Ralf
Posts: 348
Location: Hamburg

Pretty printing for DTDs

Mon Mar 17, 2014 2:34 pm

I'd like to have the attribute declarations indentated and the tags preferably in a different color than the element declaration. Can I set this somewhere in the preferences?

...
<!ELEMENT p (#PCDATA | i | xref)*>
<!ATTLIST p class CDATA #IMPLIED>
...


TIA
Frank
Frank Ralf
parson AG
www.parson-europe.com
adrian
Posts: 2337

Re: Pretty printing for DTDs

Mon Mar 17, 2014 3:27 pm

Hi,

Please note that Oxygen does not provide a format and indent (pretty print) operation for DTDs. So there's nothing to configure in this regard.

If you want to change the color of the DTD tokens, go to Options > Preferences, Editor > Colors and expand the DTD node to reveal the configurable token colors.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Frank Ralf
Posts: 348
Location: Hamburg

Re: Pretty printing for DTDs

Mon Mar 17, 2014 4:40 pm

Thanks for the quick reply, Adrian.

I've found out that the indentation can be easily achieved by a simple search & replace (regular expression:

Code: Select all

 Search:   \<!ATTLIST
 Replace:  \t<!ATTLIST


(Note:
The backslash in the search expression is required to escape the <. In the replace expression it's part of the tab \t.)

Cheers,
Frank
Frank Ralf
parson AG
www.parson-europe.com
Frank Ralf
Posts: 348
Location: Hamburg

Re: Pretty printing for DTDs

Wed Mar 19, 2014 2:55 pm

Hi Adrian,

adrian wrote:If you want to change the color of the DTD tokens, go to Options > Preferences, Editor > Colors and expand the DTD node to reveal the configurable token colors.


This setting seems to be missing in oXygen Author. I only have settings for XML, JavaScript, XQuery/XPath, PHP, CSS, and Text. Is this intentionally only available in the Editor and/or Developer version?

Kind regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
adrian
Posts: 2337

Re: Pretty printing for DTDs

Wed Mar 19, 2014 3:24 pm

Hi,

The Author doesn't have a specialized DTD editor (or for any other schema type) and no corresponding option either, so you're basically editing the DTD as plain text. As you've guessed, the specialized DTD editor is only available in the Developer and the Editor.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Frank Ralf
Posts: 348
Location: Hamburg

Re: Pretty printing for DTDs

Wed Mar 19, 2014 3:32 pm

Thanks for the clarification, Adrian.
Frank Ralf
parson AG
www.parson-europe.com
Frank Ralf
Posts: 348
Location: Hamburg

DTD syntax-highlighting for Notepad++

Fri Aug 29, 2014 2:38 pm

For all users of Notepad++, I've created a User Defined Language file for DTD syntax-highlighting. It's available on GitHub: https://raw.githubusercontent.com/nakoh ... ng_DTD.xml

Just import the XML file via Language > Define your language... > Import....

Kind regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com

Return to “Feature Request”

Who is online

Users browsing this forum: No registered users and 1 guest