As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
Good morning, I am working with an outside vendor who needs for us to submit data to them in an XML file. I have createf the file which is appearing as shown below. ******************************************* < ?xml version="1.0" encoding="ISO-8859-1" ? > - < fxf version="1.0" data="hold" > - < report records="65" lines="65" columns="48" rows="65" > < target format="" version="" type="" destination="PSYCH_XML_IMPORT_DTD_20070201" / > - < column_desc> < col colnum="c0" fieldname="FACILITY_VISIT_ID" alias="E01" datatype="char" width="20" focus_format="A20" description="" accept="" help_message="" title="" within="" property="" reference="" valign="left" / > < col colnum="c1" fieldname="ADMISSION_DATE" alias="E02" datatype="char" width="10" focus_format="A10" description="" accept="" help_message="" title="" within="" property="" reference="" valign="left" / > < col colnum="c2" fieldname="ADMISSION_TYPE" alias="E03" datatype="char" width="3" focus_format="A3" description="" accept="" help_message="" title="" within="" property="" reference="" valign="left" / > **********************************************
However, what I need for my output to be is like this; which is according to their specifications how my XML file is suppose to appear as a true XML format.
< ?xml version="1.0"? > < !DOCTYPE qipsych SYSTEM "C:\Psych\dtd\Psych_xml_import_dtd_20070214.dtd" > < qipsych > < qip_case > < case_id>Psych_Test2 < admission_date>1/2/2007 < admission_type>3 < admission_source>1 **************************************** Can anyone tell me how to make the above file appear in a "true" XML format as they have specified. I have asked the question on this board earlier but to no avail.This message has been edited. Last edited by: <Kathryn Henning>,
WebFOCUS 7.1.3 on Win 2000
Posts: 45 | Location: North Carolina | Registered: February 17, 2005
What data source are you using? If it is MS SQL then you could just perform the XML file creation without WF. Just because WF has an output format of XML doesn't mean you have to use it.
Right tool for the right job.
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
Thanks you Tony. Unfortunately, I am not proficient in writing SQL against our DB@ datasource. That at least helps me understand what needs to be done to get what they need.
Leah, yes it did. When I copied the code in the post it actual disappeared. I had to place a space before and after the tags so it would show my examples.
WebFOCUS 7.1.3 on Win 2000
Posts: 45 | Location: North Carolina | Registered: February 17, 2005
The first thing to notice is the second line which intimates that they will also require a DTD file, which is like a schema structure file This is used to determine how the XML data should interpreted. WF doesn't create one of these so you're off to a dead stop immediately.
You could try and filedef a file and write the headers to it and then reopen the same file in append mode to target the output from a fex that controls the output you need. A lot of work and not one that I would suggest undertaking without a good understanding of a "real" XML suite of files (.xml, .dtd, .xsl etc.).
I would troll the interweb looking for articles on DTDs and XML to understand the relationship and then try and determine how best to proceed. Try the W3C web site for starters.
Good luck.
T
In FOCUS since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2
WebFOCUS App Studio 8.2.06 standalone on Windows 10
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004
There's a standard DTD for the WebFOCUS XML report format already in the WebFOCUS path. It's called FXF.DTD. HOLD FORMAT XML always confirms to this DTD. So it doesn't publish a copy of that DTD for each hold file.
Bob Jude Ferrante Director of Business and Development WebFOCUS Performance Management Bob_Ferrante@ibi.com 917-339-5105
I'll take any questions about PMF - business or technical - anytime!
I think hold format XML is IBI's own flavour used internally to pass info between applications.
Possibly you get the ability to ON TABLE HOLD FORMAT WHAT_MOST_PEOPLE_WOULD_EXPECT_IN_XML if you buy the XML adapter, since it could be quite easily done and would be extremely useful.
It would be quite easy to write a single seg hold file conversion to xml utility, but multi seg hierachic structures (format focus) would be harder.
Here is the pseudo code for a single seger assuming all outputs converted to alpha. Takers anyone?
tf syscolum print name if tbname eq 'holdname' ots end -run
define file hold xmlfield/a6000 = -read save &fld while ioreturn ne 0 -set &fld = truncate(&fld) '<&fld|>' | &fld | '&fld>' -loop ; END TABLE FILE HOLD PRINT XMLFIELD OTS END
Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2 Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
Posts: 888 | Location: Airstrip One | Registered: October 06, 2006
Just putting a little more meat on Johns pseudo code:
SET HOLDLIST = PRINTONLY
SET ASNAMES = ON
SET PAGE = NOPAGE
SET LINES = 99999
-* Set output file path and name for the XML file
FILEDEF XMLOUT DISK META/MYXML.XML
-* where to put the temp files
APP HOLD META
-* The main TABLE request
-* for this very simple version, ensure all fields are in ALPHA format,
-* otherwise you have to convert when creating the XML
DEFINE FILE CAR
MYDATE/A10 = EDIT('&DMYY','99/99/9999');
END
TABLE FILE CAR
PRINT CAR
COUNTRY
MODEL
BODY
SALES/A8
MYDATE
BY COUNTRY NOPRINT
-* AS whatever_you_want
ON TABLE HOLD AS forxml_request001
END
-* Get the column names from the HOLD file
-* Make sure you have the SYSCOLUM master, or a copy, in your path.
TABLE FILE SYSCOLUM
PRINT NAME COLTYPE
-* Same name as HOLD file
IF TBNAME EQ forxml_request001
-* AS whatever_you_want
ON TABLE SAVE AS forxml_fields001
END
-RUN
-SET &numFields = &LINES;
-* Create the XML document from the HOLD file
DEFINE FILE forxml_request001
LINE1/A50='<?xml version="1.0"?>';
-* The following you might want to have set with &vars
LINE2/A80='<!DOCTYPE qipsych SYSTEM "C:\Psych\dtd\Psych_xml_import_dtd_"20070214.DTD">';
LINE3/A12='<qipsych>';
LINE4/A12='<qip_case>';
LINE5/A12='</qip_case>';
LINE6/A12='</qipsych>';
-* DUMMY stops a blank line appearing in the output.
DUMMY/A1=' ';
END
TABLE FILE forxml_request001
HEADING
"<LINE1"
"<LINE2"
"<LINE3"
"<LINE4"
-* Use only PRINT
PRINT
-SET &CNTR=0;
-* Repeat for the number of columns output from SYSCOLUM
-REPEAT :XMLLoop &numFields TIMES
-SET &CNTR=&CNTR+1;
-* READ the output from syscolum table
-READ forxml_fields001 &fieldName.A66
-* truncate the fieldnames
-SET &nameLength = ARGLEN(&fieldName.LENGTH,&fieldName,'I2');
-SET &SHORTNAME = SUBSTR(66,&fieldName,1,&nameLength.EVAL,&nameLength.EVAL,'A&nameLength.EVAL');
-* set fieldnames to lower case
-SET &shortName = LOCASE(&nameLength.EVAL,&SHORTNAME,'A&nameLength.EVAL')
COMPUTE RECORD_&CNTR /A200 = '<&shortName|>' || &SHORTNAME || '</&shortName|>'; AS ''
-IF &CNTR EQ &numFields GOTO :XMLLoop;
OVER
-:XMLLoop
BY DUMMY NOPRINT
ON DUMMY SUBFOOT
"<LINE5"
"<LINE6"
-* WP format suits this output best
ON TABLE SAVE AS XMLOUT FORMAT WP
END
which I think gets near to what Nailzz was looking for. (Note: There is no such thing as a true XML file as the whole idea is that an XML document is user defined)This message has been edited. Last edited by: Alan B,
Alan. WF 7.705/8.007
Posts: 1451 | Location: Portugal | Registered: February 07, 2007
Bonjour, I'm surprised that DM is used for reading when Focus does it so far better. Think that an old idea of WP Files with all the Power of Focus for SubFoot and Subhead should do better. But before : "Me too, sounds interesting" : Bailleul.Claude@neuf.fr Cordialement and Focusement PS : TonyA your "Old focus etc ..." is great. 30 km of sea make a big difference
Focus Mainframe 7.6.11 Dev Studio 7.6.11 and !!! PC Focus, Focus for OS/2, FFW Six, MSO
Sorry to be back, In fact I use the analysys of the Master (Check File Pict Hold) to generate A Focus request in a WP file. There is so much DM in that 'Generator...' that I dare not show it ( It's a flower in a transparent plastic cube that some people call a Black Box). An utilitarian extract the 80 chars of Focus line out of the WP file. You just have to EX that file of Focus Code ... The flexibility of DM is used to help Focus handle different Options, but in the end, it's Focus and not DM that access the Data. Focusely PS : I know it's time for me to get out of the game, but, you know, an Old Focus lover can turn into a bore ... I mean the idea is not so stupid, but the way to show it is awful !!!
Focus Mainframe 7.6.11 Dev Studio 7.6.11 and !!! PC Focus, Focus for OS/2, FFW Six, MSO