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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Display XML file stored in SQL Table

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Display XML file stored in SQL Table
 Login/Join
 
Guru
posted
I am trying to display a XML file that is stored in column of a SQL table but have had no luck.
The data is coming from a stored procedure.

Here is the master.
  
FILENAME=MIS_LOAD_XML_MSG, SUFFIX=SQLMSS  , $
  SEGMENT=INPUT, SEGTYPE=S0, $
    FIELDNAME=@MSGID, ALIAS=P0001, USAGE=A38V, ACTUAL=A38V,
      MISSING=ON, ACCESS_PROPERTY=(NEED_VALUE), $
  SEGMENT=OUTPUT, SEGTYPE=S0, PARENT=INPUT, $
    FIELDNAME=@RETURN_VALUE, ALIAS=P0000, USAGE=I11, ACTUAL=I4, $
  SEGMENT=RS, SEGTYPE=S0, PARENT=INPUT, $
    FIELDNAME=RAWMSG, ALIAS=RawMsg, USAGE=TX50, ACTUAL=TX, $


Here is the report.
TABLE FILE MIS_LOAD_XML_MSG
PRINT
     RAWMSG
WHERE @MSGID EQ '21EC2020-3AEA-1069-A2DD-08002B30309D'
END


Doing straight SQL passthru doesn't work either.
  
SET SQLENGINE=SQLMSS
SQL SQLMSS SET DEFAULT_CONNECTION MIS_DBConnect
SQL SQLMSS EX mis.dbo.usp_MIS_GetXMLMsg '21EC2020-3AEA-1069-A2DD-08002B30309D';

TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS H1
END
-RUN

TABLE FILE H1
PRINT *
END


There is some layer of transalation that WebFOCUS is missing. I tried the technique in [SOLVED] Reporting from XML stored in a text column.
But I don't need to make a report off of the XML file I just need to display its contents to the user.

This message has been edited. Last edited by: Mighty Max,


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
 
Posts: 320 | Location: Memphis, TN | Registered: February 12, 2008Report This Post
Virtuoso
posted Hide Post
Are you getting error messages? If so, which?

If not, then what do you mean with
quote:
I am trying to display a XML file that is stored in column of a SQL table but have had no luck.

It could then be that the data that is being shown is interpreted by the browser to be unintelligable html tags and therefor not shown. Check this by doing a view source in the resulting page. If that's the case, then either do some other form of output (like pdf) or have the field content preceded by the pre-tag (< pre >).

Otherwise please let us know what exactly you are experiencing.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Expert
posted Hide Post
If you just want to return the XML document to the browser, then hold it and use HTMLFORMTYPE.

e.g.
TABLE FILE MIS_LOAD_XML_MSG
PRINT
     RAWMSG
WHERE @MSGID EQ '21EC2020-3AEA-1069-A2DD-08002B30309D'
ON TABLE HOLD AS MY_XML
END
-RUN
SET HTMLFORMTYPE=XML
-RUN
-HTMLFORM MY_XML


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Guru
posted Hide Post
I got it working but I had to do some tweaking.

1. Changed the field RAWMSG to Alpha format in the master.
2. Use FILEDEF to place the hold file into a .htm file.
3. Use ON TABLE SAVE not ON TABLE HOLD
4. Use SET HTMLFORMTYPE=XML

For some reason ON TABLE HOLD did not work. I had to use ON TABLE SAVE. I guess it would of worked if I had used an APP HOLD instead of FILEDEF.
Thanks for the help everyone.
  
FILENAME=MIS_LOAD_XML_MSG, SUFFIX=SQLMSS  , $
  SEGMENT=INPUT, SEGTYPE=S0, $
    FIELDNAME=@MSGID, ALIAS=P0001, USAGE=A38V, ACTUAL=A38V,
      MISSING=ON, ACCESS_PROPERTY=(NEED_VALUE), $
  SEGMENT=OUTPUT, SEGTYPE=S0, PARENT=INPUT, $
    FIELDNAME=@RETURN_VALUE, ALIAS=P0000, USAGE=I11, ACTUAL=I4, $
  SEGMENT=RS, SEGTYPE=S0, PARENT=INPUT, $
    FIELDNAME=RAWMSG, ALIAS=RawMsg, USAGE=A5000, ACTUAL=A5000, $

  
FILEDEF XMLOUT DISK MIS/XMLMSG.HTM
-RUN

TABLE FILE MIS_LOAD_XML_MSG
PRINT
     RAWMSG AS ''
WHERE @MSGID EQ '21EC2020-3AEA-1069-A2DD-08002B30309D'
ON TABLE SET PAGE-NUM OFF
ON TABLE SET PAGE NOPAGE
ON TABLE NOTOTAL
ON TABLE SAVE AS XMLOUT FORMAT ALPHA
END
-RUN

SET HTMLFORMTYPE=XML
-HTMLFORM BEGIN
!IBI.FIL.XMLOUT;
-HTMLFORM END


WebFOCUS 8.1.05M Unix Self-Service/MRE/Report Caster - Outputs Excel, PDF, HTML, Flat Files
 
Posts: 320 | Location: Memphis, TN | Registered: February 12, 2008Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Display XML file stored in SQL Table

Copyright © 1996-2020 Information Builders