XML

Syndicate content 17 

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-templates select="@*">
      <xsl:apply-templates>
    </xsl:apply-templates></xsl:apply-templates></xsl:copy>
  </xsl:template>
</xsl:output></xsl:transform>
 

XML

Last comment 5 days ago
0   0 4
0

answers

53

views

0

rating

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.

Last answer 3 April 2019 Last comment 5 April 2019
0   0 2
37

views

0

rating

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.

+ 2   2 1
0

comments

108

views

+ 2

rating

I am validating a v3 document against one xsd and using %XML.SAX.ContentHandler class . My requirment is to find the xpath of the error location. There is no method which does it.

I can find the line and offset using LocatePosition method. 

Can someone help me on this.

Thanks 

Suman

Last answer 14 March 2019
+ 1   0 2
0

comments

87

views

+ 1

rating

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

Last answer 22 February 2019 Last comment 22 February 2019
0   1 3
126

views

0

rating

Hello all,

I have an XSL question and I wanted to see if someone within a community can help me out.  

To Summarize: I am working with XSL documents, single and multi-pages.  
Inside my style sheet XML document, which is supporting my pages, everything on the page, including a headers, footers and the items are calculated 
based on the portrait measurements. 
Pages come up on the screen as portrait, but sometimes, depending on dynamic data are wide, they do not print properly in portrait.

If I turn them to  print in Landscape, now the page fit fine, but the measurements which were calculated for portrait do not readjust and therefore I have issues, specially with footers, which are never at the bottom of the pages anymore

Last comment 2 February 2019
0   0 2
0

answers

56

views

0

rating

Hi All,

Actually I am trying to implement a RESt API where in I will get ZIPCODE as request and I need to call external API which will take ZIPCODE as input and give State and City in response.

But the problem is the request is in XML Format and also response is in XML format.

Example :

https://XYZ.com/ABC.dll?API=CSLookUP&XML=<CSLookupRequest USERID="USERID">
<ZipCode ID='0'>
<Zip5>20024</Zip5>
</ZipCode>
</CityStateLookupRequest>

and in Response 

<?xml version="1.0" encoding="UTF-8"?>
<CSLookupResponse>
    <ZipCode ID="0">
        <Zip5>20024</Zip5>
        <City>WASHINGTON</City>
        <State>DC</State>
    </ZipCode>
</CSLookupResponse&gt

Last answer 24 January 2019 Last comment 24 January 2019
0   0 2
79

views

0

rating

I'm writing a SOAP client in Ensemble (2017.2.2) that is required to pass empty elements to the SOAP server in the form <xsi:type="ns:ResponsibleUser"/> where ResponsibleUser is a class that itself has no properties. I initially thought I'd found the answer with the XMLIGNORENULL parameter of XML enabled classes but this didn't make any difference for SOAP requests, only working when I wrote the XML to a file. Then I came across the XMLIGNORENULL parameter for the SOAP client class (inherited from %SOAP.WebBase), but this only works for %String properties and not for properties of arbitrary class types.

Is there a way to force the output of an empty object-valued property as an empty element in a SOAP request?

Thanks in advance for any guidance

Last answer 15 January 2019
0   0 1
0

comments

97

views

0

rating

For each instance of an XML-enabled class I want to control whether a property is projected as an empty element or not projected at all. With string properties, I can set the value as $c(0) for an empty element, or an empty string for no projection. But it looks like this isn't consistent for properties with type %Boolean or %Integer. With booleans $c(0) gets projected as "false". With integers $c(0) stays as a zero-width space in the XML output (which gives me a SAX parser error if I try to read it).

Is there a way to do this that works for all datatype properties?

Last answer 21 November 2018 Last comment 20 November 2018
0   0 2
96

views

0

rating

I have an Ens.StreamContainer which holds XML that was received, and I need to validate that against an XSD schema. The schema is very simple, only looking at the root element and maybe a couple other items to ensure the XML is what we expect before continuing the data flow.

I have imported my XSD into the Ensemble XSD wizard, so it is available, but I'm struggling to find a method that does the validation. I thought about possibly using the schema to generate a class definition, then attempt to load the XML as that object (try/catch to handle the failure scenario), but I don't know where to start on that either.

I have looked at %XML.Schema and EnsLib.EDI.XML.Schema classes, to no avail, but I believe I'm probably missing something.

Thanks in advance!

Last answer 1 November 2018
0   0 2
0

comments

95

views

0

rating

Hi I'm just trying to make sure I'm not missing a trick here.

Basically our PAS doesn't do hl7 messages but does some XML which you can create. So I'm just trying to create some xml files and then get healthshare/ensemble to parse them and to process accordingly. 

I'm getting some good results doing this. But maybe I've got a small hitch. In each of my xml files I've the data for the patient/client. 

Then in the xml schema which I've imported I've specified the elements. I've created a subtransform which has helped when converting but perhaps I should have created a schema for the client which I then can reuse in each of the others. So if I added on another client element it would be simple to do as I would only need to do it in a few places

Last comment 26 September 2018
0   0 2
0

answers

160

views

0

rating

Hi,

