Author Topic: XML Beautifier questions  (Read 3680 times)

flethuseo

  • Senior Community Member
  • Posts: 177
  • Hero Points: 2
XML Beautifier questions
« on: September 05, 2014, 04:31:32 pm »
Several questions regarding the beautify XML functionality:

1. Is it possible to indent only a selection? I've seen this possible for the C/C++ beautifier.

2. How do I preserve my <AllowableValue> and <Description> tags so that they are indented, but the line isn't split. I have tried this but it still splits the line:
Code: [Select]
        <AllowableValues>
            <AllowableValue><![CDATA[BYTE]]></AllowableValue>
            <AllowableValue><![CDATA[SHORT]]></AllowableValue>
            <AllowableValue><![CDATA[FLOAT]]></AllowableValue>
        </AllowableValues>


3. Why is the Edit Profile option grayed out, Is that not to for saving the settings on how you want to indent your XML file?


4. This looks like a bug to me. If I try to type anything in Tag Settings so that it takes me to words that start with M, I get the following stack_trace:

« Last Edit: September 05, 2014, 04:35:51 pm by flethuseo »

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1583
  • Hero Points: 140
Re: XML Beautifier questions
« Reply #1 on: September 05, 2014, 05:17:30 pm »
  • There's a beautify-selection command.
  • If you go into Tools -> Beautify -> Options, go to the tags tab, and click "Preserve tag position" for the tags you don't want line-wrapped, this should keep them on the same line.
  • Image link is dead, but I'm guessing you mean the Tools -> Beautify -> Edit Current Profile entry?  Historical reasons is probably the best answer I can give.  For XML/HTML in v18 and before,  'options' allows you to change and save the settings.  In v19, this has changed, so Edit Current Profile is the one you pick to bring up the settings, change and save them. (and this is also true for the more recently updated beautifiers in v18).
  • Reproduced that.  Looks like I need to fix it in v19 too.

Thanks for the reports.

flethuseo

  • Senior Community Member
  • Posts: 177
  • Hero Points: 2
Re: XML Beautifier questions
« Reply #2 on: September 05, 2014, 06:08:09 pm »
The tags are still getting line wrapped, I don't know if I am doing something wrong, or if there is a bug. I'm attaching a sample of the  file I'm trying to beautify as well pictures of the settings I'm using.

Please let me know what other information can help figure out this problem. Thanks for your help.



patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1583
  • Hero Points: 140
Re: XML Beautifier questions
« Reply #3 on: September 08, 2014, 01:57:47 pm »
I don't think I'm seeing what you're seeing.  Could you grab the uformat.ini file from your config directory and post it? 

flethuseo

  • Senior Community Member
  • Posts: 177
  • Hero Points: 2
Re: XML Beautifier questions
« Reply #4 on: September 25, 2014, 07:01:07 pm »
Sorry for the late reply. I am attaching the file you requested.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1583
  • Hero Points: 140
Re: XML Beautifier questions
« Reply #5 on: October 01, 2014, 02:24:04 pm »
That helped.  Looks like a bug that's specific to CDATA sections.  With the "Max line length" set to 0, it shouldn't be adding those line breaks in any case.  It doesn't look like anything I can hotfix. 

I suspect I may have accidentally run v19 when trying to reproduce it before, because I can't help but reproduce it, or another bad behavior when changing the settings now.

This bug does not seem be In v19, probably because XML beautifier was heavily re-worked.  The default configuration leaves the XML the way you want it, without having to even add specific configuration for AllowableValue.  (The example file doesn't seem to have the Description tag, so I can't say whether it would need extra configuration or not).