Question Extract XML Tag values and attributes

Surrnderan

New Member
Hi,
I developed a Progress code where it can fetch XML Tag values and Attributes from a XML file for a Defined Tag Names.(where I know the Tag Names coming from the Inbound Directory)
Implemented Using Temp-Table Method.

Need Help On this:
Now I need to extract the same(Value and Attributes)where I Don't have idea on how many Tags and the name of the Tag coming from the Directory.

Thanks in Advance.
 

RealHeavyDude

Well-Known Member
By developed Progress code that can fetch XML tag values and attributes from an XML document you mean that you did not use the SAX ( IMHO the better choice ) or the DOM parser in the ABL? Which version of Progress you are talking about?

Heavy Regards, RealHeavyDude.
 

Surrnderan

New Member
Hi
Did not try with SAX or DOM......Just tried with temp-tables

Code:
  DEFINE TEMP-TABLE HOST NO-UNDO
  FIELD hostAddress  AS CHARACTER
  FIELD userName  AS CHARACTER
  FIELD password  AS CHARACTER
  FIELD instanceCount  AS CHARACTER.
  
  DEFINE TEMP-TABLE DEST NO-UNDO XML-NODE-NAME 'Destination'
  FIELD DestinationID AS CHARACTER XML-NODE-TYPE 'attribute' XML-NODE-NAME 'ID'  LABEL 'ID'
  FIELD frm AS CHARACTER XML-NODE-TYPE 'attribute' XML-NODE-NAME 'frm' LABEL 'FORMAT'
  FIELD authorizationId AS CHARACTER XML-NODE-TYPE 'attribute' XML-NODE-NAME 'authorizationId' LABEL 'AUTHID'
  FIELD tpid AS CHARACTER XML-NODE-TYPE 'attribute' XML-NODE-NAME 'tpid' LABEL 'TPID'.

Reading the XML file and then Display....

Version Release 11.2.1

Edit: Added code tags /mod
 
Last edited by a moderator:

Cringer

ProgressTalk.com Moderator
Staff member
I think you will save yourself a lot of pain in the long run if you learn how to use the built in SAX parser.
 

RealHeavyDude

Well-Known Member
+1.

The most efficient way to parse an XML document that can not be imported into a ProDataSet / Temp-Table using their respective READ-XML methods is the SAX parser. While there is an alternative in the DOM parser - I wouldn't recommend it much.

Heavy Regards, RealHeavyDude.
 
Top