Frequently Asked Questions

What is RefleX ?

RefleX is a tool that implements the Active Tags specifications and much more. RefleX is a kind of framework that allows to write Native XML Programs. RefleX is a kind of XML façade behind a bunch of tools for querying, validating, handling, transforming, publishing various data sources. It is the crème de la crème of XML processing !

What is Active Tags ?

Active Tags is a set of specifications that allow to use tag libs to perform actions. These actions are mixed with litteral elements (non-actions) within an XML document called an Active Sheet, like PHP, ASP, JSP technologies do; however, unlike them, Active Tags can be invoked out of the scope of a Web application. Additionally, Active Tags can mix declarative sentences with procedure-oriented sentences ; this last point makes Active Tags a very powerful tool that allows to define new applications such as Active Schema.

What is there in the Active jigsaw ?

  • Active Tags : the tool you were dreaming about :o)
  • Active Schema : a schema technology specification that allows to define dynamic content models and semantic data types
  • Active Catalog : an XML catalog specification that supplies resources management facilities
  • Active Datatype : defines some types and specifies how to use W3C types and others in the Active Tags technologies.
  • Active Sheet : an XML document that can be processed by an Active Tags engine like RefleX.
  • Active Document : an Active Sheet that is rather an XML template that embeds actions.
  • Active Update : an XUpdate-like sub-specification

Is it yet another markup language ?

Not at all : RefleX is a general-purpose environment that can perform programs made with tags. Several libraries are already available in RefleX, but it's possible to plug any user-defined library. Moreover, user-defined tags can be defined thanks to other tags (a kind of "macro-tags").

Unlike many similar technologies, several libraries of tags can run together within the same RefleX engine. Moreover, several tags from different libraries can cooperate even if they have not been specifically designed to. RefleX is an environment for XML-oriented programming (XOP in short).

What is native XML programming ?

The idea to use XML to perform operations is not new; there already exist several well-known technologies that cover more or less the domain of XML native programming :

  • XSLT : a single set of tags dedicated to XML tree handling,
  • XQuery : a powerfull non-XML language that allows to extract datas and build XML results. A kind of mix of XML litterals with non-XML instructions.

Active Tags doesn't intend to replace these technologies, but rather to make them easier usable ; for example, XSLT has been designed to transform a single XML document to a single (HTML) target document ; Active Tags can help significantly to perform batch processes, or to build XML documents to transform from various non-XML sources such as RDBMS (SQL), LDAP, or simply from native XML databases with the help of XQuery.

With Active Tags one can achieve things that are not covered by XSLT, XQuery and others, such as turning SVG to PNG or XSLFO to PDF, to validate some incoming XML data, to perform unit tests on a Web application, etc.

What is the place of Active Tags in native XML programming ?

Active Tags doesn't define itself a tag library, but describes how several tag libraries could cooperate ; for this purpose, Active Tags describes a simple data model that allows to share datas. Active Tags also comes with a set of core and standard libraries (called modules) that cover common needs : a basic instruction set, I/O interactions, system interactions, Web applications, etc.

Unlike XSLT or XQuery, Active Tags allow to use several instruction sets : the tags that are "active" in XSLT are those usually prefixed with "xsl:" (in fact, XSLT processors often offers means to extend active tags, but it is not obvious); XQuery uses a fixed non-XML instruction set. In this way, Active Tags is more closer to JSTL, but JSTL is strongly related to Java, works only inside a Web server, and is not tailored to design new declarative-oriented applications.

Like many other languages Active Tags can mix structural tags with functional tags. But Active Tags can do much more !

What are the related technologies ?

Here is an open list :

  • ASP, PHP, JSP, XSP...
  • Ant, Cocoon, Jelly, XMLBeans...
  • XSLT, XQuery, XProc...
  • etc, etc, etc

There is certainly a little (or more) of each in Active Tags; people that are aware of those tools and technologies are welcome. They should find Active Tags easy to use !

In what Active Tags differs from other similar technologies ?

Active Tags is a specification, not a tool. RefleX is simply a reference implementation in Java.

Active Tags is a general-purpose framework, not dedicated to Web applications like PHP, ASP, or JSP, neither dedicated to Java like Ant, Jelly, Cocoon. Unlike server page technologies and many other tools, XPath is centric and prominent in Active Tags.

Active Tags looks like a programming language : related features are grouped in modules (libraries), and Active Tags also specifies how user-defined modules can be added.

It is possible with Active Tags to design a schema technology; Active Schema is such a schema technology. Other similar technologies don't offers such facilities.

What about XProc ?

XProc is a newer technology not yet widely implemented that focus on XML pipelines, like RefleX already does. XProc is currently a W3C working draft.

Every feature of XProc is available in RefleX.

Every feature missing in XProc is available in RefleX.

What are the key design points in Active Tags ?

  • The great design point of Active Tags is to allow to handle (almost) everything like if it was XML : not raw XML, but rather something more close to the XML data model (which is usually known as "the Infoset"). In this way, Active Tags differs from numbers tools which always consider XML datas in their serialized forms (that is to say, that are appearing as a stream that contains XML tags). This strategy allows for example to store non-string objects in attributes values, and to access them with XPath; in fact, some objects don't really need to be serialized, or the cost of serialization and parsing is too high, so it is more suitable to deliver them directly like if they were XML objects: round trippings from tags to infoset are saved. One direct consequence is that you might encounter unusual things in Active Tags, such as an XPath expression like this : $myObject/@foo/@bar; in pure XML, an attribute can't have an attribute, but in Active Tags, an object might expose a property like an attribute (which can itself have an attribute).
  • The next great design points of Active Tags is that it allows to mix declarative-oriented sentences with procedure-oriented operations: XML has been widely used to define declarative grammars for many purpose; however, any declarative model has its limits because the underlying components are assembled statically (the XML source is hard-coded). On the opposite, Active Tags allows components to be assembled dynamically. It is somewhat like dynamic types.
    For example, the Active Schema Language is a declarative-oriented grammar that allows to define dynamic content models and data types; as part of the Active Tags suite, users can mix imperative instructions when necessary, which increases dramatically the expressiveness of this schema technology. There are some example that are showing these features in the tutorial section, and further readings are available in the active blog section.
  • The last but not the least design point in Active Tags is to consider that XML technologies are more related together than people think. That's why each Active Tags core specification is focusing on a single problematic; however, each need most of the others to work. Active Tags is the most succeeded XML ecosystem. Please read more here.

Why using RefleX and Active Tags ?

One of the main objectives of Active Tags is to make it usable as an integrated tool; thus, it has been designed to make easier accessible external data sources, such as simple I/O, RDBMS (SQL), LDAP, or native XML databases. It is easy to mix with Active Tags several heterogeneous data sources with XML litterals and build a made-to-measure XML instance.

With Active Tags, you can dramatically decrease the number of lines to code. Each time you have to write 100 lines of code in your favorite language, consider that you can do the same with 10 lines of pure Active Tags: just let the underlying engine work for you.

For example, consider that you have to iterate on the files located in any directory under a given base directory. This can be expressed very simply thanks to XPath:

  <xcl:for-each select="{ io:file('file:///path/to/dir/')//*[@io:is-file] }">
    <!--process each XML file here-->
  </xcl:for-each>

Now think about the Java code you'd have to produce to perform the same thing...

Now think about the Java code you'd have to change if the XPath expression above had to be updated...

And if you argue that the Linux find command does the job, it is not available on Windows platform, it has its own obscure syntax (another command would have another one), and works only on local files. In Active Tags XPath is used consistently to access various file systems (http, ftp, webdav, file...). In Active Tags, you'll encounter XPath expressions everywhere !

What is the learning curve for Active Tags ?

You should have a rather good knowledge in XML technologies: XML in general, XML namespaces, XPath and XSLT. If you are good in XPath and XSLT, you should learn Active Tags very very very quickly.

Depending on the kind of applications you plan to produce, you'll have to learn additional technologies, but that are not related to Active Tags : for example, if you want to build a Web application you should know HTTP, cookies, etc, and all the stuff that doesn't depend on Active Tags.

Although RefleX is implemented in Java, no specific Java knowledge is expected, except setting a classpath...

Where to start with Active Tags ?

You should at least have a look at the examples from the main specification document. The first chapter is also a good introduction.

Anyway, nothing replaces the reading of the entire set of specifications :o)

Where to start with RefleX ?

You could try the "Hello world !" example available for running from the command line interface as well as within a Web application. You could then experiment more advanced examples, experiment RDBMS (SQL) extractions to XML, play with Active Schema, etc. Please refer to the tutorial section.

To go further, you could also have a look at the Tips & tricks section. If you have to build reliable applications with RefleX, you should also consider the XUnit framework, and to WUnit for designing and running test suites for Web applications.

To finish, if you wish to design your own modules with Java, you could refer to the How-To section.

As a Java programmer, Active Tags is it suitable for my needs ?

It depends on how you design your application. If you have to build a modularizable application that relies on a configuration file for instanciating, plugging, and parameterizing your objects, then you are encouraged to consider Active Tags seriously.

With a traditional approach, you will create a Java class that read your configuration file, instanciate your objects and link them together. With Active Tags you could consider a smartest architecture : your configuration file becomes an XML file that contains tags bound to Java classes ; instead of having a bootstrap class responsible of reading that file, you can rely on the RefleX engine that will unmarshal the expected objects for you ; the last and not the least, you can also design Active Components, that is to say Java classes that won't be loaded statically, but rather plugged dynamically at will according to various conditions, like active content models are built dynamically in ASL while validating an XML input. In the same manner, consider moving from a hard-coded configuration file to a dynamic one that can re-evaluate how to re-arrange software components at runtime.

Think your problem by reversing the order, you should gain a lot by exposing your Java classes as active tags usable inside an Active Sheet.

Are there applications that are already using RefleX ?

At INRIA, an operational project is currently in production. It is a 300% XML project : datas are in XML, data are stored in a native XML database, and programs are in XML. There is a frontal Web application for end-users, and a batch script that loads the documents in the repository : both parts are made exclusively with Active Tags and run with RefleX.
The frontal Web application consists on mixing XML that are results of queries from the native XML database, from a corporate LDAP repository, from some legacy HTML pages, and to transform them in HTML.

This web site is also produced with RefleX. Active Tags documents are published as well with RefleX.

Since v0.2.0, a new Active Tags application has been released that aims to test XML native programs such as Active Sheets or XSLT stylesheets, in the same way that JUnit does for Java programs. This is the XUnit framework. You can check in the Active Tests section complete test suites designed with XUnit.

Since v0.3.1, a new Active Tags application has been released that aims to test Web user interfaces with XUnit. This is the WUnit framework. Every Web application of the tutorial section are self-tested by the engine thanks to WUnit.

Where are the active tags that I can use ?

The tags that are active are listed here.

Notice that you will find more than active tags ; in fact, there are other XML materials that are active :

Notation

All along this documentation, XML materials will be consistently noted as shown here to help identifying their nature.

Please have a look at the tutorial if you don't know what to run.

I have some troubles when using RefleX ; is there another FAQ that can help ?

Please, have a look at the troubleshooting section.

You also might find useful stuff in the tips & tricks section.

Feedbacks are welcome.