OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Which latest and greatest XML Standards Should I UseFor XML-Grammar-Fortune?

On Tue, 2012-11-13 at 20:45 +0200, Shlomi Fish wrote:
> Hi all,
> I have defined an XML grammar titled XML-Grammar-Fortune (see
> http://web-cpan.shlomifish.org/modules/XML-Grammar-Fortune/ ), which I use to
> mark up UNIX-like fortune cookies and quotations (see
> http://www.shlomifish.org/humour/fortunes/ for examples and resultant XHTML and
> plain text outputs), and which is based on XML.
> Now, I have considered modernising the grammar somewhat and possibly
> incorporate the following elements:
> 1. Using xml:id instead of a plain "id=""" attribute as well as xml:lang and
> other xml: standard attributes.

The advantage of xml:id is questionable here; it's most likely to be
useful if documents in other formats point into your documents.

xml:lang, on the other hand, is a definite win.

xml:base can be used for resolving relative application-layer links, but
it seems unlikely you'll need that here.

> 2. Making a judicious use of XML namespaces.

Unless people will be mixing your format with others, or you want to
include other formats in yours, namespaces will only complicate life for
no great benefit. XPath expressions will no longer match unless you
prefix every name, for example. It's a trade-off, though.

>  Right now the <screenplay>-typed
> tags were done in a hackish way by copy-pasting the RELAX NGs and XSLTs contents
> http://www.shlomifish.org/open-source/projects/XML-Grammar/Fiction/ , but they
> may be better doable using namespaces. One thing that worries me is whether
> I'll need to do sometihng like xmlns="[LONG URL HERE]" everytime I want to use
> them.


> 3. I have defined well-formed plaintext grammars for XML-Grammar-Fiction and
> XML-Grammar-Screenplay (see the above link), which gets translated to the
> custom XML grammars (and from there to other XMLs using XSLT), and I wonder
> whether I can do the same for XML-Grammar-Fortune. Is there a good tool for
> doing something like that with ease?

I believe there's a parser generator that reads EBNF but don't know if
it can spit out XSD.

> 4. Should I use XSLT 2.0 and/or XPath 2.0? Right now I prefer to use Perl 5
> with the XML::LibXSLT CPAN module that is in turn based on libxslt from the
> GNOME project, and from what I know, the only full open-source XSLT 2.0
> implementation is Saxon, which is written in Java.

I prefer to use XQuery from Perl, e.g. with the BaseX API, and can help
you with that if you like. There is also dbxml, but since Oracle
swallowed up Sleepycat I don't know if it's maintained actively.

I don't know of an open source XSLT 2 processor that's easily used on
Linux from Perl. Saxon is the nearest, and you can get reasonable
performance if you run it with nailgun, which keeps a spare JVM started
all the time to avoid the startup cost, but it will still run in a
separate process. A few people have tried moving libxml towards XSLT 2,
but have not collaborated with each other, and in any case it'd probably
be better to start with getting XSLT 2 (and 3) into webkit.


Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml
The barefoot programmer - http://www.holoweb.net/~liam/

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS