Focal Point Banner


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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
Create XML file
 Login/Join
 
Silver Member
posted
Hi,

Is it possible to create an XML file in WebFocus.

For Example:

TABLE FILE CAR
PRINT CAR MODEL BODYTYPE SEATS
BY COUNTRY
END

Should generate the following XML file.


<COUNTRY>ENGLAND</COUNTRY>
<CAR>JAGUAR</CAR>
<MODEL>V12XKE AUTO</MODEL>
<SEATS>2</SEATS>

Thanks
Mickey
 
Posts: 33 | Location: New York, USA | Registered: August 11, 2003Report This Post
Silver Member
posted Hide Post
Just add

ON TABLE PCHOLD FORMAT XML or
ON TABLE HOLD FORMAT XML

That will do it.

Ben
 
Posts: 34 | Location: 2 Penn Plaza | Registered: July 29, 2004Report This Post
Gold member
posted Hide Post
Mickey,

Here is a complete FEX using CAR that returns an XML document:

TABLE FILE CAR
SUM
SALES
BY
COUNTRY
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT XML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
UNITS=IN,
PAGESIZE='SCREEN',
LEFTMARGIN=0.000000,
RIGHTMARGIN=0.000000,
TOPMARGIN=0.000000,
BOTTOMMARGIN=0.000000,
SQUEEZE=ON,
ORIENTATION=PORTRAIT,
$
TYPE=REPORT,
GRID=OFF,
FONT='ARIAL',
SIZE=9,
COLOR='BLACK',
BACKCOLOR='NONE',
STYLE=NORMAL,
RIGHTGAP=0.125000,
TOPGAP=0.013889,
BOTTOMGAP=0.027778,
$
TYPE=TITLE,
STYLE=BOLD,
$
TYPE=TABHEADING,
SIZE=12,
STYLE=BOLD,
$
TYPE=TABFOOTING,
SIZE=12,
STYLE=BOLD,
$
TYPE=HEADING,
SIZE=12,
STYLE=BOLD,
$
TYPE=FOOTING,
SIZE=12,
STYLE=BOLD,
$
TYPE=SUBHEAD,
SIZE=10,
STYLE=BOLD,
$
TYPE=SUBFOOT,
SIZE=10,
STYLE=BOLD,
$
TYPE=SUBTOTAL,
BACKCOLOR=RGB(210 210 210),
$
TYPE=ACROSSVALUE,
SIZE=9,
$
TYPE=ACROSSTITLE,
STYLE=BOLD,
$
TYPE=GRANDTOTAL,
BACKCOLOR=RGB(210 210 210),
STYLE=BOLD,
$
ENDSTYLE
END

Hope this helps! Smiler
 
Posts: 55 | Registered: May 22, 2003Report This Post
Gold member
posted Hide Post
bump Smiler

is it possible to have the output as clean as mickey asked.

ENGLAND
JAGUAR
V12XKE AUTO
2

pchold as XML, is VERY cluttered... i would love to be able to clean it up to basics.

-Thanks


~~~||~~~||~~~||~~~||~~~||~~~||~~~||~~~||~~~||~~~
PROD: WebFOCUS 7.1.3 on Win 2K/IIS 6/ISAPI Mode/Self-Serve Apps Only (No App Server)
TEST: WebFOCUS 7.1.3 on Win 2K/IIS 6/Weblogic 8.1/Servlet Mode
 
Posts: 74 | Location: Gaithersburg, MD | Registered: August 08, 2006Report This Post
Expert
posted Hide Post
MZZ,

Of course it is, but not using XML output. You would have to "hand crank" your output -
APP FI MYXML DISK BASEAPP/MYXML.XML
DEFINE FILE CAR
  CRLF/A1 = HEXBYT(10,'A1');
  XML_COUNTRY/A29  = '<country>'||COUNTRY||'</country>';
  XML_CAR/A27      = '<car>'||CAR||'</car>';
  XML_MODEL/A39    = '<model>'||MODEL||'</model>';
  XML_BODYTYPE/A33 = '<bodytype>'||BODYTYPE||'</bodytype>';
END
TABLE FILE CAR
PRINT XML_COUNTRY CRLF
      XML_CAR CRLF
      XML_MODEL CRLF
      XML_BODYTYPE
ON TABLE SAVE AS MYXML
END

Note: Using OVER will make no difference to the output, before you ask Wink that is why I've used an embeded line feed character.

Forgot to mention that you would need to use FTOA, PTOA or EDIT to get the numerics into the alpha output.

T

This message has been edited. Last edited by: Tony A,



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, 2004Report This Post
Virtuoso
posted Hide Post
Don't forget the XML header and maybe trailer.

I created an RSS feed (which is XML), but used a different approach. As I used maintain (for speed), the pseudo-ish code goes like:
APP FI XMLFILE DISK BASEAPP/XMLFILE.XML
TABLE FILE CAR
PRINT CAR MODEL BODYTYPE SEATS
BY COUNTRY
ON TABLE SAVE
END
-RUN
-WRITE XMLFILE <?xml version="1.0" encoding ="iso-8859-1"?>
-WRITE any other headers you want
-REPEAT BLOCK &LINES TIMES
-READ SAVE &FLD2.10 &FLD2.20 etc.
-WRITE XMLFILE <fieldname1>!IBI.AMP.FLD1;</fieldname1>
-WRITE XMLFILE <fieldname2>!IBI.AMP.FLD2;</fieldname2>
-BLOCK
-WRITE any footers

You could also write the headers, run Tony's code with an APPEND.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Gold member
posted Hide Post
Thanks! Smiler


~~~||~~~||~~~||~~~||~~~||~~~||~~~||~~~||~~~||~~~
PROD: WebFOCUS 7.1.3 on Win 2K/IIS 6/ISAPI Mode/Self-Serve Apps Only (No App Server)
TEST: WebFOCUS 7.1.3 on Win 2K/IIS 6/Weblogic 8.1/Servlet Mode
 
Posts: 74 | Location: Gaithersburg, MD | Registered: August 08, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders