Page 1 of 2 1 2 LastLast
Results 1 to 10 of 19

Thread: Generate XML File?

  1. #1
    Member
    Join Date
    Jul 2014
    Location
    Madrid, Spain
    Posts
    115

    Generate XML File?

    Hi guys,

    I'm starting a new project and I need generate a XML file. I search BSFN's and I found B34A1190 and B0501250, and a report R03B672 use B34A1190. I'm going to study this report and this functions for understand XML functionality.

    Can you advise me how I could generate xml file?

    Thanks!
    Alfre.
    JDE E1 Senior Developer Consultant

  2. #2
    Senior Member johndanter's Avatar
    Join Date
    Sep 2003
    Location
    Cork, Ireland
    Posts
    1,354
    I've never bothered with them, only for SEPA changes years ago.

    I just create the file myself using concats (just like you would a text file) and keeping a track of the element nodes etc. <start> </end> yourself

    Example
    <On_Payment_Terms_S3>
    Then fill in what you need <DateInvoiceJulian_ID9>Invoice Date</DateInvoiceJulian_ID9> etc

    Then close with
    </On_Payment_Terms_S3>

    All those BSFNS do is help you do that
    Start your file with this <?xml version="1.0" encoding="UTF-8" standalone="no" ?> and you should be ok to create the file just like a
    John Danter
    You don't go out looking for a job dressed like that do you, on a weekday?

    E900 TR 9.1.5.3 Unix

  3. #3
    Senior Member Larry_Jones's Avatar
    Join Date
    Nov 2000
    Location
    Spokane, WA, USA
    Posts
    3,224
    When I query the Object Librarian I find 111 BSFNs with 'XML' in its description.
    That's way too many for me to go through (read source, guess what it really does, experiment, etc). The few I looked at seemed to require way too much effort on the programmer's part.

    I prefer to use more powerful non-JDE tools for tasks like this. For instance I have to export Item Data (Item #, Description, cost, etc) on a weekly basis as a XML file to be imported into another application. Turns out PL SQL (Oracle's version of SQL) has some nice functions to do this so I don't have to do the drudgery of composing XML myself. Works great and I didn't have to touch JDE. Microsoft has lots of stuff for generating XML also.

    The old saying "... it is tempting, if the only tool you have is a hammer, to treat everything as if it were a nail." is still true. Look for the right tool for the job rather than trying to hammer everything with JDE.

    Just my opinion.
    Larry Jones
    E1 9.2 - TR 9.2.2.6 on Win 2016 R2. SQL Server 2016
    Wintel, BI Publisher

  4. #4
    Senior Member
    Join Date
    Mar 2004
    Location
    Fort Worth, Texas
    Posts
    1,544
    Just to add to what Larry is saying. Be careful trying to roll your own process to output XML. Its not as simple as just some tags with data in between. You have to adhere to the XML Specificaion or you can produce malformed XML. For example, if the source data contains certain characters, etc. you have to make sure they are properly escaped. Much better to find a library/tool that all ready has this all figured out.

    If you really need to do this all withing the JDE toolset, I believe JDE has wrapped some XML libraries - I remember using one for parsing at one point (SAX parser I think), they probably have some for outputting as well - or you could bring in some other third party dll. For something like this I have also wondered if it might not be better to do this in a BSSV that is consumed internally. Then you could make use of any one of a number of Java based libraries to produce XML formatted data.
    Brian Oster
    Application Development Manager
    E1: 9.0 (TR9.1.5.1) / 9.2 (TR9.2.2.2)
    JAS/BSSV: Weblogic 12.1.2 / Weblogic 12.2
    ES: Win2008 / Win2016
    DB: MSSQL 2014 / 2016
    WebDev Client: Win7Pro / Win10Pro

  5. #5
    Member craig_welton's Avatar
    Join Date
    Oct 2000
    Location
    Litchfield, CT
    Posts
    988
    Hi,

    We use B34A1190 in several solutions and it works well. It employs the Xerces wrapper APIs providing the ability to create elements and attributes. The hierarchy is created by passing the parent element into each call.

    Craig
    Craig Welton
    PatWel Group Inc.
    http://www.patwel.com
    Home of the FREE JDE Object Browser, JDETrace and NERDup Tools

    E1 9.0 8.98.4.2 Wintel SQL 2008
    E1 9.2 9.2.1.4 iSeries

  6. #6
    Member
    Join Date
    Jul 2014
    Location
    Madrid, Spain
    Posts
    115
    Thanks johndante, you are right, finally a XML is a flat file, but working with xml is more easier because you can add tags in differents levels in the tree (for example, you can add tag in a break footer to a opened tags in the header break), and flat files you're adding consecutively.

    Thanks Larry_Jones and BOster, I am agree probably it will more easier in other technology, for example java. In other projects I did difficult things with java class in a internal business services, for example BIDI codebar, but this customer is not installed BSSV and also this report has to read a lot of tables.

    Thanks craig_welton, finally I'm doing with this BSFN, works very fine but it's very laborious because the XML is huge. But I continue working hard

    Regards,
    Alfre.
    JDE E1 Senior Developer Consultant

  7. #7
    Member
    Join Date
    Jul 2014
    Location
    Madrid, Spain
    Posts
    115
    Other option could be do it with BI Publisher XSL Template (as SEPA for example). Someone has done it? How it is? Could you send me any reference?

    Thanks.

    Regards,
    Alfre.
    JDE E1 Senior Developer Consultant

  8. #8
    Member
    Join Date
    Jul 2014
    Location
    Madrid, Spain
    Posts
    115
    Hi guys, I have a big big problem with B34A1140 BSFN. The structure generate is fine, but in the header enconding in UTF-16, I need in UTF-8 but I think this shouldn't a problem, the problem is the file is not generated in UTF-8 (neither in UTF-16) because when I open with notepad++ for example the codification is "UCS-2 Big Endian".

    I configured P93081 for my report and user in all enviroments to UTF-8 but is not generate.

    I open the BSFN but I not found codification in the API's.

    Can you help me please? It's very urgent.

    Regards.
    JDE E1 Senior Developer Consultant

  9. #9
    Member craig_welton's Avatar
    Join Date
    Oct 2000
    Location
    Litchfield, CT
    Posts
    988
    Try using B4303900.WriteXMLDocumentToFile. That uses the XRCS_serializeDocumentToFileWithEncoding API passing UTF_8.

    Craig
    Craig Welton
    PatWel Group Inc.
    http://www.patwel.com
    Home of the FREE JDE Object Browser, JDETrace and NERDup Tools

    E1 9.0 8.98.4.2 Wintel SQL 2008
    E1 9.2 9.2.1.4 iSeries

  10. #10
    Member
    Join Date
    Jul 2014
    Location
    Madrid, Spain
    Posts
    115
    Thanks craig!!!

    Finally I created a new bsfn with the same parameters and code than B34A1190 - Write To File and add xmlcStatus = XRCS_serializeDocumentToFileWithEncoding(hDoc, dsDSI74XML01FILE.szXMLFullFileName,_J("UTF-8")); as B74XML01.

    Your solution is better but i didn't see before

    Regards,
    Alfre.
    JDE E1 Senior Developer Consultant

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
The legal restrictions and terms of use applicable to this site are available here.
Use of this site signifies your agreement to the terms of use.
JDELIST is NOT affiliated with JD Edwards® & Company, Oracle or Peoplesoft. Contents of this site are neither endorsed nor approved by JD Edwards® & Company and, or Oracle.