auto indent on xml

Post a reply

Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:
BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON
Topic review
   

Expand view Topic review: auto indent on xml

Re: auto indent on xml

Post by stefdhol » Thu Feb 23, 2012 2:34 pm

Feature request added: Item created successfully. (Artifact 3492076)

Thanks for the quick reply.
Stefaan

Re: auto indent on xml

Post by robert » Thu Feb 23, 2012 2:13 pm

RSTA doesn't have a pretty-printing feature out-of-the-box unfortunately. If you'd like that considered for a future release, please add a Feature Request so it can be tracked.

That said, for RText I integrated JTidy, which is a simple port of HTML Tidy for Java. You might consider trying that out to see if it works for you.

auto indent on xml

Post by stefdhol » Thu Feb 23, 2012 1:54 pm

Hi,

I'm using RSyntaxTextArea for some xml related java developments (dispaying xml retrieved from blob in database etc.).
The problem I am facing is that the xml I insert in the TextArea does not get displayed as:
Code: Select all
<x>
    <y>test</y>
</x>

but as
Code: Select all
<x><y>test</y></x>


--> no autoIndent etc.

Code:
Code: Select all
RSyntaxTextArea txt = new RSyntaxTextArea();
          txt.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_XML);
          txt.setCodeFoldingEnabled(true);
          txt.setAutoIndentEnabled(true);
          txt.setText("<x><y>test</y></x>");


Any Idea how I can get full xml "pretty printing" and tag folding?

Thanks
Stefaan

Top