morbac / xmltools

XML Tools plugin for Notepad++
GNU General Public License v3.0
260 stars 57 forks source link

"Pretty print" exception(s) #128

Closed Anthropologeezer closed 2 years ago

Anthropologeezer commented 2 years ago

Using XML Tools as installed, I tried to "Pretty print" this:

          <int:chain input-channel="ecmsi_send_http_message">
    <int:header-enricher>
                          <int:header name="Authorization" value="Basic Admin:Admin"/>
        <int:header name="Content-Type" value="application/xml"/>
    </int:header-enricher>
    <int-http:outbound-channel-adapter url=http://localhost:9058/event http-method="POST" >
    </int-http:outbound-channel-adapter>
</int:chain>

And for all 3 variants of pretty print, received this message:

This should not happen.. please get in touch with the developers @ https://github.com/morbac/XMLTools

Np++ v8.1.9.2 & XML Tools v3.1.1.10

Anthropologeezer commented 2 years ago

It works, without error, somewhat:

<int:chain input-channel="ecmsi_send_http_message">
    <int:header-enricher>
    <int:header name="Authorization" value="Basic Admin:Admin"/>
    <int:header name="Content-Type" value="application/xml"/>
</int:header-enricher>
    <int-http:outbound-channel-adapter url=http://localhost:9085/event http-method="POST">
</int-http:outbound-channel-adapter>
</int:chain>

After changing

Plugings > XML Tools > Options... > Pretty print options > Formatting engine

to StringXml from the default SimpleXml

But wouldn't the world be better place if, on initial failure, XML Tools first tried StringXml before popping an error for the user?

morbac commented 2 years ago

Hi, please go in xmltools options and choose Quick Xml as pretty print engine

Le mer. 1 déc. 2021 à 20:03, Anthropologeezer @.***> a écrit :

I tried to "Pretty print" this:

      <int:chain input-channel="ecmsi_send_http_message">
<int:header-enricher>
                      <int:header name="Authorization" value="Basic Admin:Admin"/>
    <int:header name="Content-Type" value="application/xml"/>
</int:header-enricher>
<int-http:outbound-channel-adapter url=http://localhost:9085/event http-method="POST" >
</int-http:outbound-channel-adapter>

</int:chain>

And for all 3 variants of pretty print, received this message:

This should not happen.. please get in touch with the developers @ https://github.com/morbac/XMLTools

So, I have, assuming this is what was intended?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/morbac/xmltools/issues/128, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACOCHQ5T6LUHY2PE3LWMWMLUOZWORANCNFSM5JFHTNMA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

PaulDMurray commented 2 years ago

Hi,

I get the same error trying to Pretty Print this:

select distinct home, person, agenow as age, email, title,first,srname, aline1, aline2, aline3, aline4, aline5, zip, aline5 as County, mtype, category, interest1, campaign, work, eveningphone, phone, added, source, campaign, forbid, emailforbid, PostalRegion, Bkgs, Sumdays, Earliest, Latest, dbo.date5todate7(Latest) as Latest7, vitalise.dbo.RTBCalcGridDist(Easting,Northing,464148,100092) as PortsmouthDistance, GDPR_Fund_Phone_Check, GDPR_Fund_Email_Check, GDPR_Fund_Mail_Check from ( select * ,(SELECT Consent FROM dbo.CurrentConsentPerPerson ccp WHERE ccp.personId=f.person AND ContactTypeId = 2 AND ContactChannelId = 1) as GDPR_Fund_Phone_Check ,(SELECT Consent FROM dbo.CurrentConsentPerPerson ccp WHERE ccp.personId=f.person AND ContactTypeId = 2 AND ContactChannelId = 2) as GDPR_Fund_Email_Check ,(SELECT Consent FROM dbo.CurrentConsentPerPerson ccp WHERE ccp.personId=f.person AND ContactTypeId = 2 AND ContactChannelId = 3) as GDPR_Fund_Mail_Check from dbo.AddressesForMailing(1) as f where added >= 42370 AND vitalise.dbo.RTBCalcGridDist(Easting,Northing,464148,100092) <= 10 and bkgs is not null and Mtype in ('V') and Category in ('V') and Forbid not in ('B','D','F','G') ) as A WHERE (GDPR_Fund_Phone_Check = 1 OR GDPR_Fund_Email_Check = 1 OR GDPR_Fund_Mail_Check = 1)

Changed the formatting engine and I don't get the error, however it does not get formatted.

Thanks,

Paul

morbac commented 2 years ago

Paul, XMLTools is not designed for SQL syntax. Please search other plugin (Poor Man's T-Sql Formatter or SQLinForm for instance)