List of supported nnenmonics for ANSI terminals (X364)

%X364 ; BINDING FOR ANSI X3.64 NAMESPACE, NOV/92 ; LRS952 06/07/05
  
APC ; Application program command
BEL ; Ring the bell
CBT(%1) ; Cursor backward tabulation %1 tab stops
CCH ; Cancel character
CHA(%1) ; Cursor horizontal absolute (move to column %1)
CHT(%1) ; Cursor horizontal tabulation (forward %1 tab stops)
CNL(%1) ; Cursor next line (cursor down %1 lines)
CPL(%1) ; Cursor preceding line (cursor up %1 lines)
CPR ; Cursor position report (return in $KEY)
CTC(%1,%2,%3,%4,%5,%6,%7,%8,%9) ; Cursor tabulation control
CUB(%1) ; Cursor backward %1 columns
CUD(%1) ; Cursor down %1 lines
CUF(%1) ; Cursor forward %1 columns
CUP(%2,%1) ; Cursor position (column %1, line %2)
CUU(%1) ; Cursor up %1 lines
CVT(%1) ; Cursor vertical tabulation
DAQ(%1,%2,%3,%4,%5,%6,%7,%8,%9) ; Define area qualification
DCH(%1) ; Delete %1 characters
DCS ; Device control string
DL(%1) ; Delete %1 lines
DSR(%1) ; Device status report - type %1 - return in $KEY
EA(%1) ; Erase in area
ECH(%1) ; Erase %1 characters
ED(%1) ; Erase in display (%1=0 cursor-to-end,1 begin-to-cursor,2 entire scr)
EF(%1) ; Erase in field
EL(%1) ; Erase in line (%1=0 cursor-to-end, 1 begin-to-cursor, 2 entire line)
EPA ; End of protected area
ESA ; End of selected area
HPA(%1) ; Horizontal position attribute (cursor to column %1)
HPR(%1) ; Horizontal position relative (cursor forward %1 columns)
HTJ ; Horizontal tab with justify
HTS ; Horizontal tabulation set
HVP(%1,%2) ; Horizontal and vertical position (column %1, line %2)
ICH(%1) ; Insert %1 characters
IL(%1) ; Insert %1 lines
IND ; Index
INT ; Interrupt
MC ; Media copy
MW ; Message waiting
NEL ; Next line
NP(%1) ; Next page (advance %1 pages of terminal display memory)
OSC ; Operating system command
PLD ; Partial line down
PLU ; Partial line up
PM ; Privacy message
PP(%1) ; Preceding page (backup %1 pages of terminal display memory)
PU1 ; Private use one
PU2 ; Private use two
REP ; Repeat
RI ; Reverse index
RIS ; Reset to initial state
RM(%1,%2,%3,%4,%5,%6,%7,%8,%9) ; Reset mode
SEM ; Select editing extent mode
SGR(%1,%2,%3,%4,%5,%6,%7,%8,%9) ; Select graphic rendition %1 thru %9
SM(%1,%2,%3,%4,%5,%6,%7,%8,%9) ; Set mode
SPA ; Start of protected area
SS2 ; Single shift two
SS3 ; Single shift three
SSA ; Start of selected area
ST ; String terminator
STS ; Set transmit state
SU ; Scroll up
TBC ; Tabulation clear
VPA(%1) ; Vertical position attribute (move to row %1 at same column)
VPR(%1) ; Vertical position relative (move down %1 lines at same column)
VTS ; Vertical tabulation sets

As Eduard already pointed out there is just no need to use %XML.Node as %XML.Document inherits it already

I have elaborated your code also to cover Attributes and Chlidren in the document.
and added some readability features.

To some extend  %XML.TextReader could have done the same.

No need to copy the code from browser the class + test data is attached. xmlreading.zip  

Class XML.J [ Abstract ]
{

ClassMethod GetXMLDocFromFile(file = "C:\InterSystems\Cache\mgr\user\Test.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}
#dim document as %XML.Document
    set document=reader.Document
 #; set reNo=##class(%XML.Node).%New() //check here
 #; set reNo.Document=document //check here
 #; do ..ShowNode(reNo)
    do ..ShowNamespaces(document)
#dim node as %XML.Node
    set %lev=0
    set node=document.GetDocumentElement()
    do ..Analyze(node)
    quit document
}

ClassMethod Analyze(node As %XML.Node)
{
    set hasChild =..ShowNode(node)
    set attribute=node.FirstAttributeName()
    while attribute'="" {
            do ..ShowAttribute(.attribute,node)
        }
    if hasChild {
        set tSC=node.MoveToFirstChild(1)
        if tSC , $i(%lev) {
            while tSC {
                do ..Analyze(node)
                set tSC=node.MoveToNextSibling(1)
                }
            do node.MoveToParent() if $i(%lev,-1)
            }
    }
    quit
}

