Re: [xml] validation fails for embedded RELAX NG schema

On 08/03/2009 06:25 PM, Jerzy Jalocha N wrote:
I think that you all have sent me enough evidence, that shows that
embedding a RELAX NG schema in an arbitrary document doesn't work, and
is probably not valid.

But, it can be _made_ to "work", and it is "valid" if
you say it is!
Mainly, I think you need to refine (or define :> ) your terms.

"Work": well, it doesn't work out of the box with any
standard tools, like xmllint --- they don't see your
"literate schema" as being a valid schema --- which it isn't.

However, you certainly could pursue your idea by
either developing a version of xmllint that _did_ extract
the schema from the enhanced schema, or alternatively
developing separate tools like web/tangle/etc that extract it.

"Valid": certainly your document is, or can be, well-formed.
In the XML world, the term "valid" is used to mean that a given
document conforms to some document model --- validity is
always in reference to a DTD or schema of some flavor or another.
Thus, if you define a schema (say literate-schema.rng)
that allows standard RelaxNG schema fragments to appear
in the appropriate places,  your literate schema
certainly can be valid if it conforms to that literate-schema.rng.

On Mon, Aug 3, 2009 at 8:56 AM, Piotr Sipika<piotreks optonline net>  wrote:
Based on this:, your document does not
seem to qualify as a valid RELAX NG schema (either as the full syntax
(section 3) or the simple syntax (section 4)).

Piotr, you are right: Even if the specification doesn't really seem to
put any additional constraints on the position of the grammar element,
it doesn't explicitly allow for it:

"Any element [...] may have foreign child elements in addition to the
child elements shown in the grammar. [...] There are no constraints on
the relative position of foreign child elements with respect to other
child elements."

On Mon, Aug 3, 2009 at 10:32 AM, Michael Ludwig<mlu as-guides com>  wrote:
On a sidenote, XSLT has a mechanism to convey an XSLT meaning to a
document other than<xsl:stylesheet>  :

I didn't know about this possibility. It's very interesting, but it
also shows the pitfalls that are hidden in this kind of work.

So your assumption about Relax NG is not absurd in principle; any such
auto-mechanism just typically has (and probably needs) a more thorough

Yes, the specification doesn't mention this point, while it explicitly
allows the inverse case.

On Mon, Aug 3, 2009 at 11:07 AM, Belgabor<belgabor gmx de>  wrote:
Yes, it is. Quite useful to create combined RelaxNG + Schematron schemata =)
But the reverse is not true. You need to extract the RelaxNG schema to allow
validation with it.

I was expecting for the reverse to be true, but as said earlier,
fortunately it is not difficult to perform the extraction.

Thank you all for your comments and insights!

xml mailing list, project page
xml gnome org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]