Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

UniVerse 10.1.2 & XML

74 views
Skip to first unread message

Izzi Zman

unread,
Jun 20, 2024, 8:32:09 PM6/20/24
to Pick and MultiValue Databases
We're on an AIX platform using an old version of UV 10.1.2. I see some
limited functions for XML and am wondering if they function properly ?
Remember trying this years ago but things didn't seem to work properly
when creating the DTD, XMLMAP etc...
Is it better I just create my Basic program and parse the old fashioned
way (since the version of UV is not current)  or are there any
suggestions out there or examples to get me going. Fairly
straightforward document but I don't really know how to begin and
approach ? Been doing UV for 25+ years but just now looking to get
started on this and might as well take advantage if it works.

Thanks,
Izzi

Rex Gozar

unread,
Jun 24, 2024, 7:53:22 AM6/24/24
to mvd...@googlegroups.com
I've done XML in production using Universe. Building XML without the Universe XML functions is simple enough to create and maintain. However, parsing other people's XML to extract data can be tricky and I recommend using the Universe XDOM functions. To make things easier, I created an XDOM.GETVALUE() function that encapsulated a couple functions:

      FUNCTION XDOM.GETVALUE(XDOM, XPATH)
* This function encapsulates the messy code to get a single value
* from an XDOM object; hopefully making the calling program easier
* to understand.
******
$INCLUDE UNIVERSE.INCLUDE XML.H
*
      EQU VERBOSE LIT \ NULL ; **DISPLAY\
      EQU NAMESPACE$EMPTY TO ""
*
      VALUE = ""
      ERRCODE = XDOMLocate(XDOM, XPATH, NAMESPACE$EMPTY, NODE)
      IF (ERRCODE) THEN
         VERBOSE "ERROR! XDOMLocate() FOR ":DQUOTE(XPATH):" FAILED! ERRCODE=":ERRCODE
         RETURN (@NULL)
      END
      ERRCODE = XDOMGetNodeValue(NODE, VALUE)
      IF (ERRCODE EQ XML.ERROR) THEN
         * the node was found, but was empty
         VERBOSE "ERROR! XDOMGetNodeValue() FOR ":DQUOTE(XPATH):" FAILED! ERRCODE=":ERRCODE
         RETURN ("")
      END
      IF (ERRCODE) THEN
         VERBOSE "ERROR! XDOMGetNodeValue() FOR ":DQUOTE(XPATH):" FAILED! ERRCODE=":ERRCODE
         RETURN ("")
      END
      RETURN (VALUE)
   END

--
You received this message because you are subscribed to
the "Pick and MultiValue Databases" group.
To post, email to: mvd...@googlegroups.com
To unsubscribe, email to: mvdbms+un...@googlegroups.com
For more options, visit http://groups.google.com/group/mvdbms
---
You received this message because you are subscribed to the Google Groups "Pick and MultiValue Databases" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mvdbms+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mvdbms/96af7ebd-947b-40d5-af3b-4fff7bf23b7en%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages