Validating DITA in Eclipse - eclipse

my team created a project in Frame Maker and we want to convert it to DITA (that will be edited with Frame Maker). The conversion is done with Mif2go. It is complicated step and the DITA files may contain incomplete information. I was suggested to validate them using Eclipse (Kepler).
The DITA version of the files is 1.1 (the default of Mif2Go). I was needed to copy the DITA library files to eclipse workspace in order to validate the XML (including, for example, bookmap.dtd, bookmap.mod, and more). However, I get many errors for theese files when I validate the workspace of eclipse. For example, in the file "metaDecl.mod", i get error for the line "!ELEMENT author (%words.cnt;)*".
The error says:
" A '(' character or an element type is required in the declaration of element type "author"."
I get this error for many DITA files and I don't understand why.
I will extremely appreciate any clue...

Hard to tell based on your question and without understanding the Mif2go conversion.
I'd start with ensuring you have the Web Tools Platform (www.eclipse.org/webtools) installed in Eclipse. This includes XML validation. You may also want to download the DITA-OT from https://github.com/dita-ot and unzip it to your Eclipse workspace folder and add it as a project.
I am using Eclipse to convert HTML to DITA and validation seems to work OK on my DITA files. It may also be that Mif2go is writing out some bad XML; that .mod file is part of the DITA-OT, so that's probably not the issue. Maybe you can try removing the offending line and trying to validate again.

Related

mybatis-generator: Create non-java files?

I am using the mybatis-generator in a maven project to generate the Java files for a few tables. At the end of the generation, I would like to generate a few non-java files like properties files and resources. However the default generator allows me to generate only XML and Java files. Is there any way to also get the generator to create sql files, SPI definitions and property files for example?
Looking inside the generator, it seems that the Generated java files and XML files go through some further process(formatting et al). Even if I write a custom plugin, I can generate an XML or an sql file only but not a properties files or an sql file. Even if I did, I cannot get the process to finish because the subsequent steps would fail.
Currently, I am getting over these by creating my own files and writing them thru a custom plugin. However, during the plugin execution, the folder target/generates-sources/mybatis-generator is not created yet. Therefore assuming that location to have already been created is ruled out. On the other hand, if I go ahead and create the folder and its internal META-INF/services folder, I am not sure if this will be overwritten at a later stage. In addition, my plugin does not (by virtue of the way the generator initiates plugins), have access to the project root folder. So that is not an option either.
I neither have access to the ShellCallBack, implying that postponing the file creation to a well defined time-point in the build process is also not possible.
So how do I go about creating the service definitions and the additional resource files?
The last resort is to hard-code the project folder or to pump the project folder through a property. This is coming to my rescue now. But clearly, the generated files are being detected by my git client and I have to clean up these files also despite their being dynamic.
Hints please?
Thanks in advance.
Rahul
The generator currently supports Java, Kotlin, and XML file generation. There is an open feature request to support other file types in plugins. You can follow it here: https://github.com/mybatis/generator/issues/752

Eclipse associating *.mod files with DTD, validation fails for Jetty mod file

I recently brought an existing maven project into Eclipse 2020-03. The project contains a jetty folder which itself contains a file:
modules/somefile.mod
The *.mod file pattern seems to be associated with the DTD content type, and this association is "locked". Because my file is not a DTD, it fails the validation.
Eclipse's Bugzilla lists a 7-year old bug, Bug 420688, which describes this problem, but the workarounds there don't seem to work for me.
The validation error I get is
The markup declarations contained or pointed to by the document type declaration must be well-formed.
Is there a way to
Disable the validation of this particular file, or preferably
Disassociate it from the DTD content type?
Thanks for any advice or direction.

How to discard files from the Xtext indexing process?

I have built an Xtext based editor for our DSL which works fine, but we get an out of memory error while the workspace is building or when we force a project cleaning. Our DSL plug-in is used in conjunction with the Eclipse CDT to build microcontrollers test programs. A test program project is made of C++ files and ".xxx" files for which I have built the DSL editor. The out of memory error occurs when the test program project contains at least one large ".xxx" file (~300 Mbyte). We don't even open this large file, we simply clean the project and the memory error occurs.
This seems to be an Xtext indexer issue. Is there a way to tell the Xtext indexer to ignore ".xxx" files located in a particular folder of the project? I have read several times the Scoping chapter of the excellent "Implementing DSLs with Xtext and Xtend" from Lorenzo Bettini, but did not find any solution to this issue. Can you help me, please?
the extension points for this are org.eclipse.xtext.resource.IResourceServiceProvider.canHandle(URI) or org.eclipse.xtext.ui.resource.IResourceUIServiceProvider.canHandle(URI, IStorage)

How to convert Eclipse template file to IntelliJ template file

How can I convert Eclipse template file to IntelliJ template file. I do not want to add plugin to use the Eclipse file. I want to convert it.
Though not strictly respecting your question (no plugin), the built-in plugin Eclipse integration of IDEA 13 can import Eclipse templates quite accurately:
http://blog.jetbrains.com/idea/2014/01/intellij-idea-13-importing-code-formatter-settings-from-eclipse/
As stated in that post, the result cannot be 100% accurate as IDEA does not support all of the template options present in Eclipse (and the opposite might be true too).

How eclipse validates build.xml files?

Where can I find dtd, xsd or whatever, that eclipse uses to validate ant build.xml file?
EDIT:
Actually eclipse is validating build.ini for referential integrity and I am interested to know how is it doing so. Is it using schematron or there is some more elegant way to do it?
There seems to be no official dtd (this link provides information why not and how to create an incomplete version). If you google for ant.dtd you will find information on this topic and also a link to an unofficial work-in-progress version.
So there must be more eclipse magic (or whatever) in validating/parsing the build.xml - I unfortunately do not know about it.