Code Monkey home page Code Monkey logo

Comments (6)

sabas avatar sabas commented on June 1, 2024

In Analyser I split them correctly
https://github.com/php-edifact/edifact/blob/master/src/EDI/Interpreter.php#L133

How do you use Reader?

from edifact.

erleeman avatar erleeman commented on June 1, 2024

$parser = new Parser($file_content);
$reader = new Reader();
$reader->setParsedFile($this->parser->get());

$reader->readEdiDataValue(['NAD', ['1' => 'SE']], 2, 0);

But for more than 1 message the 'File has multiple messages' error is logged.

from edifact.

sabas avatar sabas commented on June 1, 2024

Since Reader accepts an array, if you don't want to change the code you could call setParsedFile on each message.
Or, to change the code, the trick would be to fix the lines with $parsedfile. I see that there's a splitMultiMessage function which is similar to my splitMessage.
It could use a refactoring.... Reader, Analyser and Interpreter do similar things with different approaches.

from edifact.

erleeman avatar erleeman commented on June 1, 2024

OK. Like in #84
But now, i recognized that preValidate for setParsedFile with extracted groups will return false.

I did not noticed splitMultiMessage. I will have a look.

Thank you.

from edifact.

erleeman avatar erleeman commented on June 1, 2024

Thank you for pointing out splitMulitMessage.

Have a look for testSplitMultiMessage. That figures out how to use it.

public function testSplitMultiMessage()

from edifact.

erleeman avatar erleeman commented on June 1, 2024

Seperating the file and loop each message.

public function testSplitMultiMessage()

from edifact.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.