Author Topic: all Windows x64 betas so far: XML beautifier doesn't  (Read 3605 times)

smartin

  • Senior Community Member
  • Posts: 106
  • Hero Points: 3
all Windows x64 betas so far: XML beautifier doesn't
« on: September 12, 2014, 01:27:20 PM »
Hi All,
I have tried changing nearly every option in the XML beautifier and I can't get one that will do a standard pretty print, i.e. simple tags with a text value on the same line, compound tags on multiple lines. Here's de XML from a WS call:
Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:c14n="http://www.w3.org/2001/10/xml-exc-c14n#" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" xmlns:wsc="http://schemas.xmlsoap.org/ws/2005/02/sc" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext" xmlns:ns2="http://xxx.yyy.com" xmlns:ns1="http://service.xxx.yyy.com"><SOAP-ENV:Header><wsse:Security SOAP-ENV:mustUnderstand="1"><wsse:UsernameToken wsu:Id="1"><wsse:Username>xxxxx</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">yyyyy</wsse:Password></wsse:UsernameToken></wsse:Security></SOAP-ENV:Header><SOAP-ENV:Body><ns1:albatross><request><date>1970-011T00:00:00</date><frog>301</frog><stan>000000</stan></request></ns1:albatross></SOAP-ENV:Body></SOAP-ENV:Envelope>

Here's the output from the v14 beautifier:
Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:c14n="http://www.w3.org/2001/10/xml-exc-c14n#"
    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
    xmlns:xenc="http://www.w3.org/2001/04/xmlenc#"
    xmlns:wsc="http://schemas.xmlsoap.org/ws/2005/02/sc"
    xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
    xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext"
    xmlns:ns2="http://xxx.yyy.com" xmlns:ns1="http://service.xxx.yyy.com">
    <SOAP-ENV:Header>
        <wsse:Security SOAP-ENV:mustUnderstand="1">
            <wsse:UsernameToken wsu:Id="1">
                <wsse:Username>xxxxx</wsse:Username>
                <wsse:Password
                    Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">
                    yyyyy</wsse:Password></wsse:UsernameToken></wsse:Security></SOAP-ENV:Header>
    <SOAP-ENV:Body>
        <ns1:albatross>
            <request>
                <date>1970-011T00:00:00</date>
                <frog>301</frog>
                <stan>000000</stan></request></ns1:albatross></SOAP-ENV:Body></SOAP-ENV:Envelope>

And this is what I expect (from v13 and previous):
Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:c14n="http://www.w3.org/2001/10/xml-exc-c14n#" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" xmlns:wsc="http://schemas.xmlsoap.org/ws/2005/02/sc" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext" xmlns:ns2="http://xxx.yyy.com" xmlns:ns1="http://service.xxx.yyy.com">
  <SOAP-ENV:Header>
    <wsse:Security SOAP-ENV:mustUnderstand="1">
      <wsse:UsernameToken wsu:Id="1">
        <wsse:Username>xxxxx</wsse:Username>
        <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">yyyyy</wsse:Password>
      </wsse:UsernameToken>
    </wsse:Security>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <ns1:albatross>
      <request>
        <date>1970-011T00:00:00</date>
        <frog>301</frog>
        <stan>000000</stan>
      </request>
    </ns1:albatross>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
A lot easier to read and balance start/end tags.
Regards.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: all Windows x64 betas so far: XML beautifier doesn't
« Reply #1 on: September 12, 2014, 01:53:04 PM »
For the line breaking, setting the attribute style on the Indent tab to "All on One Line" will prevent the Envelope tag from being broken into several lines.   (and I see a bug there, its not showing the right setting when you change the attribute style, and then close and re-open the dialog).

The indent problem is where I apparently broke the default tag setting.  You can work around it for the moment by bringing up the beautifier options,  go to the "Tags" tab, click on "<DEFAULT TAG>", and then change the "Line Breaks -> Within" setting to "1".

I'll fix that and the line breaking setting option.  Thanks for the report.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: all Windows x64 betas so far: XML beautifier doesn't
« Reply #2 on: September 12, 2014, 02:06:02 PM »
Fixed for the next beta drop.  (not 4).   

smartin

  • Senior Community Member
  • Posts: 106
  • Hero Points: 3
Re: all Windows x64 betas so far: XML beautifier doesn't
« Reply #3 on: September 12, 2014, 02:08:48 PM »
Thanks Patrick,

Thanks for quick turnaround. I already tried setting "Line Breaks->Within" to 1. This gives me the following output:
Code: [Select]
<tag>
    value
</tag>

Whilst better this is still not good as the I cannot then inject the pretty print into a service if I need to test, and also on a large call trying to follow all the XML flow starts giving me a headache!

Regards.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: all Windows x64 betas so far: XML beautifier doesn't
« Reply #4 on: September 12, 2014, 02:44:58 PM »
Ok, I'll take a look and see if I can fix it to default to the inline style for tags that aren't configured, and that only contain text. 

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: all Windows x64 betas so far: XML beautifier doesn't
« Reply #5 on: September 15, 2014, 03:02:32 PM »
Fixed this for the next drop.

smartin

  • Senior Community Member
  • Posts: 106
  • Hero Points: 3
Re: all Windows x64 betas so far: XML beautifier doesn't
« Reply #6 on: September 19, 2014, 12:51:51 PM »
Confirmed fix in beta5. Thanks.