Where to get EDI format specifications to use in your application

(for advanced EDI developers)

For example, you are working on a script/XSLT/program which would generate some documentation, or analyse data, or something like this – and you need to have a EDI format specification which can be used as the source of information about structures, records/segments, fields/elements and their lengths, data types and so on.

There are some ways you can use:

If you have SpecBuilder, you can export a format as a gXML file:


Continue reading

Advertisements

Business Analysis in B2B/EDI: 2.5.3. Paths

In my spare time I’m working on a huge document/book “Business Analysis in B2B/EDI”, decided to share a small part…

  • 2.5.3. Paths
  • In the structures of different complexity, it is necessary to be able to indicate the exact path to the record/segment and/or field/element. For example, in X12 there might be DTM segments at different levels, and just โ€œDTMโ€ wonโ€™t be enough to understand which one is needed in many cases. So, you should know how to provide the right paths. And, different formats use different approaches.

    Since records/segments are named entities, their names are a good starting point to use. But while records in SAP IDoc are unique (i.e. you cannot have 2 records with the same name at the different levels) and you can use the name to identify its exact position, the other formats can use the same records/segments at different levels.
    Continue reading

    XSLT: tips and tricks: how to generate node1, node2, …, nodeN

    This time let me show you how to generate several similar XML elements like name1, name2, name3, …, nameN.

    Input:

    <?xml version="1.0" encoding="utf-8"?>
    <names>
    	<name>John Smith</name>
    	<name>Bill Murray</name>
    	<name>Anne Williams</name>
    	<name>Henry Ford</name>
    </names>
    

    Expected output:

    <?xml version="1.0" encoding="utf-8"?>
    <root>
    	<NAME1>John Smith</NAME1>
    	<NAME2>Bill Murray</NAME2>
    	<NAME3>Anne Williams</NAME3>
    	<NAME4>Henry Ford</NAME4>
    </root>
    

    Almost always developers are trying to create XSLT like this:

    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    	<xsl:template match="/">
    		<root>
    			<xsl:if test="names/name[1]">
    				<NAME1>
    					<xsl:value-of select="names/name[1]"/>
    				</NAME1>
    			</xsl:if>
    			<xsl:if test="names/name[2]">
    				<NAME2>
    					<xsl:value-of select="names/name[2]"/>
    				</NAME2>
    			</xsl:if>
    			...
    			<xsl:if test="names/name[N]">
    				<NAMEN>
    					<xsl:value-of select="names/name[N]"/>
    				</NAMEN>
    			</xsl:if>
    		</root>
    	</xsl:template>
    </xsl:stylesheet>
    

    But there is a short and elegant way:

    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:template match="/">
    		<root>
    			<xsl:for-each select="names/name">
    				<xsl:element name="{concat('NAME', position())}">
    					<xsl:value-of select="."/>
    				</xsl:element>
    			</xsl:for-each>
    		</root>
        </xsl:template>
    </xsl:stylesheet>
    

    Gennady Kim

    Building Specs/Designs/MRGs automatically (from XML data)

    I’ve enhanced a little the XSLT described here. First version could build the structures only, and we decided to add DDF files (Gentran/GIS/SI model format) as the formats (X12, EDIFACT, IDocs, etc) libraries. Now we can get not only the structure, but also descriptions, data types, optional/mandatory and qualifiers with descriptions. These specs were built automatically, I added colored backgrounds only:

    X12:
    spec_x12
    Continue reading

    webMethods: how to create an XSD schema (2)

    UPD (22 Oct 2014): The original createXSD doesn’t work properly in some cases, so now I’m using both createXSD and my XSLT

    My previous post about XSL for converting NDF into XSD was a try to “reinvent a wheel”. There is a native way to do the same in WM – WmPublic/pub/schema/createXSD ๐Ÿ™‚ I didn’t know about it, but now I do know. Sometimes I have to change generated XSDs but anyway I think it’s easier to use built-in methods. Well, lesson learned – ask an expert first ๐Ÿ™‚

    Gennady Kim

    webMethods: how to create an XSD schema from NDF structure definition file(s)

    One of our clients uses webMethods for EAI. I’m not a big expert in webMethods (WM), I know only my part – EAI, partners setup, testing and map development. WM uses it’s own way for the structures definition. I cannot use it in my work, I need standard XSD or at least DTD files. So I decided to find a way to somehow export or convert those NDF files into XSD. These NDF files are in XML format so I decided to develop an XSLT to transform them into XSD. Now I’d like to share it with you. Mention should be made that I’m not an WM expert – maybe this XSLT works for only these particular NDF files and won’t work for all the others, but if you have a similar task – just give it a try and please let me know if it works for you or not. Sometimes there are more than just one NDF file to describe the structure – my XSLT supports such cases (a variable “base” at the beginning is for the folder’s name). It might require some explanation. If you have problems with it – I could try to help, feel free to contact me (there is a contact form)

    Continue reading