ClassMethod ShowAttribute(ByRef attribute, node As %XML.Node)
{
   write !?(%lev+1*3),"Attribute_Name ",attribute
        ,!?(%lev+1*3),"Atribute_Value ",node.GetAttributeValue(attribute)
#; more to be added here
        ,!?(%lev+1*3),"--------------------------"
    set attribute=node.NextAttributeName(attribute)
    quit
}

ClassMethod ShowNamespaces(doc As %XML.Document)
{
    Set count=doc.CountNamespace()
    Write !, "Number of namespaces in document: "_count
    For i=1:1:count {
        Write !, "Namespace "_i_" is "_doc.GetNamespace(i)
}
}

// how to use the below method

ClassMethod ShowNode(node As %XML.Node) As %Boolean
{
    If node.NodeType=$$$xmlELEMENTNODE  {
        Write !?(%lev*3),"LocalName="_node.LocalName
#; Write !,"Namespace="_node.Namespace
#; }
#; If node.NodeType=$$$xmlELEMENTNODE {
#; Write !,"NamespaceIndex="_node.NamespaceIndex
        Write !?(%lev*3),"Nil="_node.Nil
        Write !?(%lev*3),"NodeData="_node.NodeData
        Write !?(%lev*3),"QName="_node.QName
    }
    Write !?(%lev*3),"NodeId="_node.NodeId
    Write !?(%lev*3),"NodeType="_node.NodeType
    Write !?(%lev*3),"HasChildNodes returns "_node.HasChildNodes()
    
    If node.NodeType=$$$xmlELEMENTNODE {
        Write !?(%lev*3),"GetNumberAttributes returns "_node.GetNumberAttributes()
        Set status=node.GetText(.text)
          If status {
           Write !?(%lev*3), "Text of the node is "_$tr(text,$c(10))
            else {
                Write !?(%lev*3), "GetText does not return text"
            }
    }
    quit node.HasChildNodes()
}
}

It seems to me you try to call a SOAP service.
That service requires some special XML structured content. That is missing. It is typically  placed in  Authtoken.Entity
you can test your request by

 set tSc = AuthToken.Post("/webservices/Void",1) to see what you send.with is empty in your case.

It may work with pure %Net.HttpReqquest but if you have a valid WSDL definition you better use
the WebService Client Generator in Caché Studio that does it all for you. 

It would be useful to have sour WSDL to try it. Pls. attach it.
As I don't have a personal account on UPS I'n unable to identify what you a re trying to achieve.

I worked also with PHP WS. It does a lot under cover (without your control) that you have to do in Caché by your own code.
eg. at any request the related WDSL is downloaded for actual mapping.

I was wondering where this goes and how you could get so far.
Caché uses a temp file.
 

USER>set sbJSON =##class(%Stream.FileCharacter).%New()
USER>s sc=sbJSON.WriteLine(12123)
 
USER>zw sc
sc=1
 
USER>zw sbJSON
sbJSON=<OBJECT REFERENCE>[6@%Stream.FileCharacter]
+----------------- general information ---------------
|      oref value: 6
|      class name: %Stream.FileCharacter
| reference count: 2
+----------------- attribute values ------------------
|     (%Concurrency) = 1
|          %Location = ""  <Set>
|         (%LockRef) = ""
|          (%Locked) = 0
|              AtEnd = 0
|                BOM = ""
|         (CurrFile) = "C:\InterSystems\17E20\mgr\Temp\mAiLCZXuPXOaSQ.stream"
|                 Id = ""  <Set>
|     LineTerminator = $c(13,10)  <Set>
|      (MakePermLoc) = 1
|             (Mode) = 3
|(NormalizedDirectory) = "C:\InterSystems\17E20\mgr\Temp\"
|(OidTranslateTable) = 0
|         (ReadMode) = 0
|           ReadSize = ""
|      RemoveOnClose = 0
|        (StoreFile) = ""
|  StreamFormatWrite = 1
|         (TempFile) = "mAiLCZXuPXOaSQ.stream"
|     TranslateTable = ""  <Set>
|      UseVMSVersion = 0
|   (VariableRecord) = 0
+--------------- calculated references ---------------
|  CanonicalFilename   <Get>
|           Filename   <Get,Set>
|       LastModified   <Get>
|               Size   <Get>
+-----------------------------------------------------
 
