8 Followers · 235 Posts

Extensible Markup Language (XML) is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable.

Learn more.

Question Laura Blázquez García · May 16, 2018

Hello.

I want to know how can I convert XML String intro a %SerialObject.

This is an example:

<Envelope>
    <Body>
        <RESULT>
            <SUCCESS>TRUE</SUCCESS>
            <LIST>
                <ID>11111</ID>
                <NAME>one</NAME>
            </LIST>
            <LIST>
                <ID>22222</ID>
                <NAME>two</NAME>
            </LIST>
        </RESULT>
    </Body>
</Envelope>

And this are the %SerialObject classes I have created:

Class test.Envelope Extends (%SerialObject,%XML.Adaptor)
{
Property Body As test.Body;
}
Class test.Body Extends (%SerialObject,%XML.Adaptor)
{
Property
9
0 2148
Question Paul Riker · Apr 21, 2020

I'm looking for any codes that match my parameter that we have received since 1/01/2020 based on the FromTime, EnteredOn or Status (if both are empty).

(Problem[Problem/Code='%1' and FromTime>"2020-01-01"]) | (Problem[Problem/Code='%1' and (count(FromTime)=0 or FromTime="") and EnteredOn>"2020-01-01"]) 
| (Problem[Problem/Code='%1' and (count(FromTime)=0 or FromTime="") and (count(EnteredOn)=0 or EnteredOn="") and Status/Description="Active"])

This works like a charm with standard XPATH query tools but HS does not like it.

2
1 257
Question Rubens Silva · Apr 15, 2020

Hello,

Recently I have been required to work with a method called ExportToStream.

The situation asks me to export a UTF-8-encoded JSON as a XML to be imported on old releases. Here's how I attempted to fulfill this request:

do $System.OBJ.ExportToStream("path/to/my/json/file.json", .stream,,,"UTF8")

The file is indeed encoded as UTF-8 and although the XML header denotes that it has been exported as UTF8:

<?xml version="1.0" encoding="UTF8"?>

The body content seems to differ:

"text": "Condição de pagamento sujeito a análise de crédito: "

I will say it again, the original file is

10
0 1165
Question Mark O'Reilly · Apr 9, 2020

I'm having trouble trying to navigate XML files USING the %XML.TextReader. I have read https://cedocs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GXML_textreader#GXML_textreader_creating_method
but I still don't really understand. 

I have the following block 

while textreader.Read()
    {
       
    set practices= practices_textreader.Name_":"
        If textreader.Value'="" 
        {
            set practices= practices_textreader.Value_" "
            }
            elseset practices= practices_"NOVALUE" _" "}
            
        }         write practices

The xml for all inte

2
0 813
Question Yone Moreno · Mar 25, 2020

Hello,

We have been reasearching how could we parse a string with a JSON structure like the following:

