Subscribe

By RSS
By Email

Delivered by FeedBurner

Recent Comments

    • VELMURUGANJAYAKUMAR - IWILL REJOIN ITS POSSIBLE THINGS…IWILL REJO
    • Sugantharaj - HI i want to give password for the PDF file…HI i want
    • Hari Rajan - Hi Vijay I read the blogs on ITIL and it sounds…Hi Vijay I
    • Sugantharaj - I want to display an image as the background for…I want to
    • Ravi Jain - Dear Vijay, The Production Env comprises of two Windows 2003 machines…Dear Vijay

PeopleCode to Create XML and XSD file.

By Cynthia Rachel on October 29th, 2008 under PeopleSoft.

The below code is useful to create XML and XSD file.  Create Application engine program with below code and run the AE program in App designer to get a file in local. You can get the same in server without specifying any path and give it as relative path instead of file absolute.

PSXP_XMLGEN application package used to create xml file. You can multiple parent and child records. This file is used for data import or export programs.

Import PSXP_XMLGEN:*;

/*Create Rowsets*/

&RS_ADR = CreateRowset(Record.EMPLOYEES);
&RS_PER = CreateRowset(Record.PERSON, &RS_ADR);

/*Fill Parent*/
&RS_PER.fILL(”WHERE EMPLID = ‘11902′”);

/*Fill Child*/
For &i = 1 To &RS_PER.Activerowcount

&row = &RS_PER.Getrow(&i);
&rs = &row.Getrowset(Scroll.EMPLOYEES);
&rs.fill(”Where emplid = :1″, &row.PERSON.emplid.value);
End-For;

/* Create XSD */

&rds = create PSXP_XMLGEN:RowSetDS();
&myschema = &rds.Getxsdschema(&RS_PER);
&f1 = GetFile(”C:\temp\rpt01.xsd”, “w”, %FilePath_Absolute);
&f1.writeline(&myschema);
&f1.close();

/*Create Sample XML File */

&myXMLfile = &rds.GetXMLData(&RS_PER, “C:\temp\rpt01.xsd”);
&f2 = GetFile(”C:\temp\rpt01.xml”, “w”, %FilePath_Absolute);
&f2.writeline(&myXMLfile);
&f2.close();

Bookmark and Share

Comments:4;




4 Responses to “PeopleCode to Create XML and XSD file.”

    rahul Says:

    I want to use an existing xml schema file.How to use that?
    Can i use it using the file layout?

    Richard Says:

    Hi,
    i’m searching for the code to launch a Template file attach to a XML with a push button and a query ??
    Not with a AE.
    Thank you very much for help
    Richy

    Tushar Says:

    Excellent post. Thank you for sharing this information.

    XML Says:

    HI,

    Please send the documention on XML Publisher to following email address

    sridhara.raju2000@gmail.com

    Thanks,
    AAAA

Pitch in with your comments