On lun, 2005-07-04 at 10:24 +0200, Sylvain Hellegouarch wrote:
> Thanks for all your comments and help.
>
> From what I can understand, there is no easy solution to generate an
> XML document from a RelaxNG schema (well besides using an XML editor).
>
> It's fine. I guess I'll stay with XSLT to generate my documents.
I had to do something similar for one of my customers and my conclusion
is that it's impossible in the general case without XSLT extensions (at
last in XSLT 1.0) and that XSLT isn't the best language do do this kind
of exercise.
To generate samples that follow different combinations of the different
choices in a schema, I see two basic solutions:
* The first one is to follow each alternative to generate all the
combinations. In that case, the fact that XSLT is side effect
free doesn't help...
* The second one is to choose the alternative randomly. In this
other case, XSLT/XPath 1.0 misses a "random()" function.
For these reasons, I ended using Python instead of XSLT to do the job...
Hope this helps.
Eric
>
--
Read me on Advogato.
http://advogato.org/person/vdv/
------------------------------------------------------------------------
Eric van der Vlist http://xmlfr.org http://dyomedea.com
(ISO) RELAX NG ISBN:0-596-00421-4 http://oreilly.com/catalog/relax
(W3C) XML Schema ISBN:0-596-00252-1 http://oreilly.com/catalog/xmlschema
------------------------------------------------------------------------
---- LSpots keywords ?> ---- HM ADS ?>
YAHOO! GROUPS LINKS
- Visit your group "rng-users" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