I have very recently started to work with Ensemble and have both the 2014 and the 2017 version. 

To learn, I have created a small test flow that takes an xml file using EnsLib.EDI.XML.Service.FileService, sends it to a Process that transforms it with xslt into another format, and then passes it onwards to a EnsLib.EDI.XML.Operation.FileOperation Business Operation. 

This is the code that I have before and when sending it onwards

Last answer 19 September 2018
0   0 2
0

comments

129

views

0

rating

I have a class extends %Persistent & %XML.Adaptor

It has 100 properties for example

Now I do intend to create a xml schema that I can import in Ensemble->XMLSchemas 

I did try to use XMLExportToString and %XMLWriter.GetXMLString

but didn't give me a proper schema. May be I am missing some small step

Can someone pls help

Last answer 19 September 2018
0   0 1
0

comments

75

views

0

rating

Hi, 

Connections/ SOAP Operations to 3rd Parties can hold some challenges like the 3rd party changes it 's structures/ WSDL  and returns an additional property in a SOAP response. So I have tried to implement the XMLIGNOREINVALIDTAG in the proxy SOAP response structures , but in Ensemble this seems to get ignored.

Are there any good suggestions on how to handle this an ideal would have been that the other party inform you of changes before hand....

Or we can ignore the tags, and inform the operations of such problems but the rest of the response message is valid and could be processed

Best regards

Last comment 11 September 2018
0   0 2
0

answers

102

views

0

rating

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

Last answer 31 August 2018
0   0 2
0

comments

159

views

0

rating

Hello guys,

Based on this article (others as well, but this is the relevant one): http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...

I have been playing around with the Management Portal deployment tool, which involves:
Ensemble > Manage > Deployment Changes > Deploy and
Production Settings > Actions > Export
Production Settings > Actions > Re-Export

Everything was going fine , until I came across this:

- For the default settings, once I include them in the final xml and deploy the package into another production, by checking the default settings screen to the new production, I spotted that the the original production name remains there. This is useless for me, because I was expecting the settings to now be tied up to the new production. Is this an expected behaviour

Last answer 22 February 2018 Last comment 17 July 2018
0   0 2
192

views

0

rating

Hi folks,

One of my clients want to project a null property of a cache object to an empty XML element. Say, if we have a class:


Class Diabetes.BS.Message.LabReportMessage Extends Ens.Request
{

Property Report As %String;

Property IsRisky As %Boolean;

Property RiskValue As %String ;

}


If the instance of this class has a null RiskValue, after projection, they want the XML as following:

<LabReportMessage>
                <Report>Somestring</Report>
                <IsRisky>1</IsRisky>
                <RiskValue/>
 </LabReportMessage>

Is there any way we can do it? Thanks.

Last answer 22 June 2018
0   0 0
0

comments

184

views

0

rating

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:

Class ParentClass Extends (%RegisteredObject, %XML.Adaptor)
{
 Property a As %String;
}

Last answer 14 June 2018 Last comment 14 June 2018
0   0 2
169

views

0

rating

I want to generate one of the following xml data, but after I generate only de="", after I need to generate is de="DEX71.41.009.01"

//// result:
<OPTREGISTER>
      <THBZ de="DEX71.41.007.01" display=""></THBZ>
      <GHFS de="DEX71.41.008.01" display=""></GHFS>
      <GHF de="DEX71.41.009.01"></GHF>
      <ZLF de="DEX71.41.009.01"></ZLF>
      <QTF de="DEX71.41.009.01"></QTF>
      <WDBZ de="DEX71.41.010.01" display=""></WDBZ>
      <GHKSDM de="DE08.10.025.00" display=""></GHKSDM>
</OPTREGISTER>

The classes I use are as follows:

////// ------ Test.Common.PropertyParameters cls
Class Test.Common.PropertyParameters Extends %XML.PropertyParameters [ ProcedureBlock ]
{


Parameter HDSD As STRING;


Parameter DE As STRING;

Last answer 30 May 2018 Last comment 30 May 2018
0   0 3
124

views

0

rating

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

Last answer 16 May 2018 Last comment 17 May 2018
0   0 3
486

views

0

rating

I need to create a document with a root like this:

<?xml version="1.0" encoding="UTF-8"?>
<RCMR_IN200002FI01 xmlns="urn:hl7-org:v3" ITSVersion="XML_1.0">
...

</RCMR_IN200002FI01>

However, the CreateDocument in %XML.Document only allows namespace as an additional argument.

I did override this method, but trying to do something like

Do document.SetAttribute("ITSVersion",,"XML_1.0") only results an empty document with the <?xml> declation only.

-Pasi-

Last answer 7 May 2018
0   0 1
0

comments

161

views

0

rating

I have used Studio's schema wizard to create classes representing my XML structure as defined in an xsd file and then I use the main class of that set of classes as parameter in my Ensemble web service.

 

Let's say I have a web method signature like this:

Method myMethod(message As My.Schema) As %String [ WebMethod ]

How do in that method take this message and convert it into a EnsLib.EDI.XML.Document

Last comment 21 February 2018
0   0 3
0

answers

255

views

0

rating