General

Why a 'platform'?

EuroMath2 is not an XML editor itself. It is an environment, that provides functionality that would an XML editor need: autocompletion, namespace dividing, processing engine, XML formatters and cleaners, etc. It includes a basic XSL-FO editor though.

[top]

Error messages

I got a meaningless error message, or something broke down

Try to look into the workspace/.metadata/ directory (located in the root em2 directory, or in your current workspace if using the Plugin version) for a file named .log. This log file contains exact error messages explaining the problem.

[top]

I can enter only one letter, then the thing commits suicide. You call it an editor?

Well... EuroMath2 is still in very alpha state. The application core, plugin interfaces and some editing aspects needs to be developed. However, new developers joined the team so you can expect a development speedup.

[top]

Element '[foo:goo]' cannot contain attribute 'prefix:bar="baz"' - it has same namespace as its owner element.

If you want to define local attribute, then do not specify its namespace - it will 'inherit' namespace from its element as described in the XML specification. But what if the element's namespace is null?

[top]

XML document must not contain elements with null namespaces

EuroMath2 needs to know the kind of document each element belongs to, in order for the autocompletion and multi-schema validation to work correctly and for the stylesheets to be selected correctly. Currently, 99% of XML documents have null namespace, but they serves for different purposes - they don't share same semantics nor schema. Because of this situation, we cannot correctly detect schema from an element with null namespace, hence null namespace is forbidden. Attributes may have null namespaces - XML specification states that in such case they 'inherit' namespace from parent element.

[top]

I get java.lang.StackOverflowError while opening DocBook document

The MSV library, used to parse schema files, is quite stack-hungry and will cause an overflow on Win32 Sun-JRE. This could be remedied by using -Xss switch, however this switch does NOT affect stack of main thread in Sun-Java 1.5. The only known workaround is to download and install Mustang (Java 1.6), and, if the stack-overflow-problem persists, please run EuroMath with:

launcher -vmargs -Xss8m

Increase the -Xss switch value when necessary

[top]

XML loading

When opening the document, it mumbled something about unremovable xmlns attribute.

To add namespace support to DTD, an xmlns attribute is added to the root element definition. This attribute is defined as a default attribute. Xerces (the parsing library we are using) thus creates an unremovable xmlns attribute, and that is what the EuroMath2 namespace manager does not like. There are some workarounds: either prefix all elements with some prefix, or delete the doctype definition.

A major drawback of those solutions is that they will turn off the default attribute values facility. A best way around is to stop using DTD and convert it to Relax, RelaxNG, TREX or XML Schema. However, Relax(NG) and TREX does not support default values. The best you can do is to stop using default values in schema completely (why? imagine that you don't have access to a schema file. You don't have default values then).

[top]

Supported formats

Can it process XHTML?

Experimental support for XHTML editing is included in 1.3.0 version. For previous versions please follow these two steps:

  1. Unpack this zip file into the em2/plugins/sk.uniba.euromath_1.2.1/ directory. This installs XHTML-to-XSL-FO XSLT stylesheet and XHTML schema files.
  2. In this directory, edit emConfig.xml and add this xml snippet to the namespaces element:

    namespace
      namespace-urihttp://www.w3.org/1999/xhtml/namespace-uri
      descXHTML 1.0 Strict/desc
      default-prefixxhtml/default-prefix
      schema allow-other-ns="true" root-elements="html"
        location-urlorg/w3/1999/xhtml/xhtml1-strict.rng/location-url
        entities-urlorg/w3/1999/xhtml/xhtml1-strict.dtd/entities-url
      /schema
      stylesheet
        descXHTML 1.0 to XSL-FO stylesheet/desc
        target-uri id-attributes="id"http://www.w3.org/1999/XSL/Format/target-uri
        location-urlorg/w3/1999/xhtml/xhtml2fo.xsl/location-url
      /stylesheet
    /namespace
    Next, add this element after the two resolve elements:
    resolve url="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"org/w3/1999/xhtml/xhtml1-strict.dtd/resolve
  3. Your XHTML file must have namespace http://www.w3.org/1999/xhtml. Just add
    xmlns="http://www.w3.org/1999/xhtml"
    to html element of your XHTML file.

However, this approach has several disadvantages:

  • CSS stylesheets are ignored.
  • XHTML must be a well formed XML file, valid against XHTML Strict schema.
  • EM2 uses a development version of FOP thus its output looks quite messy.
  • FOP output renderer is not very well developed and it mangles already messed FOP output. Hence What You See is an incredibly ugly HTML page. PDF export produces much nicer output.

You are welcomed to implement simple editor/renderer of XHTML file. For details please look here and here.

[top]