USER>

Analyzing you code I see the problem in this line:

              do sbJSON.WriteLine($C(92)_..SafeJSON(node.GetDocumentNode())_$C(92)_$C(58))


I take for given that sbJSON is a valid object.
So I further investigate on node 

   ..XmlToJSONnode( )  is called twice + recursive
#1  from ..
XmlToJSON() looks fine

#2 is suspicious as in  .. OutputNode() I see   
 

Method OutputNode(childname As %String, alChild As %RegisteredObject, sbJSON As %Stream, showNodeName As %Boolean)
{
             if (alChild = null)      // EMPTY, NOT AN OBJECT
            ... }
            elseif (alChild)          // IT IS eventually an OBJECT REFERENCE
            { ...  }
            else       // NOT EMPTY, NOT NUMERIC, AND NOT AN OBJECT REFERENCE
            {
               do ..XmlToJSONnode(sbJSON,alChild, showNodeName)
; > > > > > > > > > > > > > > > > > > > >^^^^^^  // WHAT is this now ???

            }
             do sbJSON.WriteLine($C(4))
}

so what you hand over is not an oref as this looks like <integer>@<classname>  
therefore you fail with <INVALID OREF>zXmlToJSONnode+3^SharpJSONToXML.1

so some action is required to find out what happens

BTW:

passing sbJSON by reference would make this recursive construct easier to understand
as you intend to work to the same stream object anyhow.
or just use %sbJSON as single common reference

with 

set tSc AuthToken.Post("/webservices/Void")

you miss some content to POST and get

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Header/>
    <soapenv:Body>
        <soapenv:Fault>
            <faultcode>Client</faultcode>
            <faultstring>An exception has been raised as a result of client data.</faultstring>
            <detail>
                <err:Errors xmlns:err="http://www.ups.com/schema/xpci/1.0/error">
                    <err:ErrorDetail>
                        <err:Severity>Hard</err:Severity>
                        <err:PrimaryErrorCode>
                            <err:Code>10001</err:Code>
                            <err:Description>The XML document is not well formed</err:Description>
                            <err:Digest>Unexpected element: CDATA</err:Digest>
                        </err:PrimaryErrorCode>
                        <err:Location/>
                    </err:ErrorDetail>
                </err:Errors>
            </detail>
        </soapenv:Fault>
    </soapenv:Body>
</soapenv:Envelope>

use instead

set tSc AuthToken.Get("/webservices/Void")

and receive

<HTML>
<HEAD><TITLE>UPS Online Tools VoidWS</TITLE></HEAD>
<BODY><H2>
Service Name: VoidWS<br>
Remote User: null<br>
Server Port: 443<br>
Server Name: wwwcie.ups.com<br>
Servlet Path: /Void<br>
</H2>
</BODY></HTML>

just run $System.OBJ.Export() for your Global and hand over the result to your CVS.

USER>s sc=$system.OBJ.Export("^rcc.GBL","exportTest.txt",,.error,"UTF8")
 
Exportieren in XML gestartet am 04/01/2018 10:25:26
Exportiere Global: ^rcc

the result is a nice XML structure

and $system.OBJ.Import()  reloads it  

The extension  .GBL is the important thing

http://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?P...

Update: 

Blocks.Router uses $toJSONFormat() {CR/LF formatedOutput }
this hidden function hasn't been ported. replacement with %ToJSON()  does it as well.
So TREE view works nice.

Map view gets no content (and no colored dots  crying ).
Reason:  Block Count=0 and also %Fill -> nothing to display (makes sense somehow). 
This is also with the original classes in 2016.1.4 ;
Looks like an privilege issue.

You are missing the point.

12345 is the port used by the cache DB server   (default=1972) of your instance.
internally there is a mapping between the logical NAMESPACE and the physical disk directory and that NAMESPACE is used in connection string.
if your namespace is called DB then  you have to use 

jdbc:Cache://localhost:12345/DB

But if you just have the directory .../cache/db/cache.dat  you can't say what NAMESPACE this is
You have to know your Caché configuration.

Some reading on Caché configuration may give you background information
http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...