Git Product home page Git Product logo

Comments (8)

fmcarvalho avatar fmcarvalho commented on May 29, 2024 1

Hi @DNagorny ,

I have already replicated the error and it is in fact related with JDK9. I could not figure out the difference in class name format between Java 8 and 9, but there is something in our automatic bytecodes generation process that is preventing that class file format from being used in Java 9.

Nevertheless, we have already solved the problem and we are preparing a new release of com.github.xmlet.HtmlApi that will fix the problem in HtmlFlow and will allow it to be used in Java 9.

This new HtmlApi release will also include debugable java source code to easily keep track of this project.

When both features are complete and we have a new release of HtmlApi I will include it in HtmlFlow development branch and I will notify you (if you don't mind) to check if the problem is fixed and if there is any other issue.

Thanks,
Miguel

from htmlflow.

fmcarvalho avatar fmcarvalho commented on May 29, 2024 1

Hi @DNagorny ,

Thanks for your recommendation. You are right. Void elements should not have an end tag.

To that end I will remove …/> and /<… for all void elements including: img, link, hr, br, etc.. according to the specification of w3.org/TR/html5/syntax.html#void-elements.

This will break compliance with current 1.2 version of HtmlFlow, however I think this is the better option since we are upgrading major version to 2.0.

In this way I have to update expected HTML resource files for unit tests. If you want you can check the changes on the new HTML test resource files in the last commit of the development branch.

If everything is ok I will publish the new release 2.0 soon. Remember that I will move this repo to https://github.com/xmlet and thus I will publish the new release under com.github.xmlet maven groupID.

Thank you for your feedback to turn HtmlFlow better.

Best Regards,
Miguel

P.S. @lcduarte

from htmlflow.

DNagorny avatar DNagorny commented on May 29, 2024

Hey @fmcarvalho,

I tried out your declared new Version from the development branch and unfortunately I got 2 issues at the moment:

  1. I can't find a way to add the "name"-Attribute to a div-Element.
  2. The code HtmlView htmlView = new HtmlView(); (as well as your own tests, that were run locally with "mvn clean test") throws this exception:
    java.lang.ClassFormatError: Illegal class name "Lorg/xmlet/htmlapi/AbstractElement;" in class file org/xmlet/htmlapi/Html at java.base/java.lang.ClassLoader.defineClass1(Native Method) at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1007) at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174) at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:801) at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:699) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:622) at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:580) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496) at htmlflow.HtmlView.<init>(HtmlView.java:71) at com.github.msfa.java.mail2html.results.HtmlDocumentTest.before(HtmlDocumentTest.java:30) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)
    I couldn't get hold of the reason because of no debuggable Html-class from htmlapi.

If you need me to do an extra github issue or more information let me know please.

Best regards
Dimitry

from htmlflow.

fmcarvalho avatar fmcarvalho commented on May 29, 2024

Hi @DNagorny ,

  1. I think HTML5 does not allow the use of name attribute on div (see Attribute name not allowed on element div at this point). Since HtmlFlow obeys to the standard, then you cannot do it in a fluent manner. As a workaround you may use the same approach of Kenji in TestAttributesClassId where he creates a custom attribute as: addAttr(new BaseAttribute("name", "somename")). Tell me if is this enough?

  2. I cannot replicate the error. And I am not figuring out the reason for that error. Can you send me please your output of mvn -version?

All unit tests included in HtmFlow are working fine for me. I successfully complete the following steps from a clean clone:

git clone https://[email protected]/fmcarvalho/HtmlFlow.git
cd HtmlFlow
git checkout development
mvn clean test

I couldn't get hold of the reason because of no debuggable Html-class from htmlapi.

The classes of htmlapi are generated with Java ASM directly in bytecodes. Thus they miss debuggable information. We are trying to suppress that limitation via source code generation.

from htmlflow.

DNagorny avatar DNagorny commented on May 29, 2024

Good morning,

thank you for your fast reply.

  1. Ok that was new for me and Chrome/Firefox never moaned about that so far and even the document.getElementByName works, but I will change it accordingly to Ids 😄.
  2. mvn -version: Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-24T20:49:05+01:00) Maven home: C:\Program Files\Maven\apache-maven-3.5.3\bin\.. Java version: 1.8.0_162, vendor: Oracle Corporation Java home: C:\Program Files\Java\jdk1.8.0_162\jre Default locale: de_DE, platform encoding: Cp1252 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
    I did it exactly the same way you did with the git checkout and I have this 984764d commit checked out, but I tried it through Eclipse IDE. So I tried now via console and it worked and then I realised that my Eclipse was using jdk9, so I changed it to jdk8 and it worked then. But this might be a good point to keep track of that it will not work with maven+jdk9.

I will keep on testing now.

Greetings
Dimitry

from htmlflow.

fmcarvalho avatar fmcarvalho commented on May 29, 2024

Hi @DNagorny ,

I have updated development branch with the new release of xmlet.HtmlApi which is already compatible with JDK9.

Can you please pull the development branch with last changes and check if the problem with Eclipse is now solved?

Tell us if you have any further issue with this new version.

Thanks,
Miguel

P.S. @lcduarte

from htmlflow.

DNagorny avatar DNagorny commented on May 29, 2024

Good morning @fmcarvalho,

Yes it is working correctly now with jdk9. Thanks for your efforts!

Just one little thing that I stumbled upon:
When adding a meta-tag to the header I was expecting in my tests that all meta should be like <meta charset="UTF-8"> without any closings like .../> or </meta>. I researched MDN, SO and w3.org a bit and all examples there where like my expectations. So according to w3.org meta-tags are void-elements and they state:

Void elements only have a start tag; end tags must not be specified for void elements.

So for html they are not allowed if I interpret it correctly. Don't get me wrong, I don't mind if you close it, but others might argue differently if they want to follow the specs.

Thanks again for your awesome work and library!

Best regards
Dimitry

from htmlflow.

fmcarvalho avatar fmcarvalho commented on May 29, 2024

Just released 2.0 of HtmlFlow. Now we just have to wait to sync with Maven Central and see HtmlFlow available on http://repo1.maven.org/maven2/com/github/xmlet/ organization.

For now on this source code repository will be under github.com/xmlet organization too.

P.S. @DNagorny, @lcduarte, @kenji-getpowered

from htmlflow.

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.