Hello!

I wonder if anyone has a smart idea to extract an XML fragment inside a text document (incoming from a stream)?

The XML fragment is surrounded by plain text.

Example:

text...........
text...........
<?xml version="1.0" encoding="UTF-8 ?>
<Start>
...etc
</Start>
text...........
text...........

The XML is not represented by any class or object in the Namespace.

The XML can look different from time to time

1 9
0 96

Hi,

I have an odd problem that occurs when I'm trying to import lookup tables in the XML format into Studio.

I store my files in in C:\CodeRepository.

I can manually import these lookup tables using "Import local..." option in the InterSystems Studio.

However, when I'm trying to import them using command in terminal: do $system.OBJ.LoadDir("C:\CodeRepository\","ck")

I'm getting the following error:

0 1
0 114
Question
· Jan 15
parse XML to object

hi there,when i use %XML.Reader parse XML to object,if the element value is null,the data in the table is $c(0),how avoid this?

my class file like this:

0 3
0 103

Hello everyone!
Sorry for the vague title! But I wonder what would be the best way to easily import a large XML-file into a production, modifying it by deleting elements and nodes depending on what values are in those nodes/elements and later creating whole new XML-file from that?

I have gone through this: Using Caché XML Tools | Caché & Ensemble 2018.1.4 – 2018.1.8 (intersystems.com)

0 5
0 239

hi there,when object export to xml,i know that,it will call propertynameLogicalToXSD method,but i can`t find out that use %XML.Reader to parse XML to object witch method will be called before ,

simple code like this:

Class Samples.NewClass2 Extends (%Persistent,, %XML.Adaptor)
{
Property OPDT As %Library.DateTime;
}

my xml is

0 4
0 153

Hello!
I am trying access each "name" tag in the xml-file down below and want to display them through the trace in the production:

<?xml version="1.0"?>
<staff>
<doc type="consultant">
<name first="David" last="Marston">Mr. Marston</name>
<name first="David" last="Bertoni">Mr. Bertoni</name>
<name first="Donald" last="Leslie">Mr. Leslie</name>
<name first="Emily" last="Farmer">Ms. Farmer</name>
</doc>

</staff>

0 2
0 159

Hi All

I'm having a problem with cleaning user inputted text from a HealthCare system my HealthConnect system interfaces with.

The input can be anything posted into an RTF box on an app which stored in oracle, and extracted by HealthConnect from oracle via an XML based API.

When the XML is returned, various values are read out of it using %XML.XPATH.Document and it is the presence certain characters entered into the RTF fields cause XPATH to throw an error. For example,

0 4
0 243

Good morning:


Thank you very much for reading the doubt and above all thank you very much for answering.

Given the following use case:

If we have a Destination Service that through a HTTP GET by REST gives us a certain JSON response, where it should be noted that it is a list of objects where each object in the list does NOT have a key:

0 3
0 197

Hi everyone,

I'm currently developing a TCP inbound Service to read some XML sent from a TCP Operation that uses EnsLib.TCP.CountedOutboundAdapter.

1) I have tried EnsLib.TCP.Inbound adapter but that gives this error:

ERROR <Ens>ErrException: <METHOD DOES NOT EXIST>zinitConfig+7 ^Ens.Host.1 *%New,EnsLib.TCP.InboundAdapter -- logged as '-'
number - @'
Set ..Adapter = $classmethod(..#ADAPTER,"%New")'

Due to this, the adapter is unable to start listening for incoming connections.

0 7
0 683
Question
· Feb 18, 2019
%String to XML

Hi

I've got a string variable which I need to convert into a XML one.

My main goal here is to use the XML bit I've extracted from a HTML file in a message I need to pass over to an operation.

I'm doing the following which always errors

classMethod WriteNodes(myfile As %String)
{
Set status=##class(%XML.TextReader).ParseString(myfile,.reader)

....

Any easy way of making this happen?

Kind regards

0 18
1 1.6K

I have a registered object class that extends %XML.Adaptor and I want to convert an object of it into canonical XML.

From reading the documentation and some trial and error, it seems like I would need to use %XML.Writer to write the object to XML first using the RootObject() method, then read it with %XML.Reader, and then use the Canonicalize() method of %XML.Writer to write it out again.

Is there a better approach?

1 2
0 351

Hi everyone,

I'm having trouble parsing XML containing unicode characters which I receive from an external webservice. I believe my file is saved properly with UTF-8 encoding but the SAX Parser still throws me an error.

I have 2 classmethods: 1 general one (get) to make a request to a webservice and return the date, and 1 (getSportsPerDate) to make a specific call and then parse the data.

0 5
0 2.2K

Hello; I am using a custom class extending CodeTableDetail (actually it extends CodeTableTranslated) for a MedicalClaimLine.Extension property for a Procedure Modifier value, in addition to the existing MedicalClaimLine.ProcedureModifierItems property (this is a list of %String). This works very well, stored AND translated correctly, until a valid ProcedureModifier value is used that is all punctuation: ##, **, or ++.

0 2
1 129
Question
· Dec 19, 2016
HL7 Section to JSON

Hi all,

I'm trying to convert a HL7 section to a XML or JSON string.

We need to save the content of PID section into a SQL Column, therefore we need to convert it into a XML o JSON string

is there any easy way to convert it?

I've tried to convert it directly into a DTL, but all my attempts have been unsuccessful

Best regards,

Francisco Lopez

1 6
0 1.3K
Question
· Jul 25, 2022
Process XML document

Hi all,

I am looking at a task which involves processing an XML file. Picking the file up from a folder (c:\test.xml) reading the data out of the XML and archiving the xml after it has been processed.

I was wondering what the best way of doing this would be?

I have got as far as creating a service in Ensemble. The Service I have created uses the class name EnsLib.XML.Object.Service.FileService.

Any advice or tutorials/guides would be much appreciated.

Many Thanks

0 3
0 255

Hi Community,

I have json equivalent persistent object in pjsonObj variable. Final JSON example below.

{
"Document": {
"FileExtension": "pdf",
"FileContent": "JVBERi0xLjUNCiW1tbW1DQo...(very large bsae64 string)"
}
}

Here FileContent field in json will contain converted base64 string of very large pdf(10pages). I need to submit this json as a payload to REST endpoint.

below code is working fine.

2 1
0 357