xsl-list
[Top] [All Lists]

Re: [xsl] Applying schemas and tranforms by namespace

2013-10-28 15:42:41
Dear Michael,

You are pointing in a direction that I’d also recommend: XML catalogs to map the schema locations to local files and then an XProc pipeline to validate against the corresponding schema and to transform the documents into your format. If the renderer from your format to, say, XHTML is also XSLT-based, you could include it in the pipeline.

XML catalogs by itself won’t help you in mapping namespaces to schema locations. They rather map (public, canonical, vendor-defined, …) URLs to where these schema documents reside on your hard disk.

Associating a schema to a document by an element’s namespace is more in the domain of NVDL. You can use vendor-specific extensions [1] to perform NVDL validation in XProc. Alternatively, you can maintain a lookup table (or a lookup XML document) yourself and use XSLT to read your document, identify the top-level element’s namespace URI and load the appropriate XML schema. Documents with an XSD schema will often tell you their schema location in an @xsi:schemaLocation attribute so that you might skip the lookup for these documents.

Of course tasks like these might be solved with other technologies, such as custom Java programs, shell scripts, etc. But XProc is a nice orchestrating technology to keep everything maintainable, as XPath/XSLT 2 is a nice technology to perform the lookups.

Although you mention XSLT in your post and XSLT might be part of the solution, your question at its core might be slightly off-topic for this list, and neither you nor I would want to raise Tommie Usdin’s ire for discussing off-topic issues here. [2]

So I’m suggesting that we take this discussion off-list, look at some of your input documents and at your neutral format and sketch a solution (that might or might not include XProc, NVDL, XSLT 2 – but probably will!).

I’m not trying to sell our services through this list, but I think that we might actually help you with setting up the XProc/XSLT part.

Your developers can invoke Calabash or Saxon from your Java server apps. Btw, Norman Walsh is currently writing a RESTful Calabash service [3], and there’s also Florent Georges’ Servlex to turn the lookup/conversion tasks into Web apps.

And I’m confident that if you go the XProc route, your Java programmers’ expertise will not be lost. They may for example become prolific Calabash extension programmers besides integrating XProc into the server apps.

Gerrit

[1] http://xmlcalabash.com/docs/reference/pxp-nvdl.html
[2] http://www.mhonarc.org/archive/html/xsl-list/2008-04/msg00478.html
[3] https://twitter.com/ndw/status/394668472741146625

On 28.10.2013 19:49, Michael Schäfer wrote:
Dear all,

We (public statistics) are operating a generic XML-based data
collection process. Now we are starting to receive namespaced XML
documents from a number of authorities. Those documents must be
validated and then transformed into our generic format. In order
to achieve this, we would like to set up a configurable system
that looks up the respective XML Schema and XSLT stylesheet by
namespace, and performs both validation and transform.

Given that we have seasoned Java programmers with JAXP experience,
we are thinking in the direction of a Java server app, but this
could be a case for trying out something different such as XProc
and extending our tool set. Also, we're wondering if XML catalogs
could be useful.

We'd be very grateful for any suggestion and helpful information.

Regards,

Michael


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--
Gerrit Imsieke
Geschäftsführer / Managing Director
le-tex publishing services GmbH
Weissenfelser Str. 84, 04229 Leipzig, Germany
Phone +49 341 355356 110, Fax +49 341 355356 510
gerrit(_dot_)imsieke(_at_)le-tex(_dot_)de, http://www.le-tex.de

Registergericht / Commercial Register: Amtsgericht Leipzig
Registernummer / Registration Number: HRB 24930

Geschäftsführer: Gerrit Imsieke, Svea Jelonek,
Thomas Schmidt, Dr. Reinhard Vöckler

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>