8 Followers · 234 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 Yone Moreno · Aug 4, 2021

Hello, first of all thanks for your time reading this question ◀️

We would need to achieve the following task:

We have a Ens.Response message with this structure:

<?xml version="1.0" ?>
<!-- type: Mensajes.Response.Justicia.PLATINO.EnviarIniciadoresGeneralResponse  id: 10986665 -->
<EnviarIniciadoresGeneralResponse>
    <EnviarIniciadoresGeneralOut>
        <![CDATA[<?xml version="1.0" encoding="ISO-8859-1"?>
<mensajeWS xmlns="https://wslexnet.webservices.lexnet/3.22"><respuestaEnvioMensaje xmlns=""><idEnvio>1947625809</idEnvio><tamBloque>524288</tamBloque><bytesMIME>TFgDBA...</bytesMIME></respu


2
0 1414
Question Neil Thaiss · Jul 28, 2021

Hi all,

Are there limitations to the size of a file or stream that %XML.Reader will parse?

I am trying to parse a large, 573MB, XML file using either the 'OpenFile' or 'OpenStream' methods, but both return errors.

When I try to use the 'OpenStream' method I get a 'ERROR #6301: SAX XML Parser Error: input ended before all started tags were ended' error',

and when I try the 'OpenFile' method I get a 'ERROR #6301: SAX XML Parser Error: <STORE>'.

'%XML.TextReader' appears to parse the file OK, so I may be able to get use that as a workaround, but ideally I would like to get '%XML.Reader' work

2
0 610
Question Daniel Fernández García · May 25, 2021

Hi,

I have created a method than evaluates an XML expression using the EvaluateExpression method. I need to replace an element value by other string but I couldn't find the way of doing it.

To get that, first I have created the "%XML.XPATH.Document" object using an stream and then I have evaluated the XML expression with the "EvaluateExpression" method. Once I found the element I would like to replace,  I got the value of the element using "do element.Read()" and "set cadena = element.Value" and then I realized some transformations like $ZCVT. Finally, I tried to insert the new string in the






1
0 788
Question Eduardo Nacimento · Mar 25, 2021

hello, 

 I need help...rsrs

 I have a query that return only one CLOB field and only one line, of oracle and  in field have a xml.

 if use  pResultSet.Get the string truncate the xml.

 I want display the xml as a service, because have many lines... i don't need iterate in xml, only get to oracle and display as xml soap.
 
 any tip help. 

thk

1
0 323
Discussion Rob Tweed · Dec 16, 2020

There's been quite a bit of discussion lately in this forum on the tools available in IRIS for using both XML and JSON, and debate on cross-conversion between the two formats.

A week or so ago I posted details of a set of tutorials I'd put together on integrating the Node.js-based QEWD technology with IRIS, working over a network.  As part of that set of tutorials, I've been detailing how to use the various multi-model capabilities of the build-in QEWD-JSdb abstraction of IRIS.  QEWD-JSdb is a key part of QEWD, and understanding it is key to understanding how to develop applications (REST and

1
0 412
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
/// 
/// Util to download messages given a message header id
/// 
/// Setup:
/// 1. Create a webapplication (e.g. /downloadmsg) and set DispatchClass=Util.DownloadMsg
/// 2. Go to http://localhost:52773/download
0
0 515
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 780
Question water huang · Jan 23, 2021
<?xml version="1.0" encoding="UTF-8"?>
<ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:mif="urn:hl7-org:v3/mif" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:hl7-org:v3 ../sdschemas/SDA.xsd" classCode="DOCCLIN" moodCode="EVN">
 <observation>
  <value xsi:type="ST">xxxx</value>
 </observation>
</ClinicalDocument>

this is a example XML, i don`t know how to parse it, keypoints are xmlns ,schemaLocation,xsi:type.is there a way,i could parse the xml into a object,and i can get all the data and ,i can convert the obj to a xml which is as same as the example. if a

4
0 3042
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)

The Business process is of class: 

4
0 460
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).

Ideally, the

1
0 699
Question Patrik Spisak · Dec 2, 2020

Hi guys,

I have this method to create object from XML

ClassMethod XMLNew(doc As %XML.Document, node As %Integer, contOref As %RegisteredObject = "") As TruLaser.ProductionPackage
{
    Set id=""     Set tmpnode=doc.GetNode(node)
    Do tmpnode.MoveToFirstChild()
    Do {
        //compare data node to the string given by the NAMEOFEXPORTID parameter
        //which indicates the XMLNAME of the ids for this object
        If tmpnode.NodeData=..#NAMEOFEXPORTID {
            //get the text from this node; this corresponds to an id in the database
            Do tmpnode.GetText(.id)}
        While tmpn

1
0 425
Question Oliver Catling · Nov 27, 2020

Hi,

I am working with XML and I would like to be able to access parts of the XML document and return them as a string. I am building an XPath document then evaluating an expression on it which returns a list of DOMResult objects. After accessing one of the objects I would like to convert this to a string and am having difficulty in doing this. I originally went down the path of essentially creating my own parsing method that converts this to xml itself, but a collegue has pointed out I might be able to use the %XML.Writer class to do this. However, I am unable to find a way to pass a DOMResul


4
0 619
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...

<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25" zv="Cache for Windows (x

2
0 298
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

To set up a REST Service on your Caché instance, you need to define a dedicated CSP application and create the associated dispatch class that handles incoming requests. The dispatch class extends %CSP.REST an




1
0 3984
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>
        ...

I was wondering if the XSD (schema definition) of those files are available somewhere (eg : in Cache InterSystems website

8
0 1465
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 392
Question Adam Marsh · Aug 5, 2020

Greeting IRIS Community,

I need some help converting XLT (XML) into DTL (XML) pragmatically using COS or any other available options in IRIS for health.
It is for HL7-TO-nonHL7 translation. 

See the following xlt content as an example that i have in XML Format.
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../../server/stylesheet/xltconfig.xsl"?>
<xltconfig name="accenture-1.xlt" site="thac">
<input>
<description>HL7 2.2/2.2 ADT_A16</description>
<href>thmaster/formats/hl7/2.2/22/index.xml</href>
</input>
<output>
<description>pendingDischarge.vrl</description>
<href>thm

4
0 656
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  :

<Recor
4
0 386
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:
  • If it receives a request in an MTOM package, the web service sends the response as an MTOM package.
    Also, the IsMTOM pro
2
0 385
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.

We could of course, delete the task by querying %SYS.Task, finding the OID base

2
1 457
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 

  set httprequest = ##class(%Net.HttpRequest).%New()
    set httprequest.

4
0 442
Question Daniel Sanches · Jun 28, 2019

I'm trying to sign an xml but this is showing an Id attribute in the Signature tag and the xmlns attribute is not appearing.

This is the xml generated:

<Signature Id="Id-80170FF0-0678-47D5-8C8B-771AA4E334E6">
            <SignedInfo>
                <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/>
                <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
                <Reference URI="#ID2102103519037442275900010755000000003309115569507501">
                    <Transforms>
                        <Transform Algorith
7
1 715
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 undef

6
0 708
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

ClassMethod WriteNodes(myfile As %String = "C:\Testdata\data.xml")
{
  set status=##class(%XML.TextReader).ParseFile(myfile,.textreader)
  
    if $$$ISERR(status)
      {
	    do $System.Status.DisplayError(status) 
	    quit
	  }

       set 
12
0 1710
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