Article
· Mar 1, 2017 17m read
Parsing docx using XSLT

The task of handling office documents, namely docx documents, xlsx tables and pptx presentations is quite complicated. This article offers a way to parse, create and edit documents using only XSLT and ZIP.

Why? docx is the most popular document format, so the ability to generate and parse this format would always can be useful. The solution in a form of a ready-made library, can be problematic for several reasons:

  • library may not exist
  • you do not need another black box in your project
  • library restrictions : platforms, features, etc.
  • licensing
  • processing speed

In this article, I would use only basic tools for work with the docx documents.

6 3
1 6K
Article
· Oct 7, 2016 4m read
Forwarding Requests in a REST Service

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.

7 1
0 3.6K

I'll be doing my first xml transform soon and I'm hoping to find a good graphical mapping tool to generate the XSLT. Does anyone have any recommendations? I've tried the demo of Altova MapForce and it's exactly what I want but it's super expensive. Working for a non-profit it would be nice if I could find a free or cheap solution.

0 5
0 3.1K
Question
· Apr 1, 2017
XML to Json conversion

Hello,

Are there any utilities/api in HealthConnect 2016.2.1 that will allow conversion of XML virtual document to Json format? We were thinking to convert HL7 ADT message to XML via Ensemble DTL and then send it to another BP to convert to Json format for transmission via Web Services. To my understanding there isn't anyway to represent Json as a virtual object so it can be use for direct mapping of HL7 2.x message to Json via Ensemble DTL.

Thanks

Yuriy

0 3
0 2.6K

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
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 would like to write some code to parse a set of HTML pages from the internet in order to gather information from each web page.

All of the web pages are generated using a template, so the format of each of the web-pages is consistent with one-another and the information that I want to gather is always located in the same logical place within the page.

What is the best way to parse an html page in order to gather information at a specific place?

Can XML XPATH be used here? Does anyone have any examples of parsing HTML content?

2 6
0 1.4K

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

1 12
0 1.4K
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

Hi,

I'm new with writing Caché Objectscript so I need some assistance. I have XML which contains information like this:

<?xml version="1.0" encoding="UTF-8"?>
<session>
   <sessionId>124364</sessionId>
   <cabinet>demo</cabinet>
   <eventType>IN</eventType>
   <eventTime>20161006160154</eventTime>
   <login>test</login>
   <loginFirstName>test</loginFirstName>
   <loginLastName>test</loginLastName>
</session>

I have a class representing this object as follows:

0 2
0 1.3K
Article
· Apr 27, 2017 7m read
Level up your XDATA

XDATA is used for a whole host of ISC libraries to store things like Zen pages, BPL logic and DTL transformations.

XDATA is the equivalent of XML config files of the JAVA world and JSON config files of the JavaScript / NPM world.

Whilst Atelier looks to shift source code to the disk, XDATA will remain a key component to source control our projects config / meta data.

3 4
0 1.1K

HealthShare HealthConnect and Information Exchange version 15.03 support import transformations from C-CDA 2.1 to SDA. You can find these transforms in your installation's csp/xslt/SDA3 directory. For general information about import transforms, see "CDA Documents and XSL Transforms in HealthShare" in Overview of Health Connect.

Among the enhancements to import functionality added in connection with C-CDA 2.1 support is the ability to preprocess your C-CDA input files prior to the transformation done for import.

2 0
0 1.1K

Hello,

How to get XML subtree from XPATH.DOMResult object as Stream or CacheString.

Here is my classmethod. My system receives XML message which has nested structures. The requirement is to send one message at a time to the destination. I have created the XPATH document and used EvaluateExpression method and which returns XML.XPATH.Result of type DOM. I am able to read the dom and get value of the element and its text. But I am looking to send back the subtree.

Code:

0 8
0 1.1K

The same piece of data never throws this error on other operations. I am getting this error on one always .

The same SDA container never throws error on other operation.

ERROR #6901: XSLT XML Transformer Error: SAXParseException: invalid character 0x1C (Occurred in an unknown entity)


Set xslt=##class(%Dictionary.XDataDefinition).%OpenId(..%ClassName(1)_"||Xmethod",-1,.tStatus)
$$$ThrowOnError(tStatus)
Set tStatus= ##class(%XML.XSLT.Transformer).TransformStream(myStream,xslt.Data,.OpStream)
$$$ThrowOnError(tStatus)

XData Xmethod
{

0 1
0 1K

Hello All,

I hope it's not a silly question.

Here is my issue:
I have 3 simple classes:

Parent class, let's say:

Class ParentClass Extends %RegisteredObject
{
Property a As %String;
}

and two children classes
Class A.Child Extends ParentClass
{
Property b As %String;
}

Class B.Child Extends ParentClass
{
Property c As %String;
}

So no issues - all compiles and seem to work.

But, when I add %XML.Adaptor to my parent class, so:

0 3
0 987