{"code":200,"type":"Consulta","message":"Operacion correcta","result":[{"id":38802130,"paciente":null,"prestacion":{"codigo":"1.52","descripcion":"Extracción ordinaria","tipo":null},"agenda":{"codigo":"TLAB","descripcion":"LABORATORIO CAE TELDE","sala":""},"servicio":{"codigo":"EXTIN","descripcion":"Unidad de Extracciones Insular"},"centroDerivacion":{"codigo":null,"descripcion":null},"centro":{"codigo":"350290","descripcion":"CHUIMI"},"medico":"Nombre4251 Apellido1_4251 Apellido2_42



1
0 381
Question Jack Smith · Oct 27, 2019

We have a data transformation where source is object collection (populated from a json file)  and target is EnsLib.EDI.XML.Document.

If source file is large enough, transformation fails and we get <store> error and I quickly found this:

https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=EBPLR_DTL_foreach which at the bottom in "Avoiding <STORE> Errors with Large Messages" section tells to: 

"As you loop over segments in a message or object collections, they are brought into memory. If these objects consume all the memory assigned to the current process, you may get

1
0 541
Question Nauris Gruduls · Mar 12, 2020

In my Data Transformation, the Target class needs to create a new List of objects (ListOfObj), depending on some conditions of Source class (Source/Target are completely distinct/different classes).

I experimented with Lists of 'primitive' data types (ListOfDT), and I could add new %String items (as an example) to a List of %String property, with "append" action in DT.

Does anyone have an example, or guidance, how to create new Lists of Objects in data transformation?

For example, if I have a 'container' class like this, it works:

Class Json.SalesOrderContainer Extends (%RegisteredObject,%



2
0 939
Question Yone Moreno · Feb 18, 2020

Hello,

We would like to get the XML which is being given by the requested system, directly to our Service output.

We have tried to just output directly the Message Response as follows:

Method findCandidatesXML(mensEntrada As %XML.GlobalCharacterStream(CONTENT="MIXED")) As Mensajes.Response.GestionPacientes.operacionResponse(XMLNAME="mensSalida") [ Final, ProcedureBlock = 1, SoapAction = "http://SCS.Servicios/GestionPacientes/findCandidatesXML", SoapBindingStyle = document, SoapBodyUse = literal, WebMethod ]
{
    set ^tipoMensaje="XML"
    $$$LOGINFO("El mensaje es de tipo: "_^tipoMensaj



2
0 940
Question Patrik Spisak · Feb 14, 2020

Hi guys,

I need help because I have no idea how to proceed further and documentation does not explaining this solution.

I have XML like this:

<?xml version="1.0"?>

<ProductionPackage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" JobName="10006_8046_L69">

  <Barcode>1200002101</Barcode>

  <DueDate>31.12.5000 23:59:59</DueDate>

  <BasicMaterial>1.0038</BasicMaterial>

  <RawMaterial>St37-120</RawMaterial>

  <RawMaterialThicknessUnit>mm</RawMaterialThicknessUnit>

  <JobNote />

  <CreatedBy>stko</CreatedBy>

  <ChangedBy>stko</ChangedB

9
0 905
Question Rubens Silva · Jan 31, 2020

Hello.
I'm trying to export a XML stream containing some files that are supposed to have been written using UTF-8, but I'm facing some broken encoding issues.
You can see below that I'm indeed viewing a UTF-8 encoded and which is inside the CSP folder and encoded correctly (although displaying it on Studio would not display it correctly as the file is not using BOM and that's intentional).

We need to export such files to XML along with many others and for that we'are using the method ExportToStream from the class %SYSTEM.OBJ.
The file must be transmitted using HTTP and that's why we're using

7
0 889
Question Matthew Martinez · Dec 2, 2019

Hello,

I am reading in an X12 document into my production that needs to be processed and returned as a CSV file.  I have created a record map to support the fields I want to extract with a batch class to store headers.  I have a DTL mapping the data to the appropriate fields in the record map and am sending the record map to a EnsLib.RecordMap.Operation.BatchFileOperation.

None of my components error out and in fact report that the message was processed without any errors but I am not getting an output file in my expected output folder. 

Is this an appropriate use of this operation class? 

2
0 1041
Question Rizmaan Marikar · Oct 13, 2019

Hi All,

I have a ZEN report, which gives a PDF output, i want to generate this report programmatically, save to a location in the disk. Here is my method so far

ClassMethod GenerateReport(ReportID, ReportClass, P1, P2, P3, P4, P5, P6, P7, P8, P9, PUser, PUserID, PUserProfileID, mode = 2, ByRef outputfile = "") As %Status{set filename=""set ZenClassName=$piece(ReportClass,".cls")set oRpt=$classmethod(ZenClassName,"%New") set oRpt.RUID=##class(websys.Report).GetRUID(P1,P2,P3,P4,P5,P6,P7,P8,P9,PUser,PUserID,"",PUserProfileID)set FileExt=..GetModeExt(mode)if outputfile=""{set 
3
0 940
Question Federico Raimondo · Oct 18, 2019

Hi everyone, 

I have just started to use JavaGateway and I didn''t encountered so much difficulties since I've got the output of the Java class I have called. 

This is the class I have implemented: 

Method OnRequest(pRequest As EnsLib.HL7.Message, Output pResponse As EnsLib.HL7.Message) As %Status{set MDMarchiv=pRequest.OutputToString()$$$TRACE(MDMarchiv)#dim RPConverter = ##class(training.hl7.HL7toRP).%New()set output=RPConverter.hl7toRp(MDMarchiv)$$$LOGINFO("after transformation: "_output)set RPStream = ##class(%FileCharacterStream).%New(output)#dim finalResponse As %F
6
0 453
Question Sebastian Thiele · Jul 17, 2019

Hi all,

is it possible to omit the typical XML header line

<?xml version="1.0" encoding="ISO-8859-1" ?>

when writing an the contents of a EnsLib.EDI.XML.Document  using the above mentioned operation. I´ve already digged into the config value Format. It only states that:

C(e) : output an XML header line declaring character encoding e. If e is empty use the encoding defined by the Adapter. If e begins with ! force the output stream's encoding. Note that this will be applied automatically for File Operations configured with a non-UTF-8 Charset

The target system requires to receive the file contents wi

2
0 469
Question Rodolfo Santos · Jun 12, 2019

Hello Everyone

I'm trying to open an XML that I get inside a GZIP file.
However, I can only open the contents when I save the file to a folder.
I would like to know if there is a way to get the contents of XML without saving the GZIP in a folder.

The code below is functional, however, you are saving GZIP before you can get the contents of the XML.

SET tGZIP = $System.Encryption.Base64Decode("############")
SET tFile= ##class(%File).%New("####")
SET tSC = tFile.Open("WSN")
SET tSC = tFile.Write(tGZIP)
DO tFile.%Save()
DO tFile.Close()
SET tSC = tFile.Open("RUK:::/GZIP=1:/NOXY=1")
WHILE 'tFi
2
0 547
Question Arthur Pereira · Apr 29, 2019

Hello everyone, I'm new to COS development. I'm trying to generate a simple XML file based on a query and save into my server. I'm looking for stuff to get it done, if anyone has a tutorial or a step-by-step post on how to do it. My difficulty is just in generating the XML file.

1
0 883
Question Thembelani Mlalazi · Apr 9, 2019

I have an xml that has non standard characters and I would like to transform it with xslt  so that those characters render in the format  &#nnn here is what I have so far any help appreciated 

xslt

<!--?xml version="1.0"?-->
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output encoding="Windows-1252" indent="yes" omit-xml-declaration="yes" method="xml">
>  <xsl:template match="/Recordset">
    <recordset><xsl:apply-templates></xsl:apply-templates></recordset>
  </xsl:template>
  <xsl:template match="*|@*">
    <xsl:copy>
      <xsl:apply-template
6
0 1775
Question Rodolfo Santos · Apr 2, 2019

Hello everyone!
I need to have a ResultSet of type % SQL.Statement show its contents when it is trafficked in a message property by Business Process.
I tried to use the % XML.DataSet type that inherits properties of type % XML.Adaptor, but did not work.
Is there any other way to traffic as an object, other than within a Stream?

Note: I can not traffic Streams and I will not be able to use Correlate in this case.

3
0 295
Article Dmitrii Kuznetsov · Mar 31, 2019 20m read

How Tax Service, OpenStreetMap, and InterSystems IRIS
could help developers get clean addresses

 

Pieter Brueghel the Younger, Paying the Tax (The Tax Collector), 1640

In my previous article, we just skimmed the surface of objects. Let's continue our reconnaissance. Today's topic is a tough one. It's not quite BIG DATA, but it's still the data not easy to work with: we're talking about fairly large amounts of data. It won't all fit into RAM at once, and some of it won't even fit on the drive (not due to lack of space, but because there's a lot of junk). The name of our subject is FIAS DB: the Federal Information Address System database - the databases of addresses in Russia. The archive is 5.5 GB. And it's a compressed XML file. After extraction, it will be a full 53 GB (set aside 110 GB for extraction). And when you start to parse and convert it, that 110 GB won't be enough. There won't be enough RAM either.

0
2 616