8 Followers · 235 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 Alex Kogan · Feb 1, 2019

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 f

1
0 533
Question Dhaval Shah · Jan 24, 2019

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>
        <Sta

2
0 791
Question Duncan Priest · Sep 5, 2018

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 cl

1
0 631
Question Pravin Barton · Nov 20, 2018

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?

2
0 691
Question Greg Arnold · Nov 1, 2018

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 st

1
0 898
Question Richard Housham · Aug 20, 2018

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

1
0 867
Question Neerav Verma · Sep 19, 2018

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

1
0 419
Question Thomas Kotze · Sep 11, 2018

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

1
0 456
Question Vivek Ranjan · Aug 31, 2018

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
{

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Trans

1
0 1315
Question Joao Palma · Aug 13, 2018

Hi

I need to query my messages and filter by a XML node.  

In the message viewer it would be Critetion Type = 'VDoc Property Path' and class = 'Enslib.Edi.XML.Document'.

At the moment my query looks like this

SELECT *

FROM EnsLib_EDI_XML.Document

where doctype = 'avc:mydoctype'

I need then to look for 'HeadNode:SubNodeValue'

Anyone who could help me out with this?

Thank you

5
0 768
Question Murillo Braga · Feb 22, 2018

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

2
0 492
Question Nicky Zhu · Jun 22, 2018

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.

1
0 978
Question Alex Kogan · Jun 14, 2018

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;

I can no longer compile any of the three classes involved and I get this error:
-----------------------

3
0 1294
Question p rd · May 29, 2018

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.PropertyPa

2
0 406
Question Pasi Leino · May 3, 2018

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-

1
0 640
Question Jack Smith · Feb 13, 2018

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?

My.Schema extends both %Persistent and %XML.Adaptor so I guess there should be some simple way to create an instance of EnsLib.EDI.XML.Document out of it?

EnsLib.EDI.XML.Document has f

2
0 880
Question Vivek Ranjan · Feb 8, 2018

Intersytems  documentation says not to hold entire SDA  as object in In-memory. 

 http://localhost:57772/csp/documatic/%25CSP.Documatic.cls?LIBRARY=registry&CLASSNAME=HS.SDA3.Container&MEMBER=&CSPCHD=001000000000x1zyO3kkajy0iIjjpi2dxUJUnwFSY_pz7jtbNV&CSPSHARE=1

 // Serialize Object to XML
  
  Set object = ##class(User.NewClass1).%New()
  object.Property1="one"
  object.Property2="two"
  object.Property3="three"
  object.Property4="four"
  Set w=##class(%XML.Writer).%New()
  set w.Charset="UTF-8"
  Set w.Indent=1
  set status=w.OutputToString()
  set status=w.StartDocument()
  Set status=w.RootO

1
0 570
Question Thembelani Mlalazi · Jan 5, 2018

I have read here  and tried to use the supplied examples to see what they do but keep on getting error please advice:

Method GetXMLDocFromFile(file = "C:test2.xml") As %XML.Document
{
    set reader=##class(%XML.Reader).%New()
    set status=reader.OpenFile(file)
    if $$$ISERR(status) {do $System.Status.DisplayError(status) quit $$$NULLOREF}
    set document=reader.Document
    set reNo=##class(%XML.Node).%New()//check here
    set reNo.Document=document//check here
    do ..ShowNamespaces(document)
    do ..ShowNode(reNo)//check here
    quit document
}
Method ShowNamespaces(do
6
0 1200
Question Thembelani Mlalazi · Jan 4, 2018

I am trying to achieve this in cache objects I am using  2014.1 here is the original code in C# and would like to convert this to cache

here is my code first c# and cache follows

     class Program
    {
        /// <summary>
        /// This function loads a XML document from the specified string.
        /// </summary>
        /// <param name="xml">Input XML string</param>
        /// <returns>XML to Json converted string</returns>
        public static string XmlToJSON(string xml)
        {
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.LoadXml(xml);
     
8
0 1584
Question Thembelani Mlalazi · Dec 20, 2017

I am trying to read an xml document using %XML.TextReader and that's is all well and l can get my elements values  but would like to determine where the next record start on the xml without referring to the document path in essence would like to use the same method to read different xml docs. I would like to know if is there a way or a function that I can use to get the start and end of a record in xml  as I would to get the start and end element.

Typical example  l would like to get the highlighted paths please note this would need to go for any xml doc

<productListing title="ABC Products">
6
0 908
Question Jack Smith · Nov 30, 2017

This might be a very simple rookie question but I'm trying to create couple of web services in Ensemble and using  document below as my tutorial, I do manage to do it:

http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY…

But instead of doing it as described above, where method signature is like this:

Method GetCustomerInfo(ID As %Numeric) As ESOAP.SOAPResponse [WebMethod]

I would like it to be:

Method GetCustomerInfo(valid XML against schema1) As valid XML against schema2 [WebMethod]

because I'm trying to replicate a web service from another n

7
0 838
Question Jenna Makin · Jun 1, 2016

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?

6
0 1738
Question Thembelani Mlalazi · Dec 7, 2017

I am trying to transform an Enlib.EDI.XML.Document through aXLT I know how to trans form the xml document  through a xlt stylesheet but been trying to get an Enlib.EDI.XML. Document from a procees by creating aoperation that will do the transformation of this to file if this can be done in a process all ideas welcome  so far I have come to this and I keep getting an error

:ERROR{ERROR #5002: Cache error: <PROPERTY DOES NOT EXIST>zXMLTOJson+6^TestEnvironment.Custom.GENERAL.CUSTOM.XLT.XMLToJsonOperation1.1 *Parameters,EnsLib.EDI.XML}
Class XLT.XMLToJsonOperation1 Extends (Ens.BusinessOpe
7
0 1020
Question Thembelani Mlalazi · Nov 9, 2017

I am using a %GlobalStream to create as % stream.Object and writing that to a file but for some reason when I run that on the terminal I get <PARAMETER>zWrite^%Library.GlobalCharacterStream.1 and no file is created

I have tried the following here is my code and still get the same result  any help  appreciated

ClassMethod WriteNodes(myfile As %String){
  set status=##class(%XML.TextReader).ParseFile(myfile,.textreader)

  set ptemp=##class(%GlobalCharacterStream).%New()
  //check status
  if $$$ISERR(status) {do $System.Status.DisplayError(status) quit}
  //iterate through document, nod
5
0 3178
Question Thembelani Mlalazi · Nov 6, 2017

I have a DTL that reads an xml file and I want transform that to a list of objects but I have a problem looping through my xml as when I try I get the first instance on the xml not the whole XML being transformed. here is my example. Here is the output

<s01:WardOccupancy>
<s01:WardOccupancy>
<Organisation>BYG</Organisation>
</s01:WardOccupancy>
</s01:WardOccupancy>
</msg>

from

<Message>
  <Record>
    <OrganisationCode>BYG</OrganisationCode>
  </Record>
  <Record>
    <OrganisationCode>BYG</OrganisationCode>
  </Record>
  <Record>
    <OrganisationCode>BYG</OrganisationC

1
0 755
Question Thembelani Mlalazi · Oct 20, 2017

I have a batch record mapper that reads a csv file and passes the message to a process that uses the EnsLib.MsgRouter.RoutingEngine and would like to pass the message to an operation that will output that as a XML file but so far been unlucky as the operation that I use , uses the EnsLib.EDI.XML.Operation.FileOperation which only works with the messages("BusinessOperation class for writing XML messages to a file. Works with XML messages of type EnsLib.EDI.XML.Document.") is there a way to achieve this or somewhere to read in order to achieve this I have asked before on this post but the answer

2
0 1100