0 Followers · 228 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.

Article Alberto Fuentes · Feb 18, 2021 2m read

Hi Community! 

I'm sharing a little tool (REST service) to download interoperability messages from your browser.

You only need to:

  1. Create a web application in Management Portal (e.g. /downloadmsg) and set DispatchClass=Util.DownloadMsg.
  2. Call the tool using your browser passing the namespace and the message header id to download. http://localhost:52773/downloadmsg/ns/mydev/msgid/17441
0
0 486
Question Peter Charbonnier · Feb 1, 2021

The docbook chapter "Importing XML into Objects" has the following tip:

You can call the Correlate() method repeatedly to correlate more than one element, although the examples in this chapter show only one correlation.

Does anyone have a good example of multiple correlations?  I've got code running that does multiple imports of the same file while changing the correlation and it's inelegant and not really what I want.

2
0 750
Question Blakely Herlick · Dec 22, 2020

Hi all! 2nd time poster and still kind of a newbie. I Googled and searched the posts but did not find anything quite like my question.  I have an XML to HL7 2.6  MFN_M16 translation.  I created an XML schema and I am using it inside a DTL to translate data to HL7. The XML is rather simple EXCEPT one element as data separated by pipes. This only happens when one item has multiple PAR Locations.  To make a valid HL7 message these multiple PAR Locations each need their own IVT segment.

XML Par Location is equal to HL7 IVT:InventoryLocationIdentifier OR (IVT-2)

4
0 443
Question Norman W. Freeman · Dec 24, 2020

I have implemented a web service that inherit from %SOAP.WebService

It exposes classes with string properties : 

Class Employee Extends (%RegisteredObject, %XML.Adaptor) [ ProcedureBlock ]
{

Parameter XMLNAME = "Employee";
Parameter XMLSEQUENCE = 1;

Property FirstName As %String(MAXLEN = "", XMLNAME = "FirstName") [ Required ];
Property LastName As %String(MAXLEN = "", XMLNAME = "LastName") [ Required ];
...

Here is the issue: those properties are filled from a huge Caché database which contains forbidden XML characters (usually control characters in the 0-31 range).

1
0 676
Question James Casazza · Nov 12, 2020

In Cache WIndows environment:

Trying to use the $SYSTEM.SQL.DDLImport to import XML File that has ClassMethods, no SQL Table, but it doesn't appear to be working. I can use this ClassMethod to create SQL Tables. The manual method I have been using is to go into Cache Management Portal, Classes, Import.

I create an XML file first, then run the following to import but get no errors. Any ideas?

 Do $SYSTEM.SQL.DDLImport("Oracle",%ID,dlxml,logfl,0,"",";",2)

Beginning of XML file looks like...

2
0 273
Article Michael Smart · Oct 7, 2016 4m read

One useful feature of our REST framework is the ability for a dispatch class to identify request prefixes and forward them to another dispatch class. This approach of modularizing your URL map will improve code readability, enable you to easily maintain separate versions of an interface, and provide a means to protect API calls that only certain users will be allowed to access.

Overview

1
0 3930
Question Norman W. Freeman · Sep 23, 2020

When you export entities like classes, routines, globals in Cache Studio, you usually end up with XML files that looks like this : 

<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25">
    <Class name="base.monitoredpage">
        <Abstract>1</Abstract>
        <Super>%CSP.Page</Super>
        <TimeCreated>63439,41357.461462</TimeCreated>
        <Parameter name="ENCODED">
            <Default>0</Default>
        </Parameter>
        ...
8
0 1402
Question Eduard Lebedyuk · Aug 26, 2020

I have a class:

Class test.Person Extends (%Persistent, %XML.Adaptor)
{
Property Name;
}

I want to serialize it into this XML:

<Person>
    <Id>1</Id>
    <Name>Ed</Name>
</Person>

Is it possible?

It's for the Visual Trace so I can't use %XML.Writer.

2
0 364
Question Thembelani Mlalazi · Jul 15, 2020

Lets say I have a serial Class A ,Serial Class B,Serial C and Persistent Class Ens.Request

Class SerialA Extends (%SerialObject, %XML.Adaptor) [ ProcedureBlock ]
{
      Property SerialB as SerialB  
     Property SerialC as SerialC
}
     Class SerialB Extends (%SerialObject, %XML.Adaptor) [ ProcedureBlock ]
{
    Property SerialB as %String
}

Class SerialC Extends (%SerialObject, %XML.Adaptor) [ ProcedureBlock ]
{
     Property SerialC as %String
}

Class PersistantClass Extends Ens.Request
{
     Property Record as SerialA
}

the produced xml looks like this  :

4
0 350
Question Peter Geerts · Jul 4, 2020

Forgive my possible intrusion.  

I am not currently involved (yet) in any Intersystems deployment and/or development.
However I was triggered by an piece of (Intersystems) documentation residing under the Intersystems website discussing options  regarding 
Using MTOM for Attachments.  (https://cedocs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?…
)
I this article there is the following sentence: 

By default, a Caché web service behaves as follows:
2
0 366
Question Craig Alexander · Jun 26, 2020

Hi all,

We are working on getting a number of non-code based configurations and settings in fully automated deployments, and I was wondering if anyone had any ideas on how to "update" a task that already exists.

What's in our repository is a separate file for each task in the standard .xml format for:
##class(%SYS.Task).ExportTasks($lb(tTaskID),"c:\TasksExport\"_tTaskName_".xml")

The problem is, the ImportTasks method doesn't update or overwrite if the task name already exists, and there's no DeleteTask method.

2
1 438
Question Mark O'Reilly · Jun 11, 2020

I'm cautious not to ask too many questions on here, but there really doesn't seem to be a good XML end to end guide that explains these things. 

I have now a Business operation that's going to call a url like https://directory.spineservices.nhs.uk/ORD/2-0-0/organisations/Y00334?_…

I'm looking the status of the practice- I tried date but again fell flat as i wan't able to ensure i only got the end date from the first <date> tags and not any subsequent dates. 

Managed to do it kinda in a class method like so 

4
0 411
Question Mark O'Reilly · Apr 30, 2020

Hi:

Sorry I can't find the correct documentation for this. It's very simple I think. 

I open up an XML reader class and correlate the XML to a message type. 

My XML will read something like 

<StatusLastChecked></StatusLastChecked>

This gets correlated into a message with the following property 

Property StatusLastChecked As %String(XMLPROJECTION = "element");

I can use the following to get the other properties out 

i.e. docs.RelayedDocuments.GetAt(i).DateAdded will get the date added properties

When i try for the one with the blank value for the blank entry with a trace I get undefined traced out 

6
0 680
Question Thembelani Mlalazi · Nov 14, 2017

I am using studio 2015 version which does not have dynamic objects and I need to read xml and convert that to a json I have managed to come close to json string but with little difficulties .I need to be able to identify the root element and specify where to put braces between objects  anyone  with any idea is welcome he is my code so far

12
0 1656
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;
}
9
0 2109
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 246
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: "
10
0 1114
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

2
0 787
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: 

1
0 520