go to post Manel Trèmols · Apr 16 Hi Michael, Something like this ? Search where "<?xml " starts Search where it ends (first >) Get first tag after xml header Find where this tag ends Remove characters in the middle. test set complex=1 set crlf=$c(13,10) set file="text 1" set file=file_crlf_"text 2" set file=file_crlf_"<?xml version=""1.0"" encoding='UTF-8'?>" if complex { set file=file_crlf_"<Results xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'" set file=file_crlf_" xmlns='urn:tcleDoctorReport'" set file=file_crlf_" xsi:schemaLocation='urn:tcleDoctorReport DoctorReport.xsd'>" } else { set file=file_crlf_"<Results>" } set file=file_crlf_" <ReportPageFormat/>" set file=file_crlf_" <Department>" set file=file_crlf_" <Section>" set file=file_crlf_" <TestSet>" set file=file_crlf_" <TestSetDesc>Blood Culture (Aerobic+Anaerobic)</TestSetDesc>" set file=file_crlf_" </TestSet>" set file=file_crlf_" <TestSet>" set file=file_crlf_" <TestSetDesc>Blood Culture Positive Result</TestSetDesc>" set file=file_crlf_" </TestSet>" set file=file_crlf_" </Section>" set file=file_crlf_" </Department>" set file=file_crlf_" <EpisodeData>" set file=file_crlf_" <EpisodeNumber>240000100</EpisodeNumber>" set file=file_crlf_" <FirstName>Lily</FirstName>" set file=file_crlf_" </EpisodeData>" set file=file_crlf_"</Results>" set file=file_crlf_"text 3" set file=file_crlf_"text 4" set xmlheadstart=$f(file,"<?xml ")-6 set xmlheadend=$f(file,">",xmlheadstart)-1 ;zzdump $e(file,xmlheadstart,xmlheadend) set firsttag=$tr($p($e(file,xmlheadend+1,*),">",1)_">",$c(13,10)) ;zzdump firsttag set tag=$p($e($p(firsttag," ",1),2,*),">",1) ;write !,tag set xmlend=$f(file,"</"_tag_">") zzdump $e(file,1,xmlheadstart-1)_$e(file,xmlend,*) What I get: USER>d ^test2 0000: 74 65 78 74 20 31 0D 0A 74 65 78 74 20 32 0D 0A text 1..text 2.. 0010: 0D 0A 74 65 78 74 20 33 0D 0A 74 65 78 74 20 34 ..text 3..text 4 USER> Regards Manel
go to post Manel Trèmols · Nov 30, 2020 Hi José, I think it's better to implements your own code... and more in this case, where you can "convert" arrays to globals or process-private globals and to solve any problem without worry about number of items...
go to post Manel Trèmols · Apr 22, 2020 Hola Yone, Not sure what version do you have, but if you look at EnsLib.SOAP.InboundAdapter .cls you will see when this error is raised. In my version, basically it is doing, first line is "tLine" variable: $p($p(tLine," ",3),"/",1) If it's not "HTTP" then error is raised. So, I will check what is in Raw tab: Regards Manel
go to post Manel Trèmols · Aug 1, 2019 Hi Rodolfo,If I understand correctly your question, using Base64Decode, you will get it: set tGZIP=$System.Encryption.Base64Encode("This is my original XML") write !,tGZIP set tXML=$System.Encryption.Base64Decode(tGZIP) write !,tXML quit Running this you get: USER>d ^gzip VGhpcyBpcyBteSBvcmlnaW5hbCBYTUw= This is my original XML
go to post Manel Trèmols · Mar 27, 2018 Hi John, I think you can do it using mnemonics: write /SGR(1),"bold",/SGR(0)," normal" Probably the printer will not understand this, but you can define another mnemonic for the printer, sending the correct escape sequence to it http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GIOD_intro#GIOD_intro_definemnemomic and then use the |PRN| device with your mnemonic: USE "|PRN|"::"^%PCL" For example, if printer is PCL you should send: %PCL quit SGR(%1) if %1=1 write $c(27),"(s3" // Bold if %1=0 write $c(27),"(s0" // Normal quit