Re: Response to Daniel's review comments (Re: [Schematron-love-in] Committee Draft of ISO Schematron available)
Rick Jelliffe <[email protected]> Thu, 01 Jul 2004 19:24:36 +1000
| Newsgroups | gmane.text.xml.schematron |
|---|---|
| Message-ID | <[email protected]> |
Daniel Cazzulino wrote: >>>>"The required value attribute is a fragment of a query." >>>> >>>> >>>Don't understand this. A fragment? Why? >>> >>> > > > >>Rick says: it is a fragment because we don't want to restrict it in >> >> >anyway, as might be implied by "term" or "expression" or "closure" etc. > >Daniel says: Mmm... The word "fragment" gets me thinking that this may not >be a full query per the schema language. I find it missleading. If you just >say "is a query", you're not implying any limitations, IMO. > > > Well, it may not be a full query: the intent is not to constrain how it is chunked in any way. In particular, if the query language is not composable then it would be incorrect to call a part of a query "a query". >>>5.2.7 ns element >>> >Daniel says: Well, besides the elementDefaultForm et all, the XSD approach >at least doesn't introduce another way of mapping prefixes to namespaces. > Well, just doing that messes everything up. I think it is really bad if a prefix (or, here, the absense of a prefix) means different things in different schemas, or within different parts of a schema. You should be able to look at one known place to see the definitions, then know that whereever that prefix is used, it has a definite meaning. I know (I have been typing prefixes all day) that adding prefixes in Schematron XPaths is boring, but I really think it gives a substantial benefit in reducing the number of places you need to look at to be sure you understand what an expression means. >One benefit for Visual Studio .NET developers is that the XML editor offers >intellisense for the xmlns attribute by showing all the namespaces it "knows >about" (schemas deployed to a specific folder), as well as for >elements/attributes in the document. > > Cart before the horse: isn't that because with xmlns, you need something to tell you what is in scope because there is the possibility of overriding namespaces (especially the default namespace and no namespace cases)? However, with Schematron there is no possibility of these complications, therefore little need for Intellisense to try to help you? >A more important concern is when you mix XHTML in here. In this case, it's >not clear (or at least confusing) for the schema developer whether he should >use <ns> or xmlns to map a prefix to the XHTML for use in the document. I >believe it's the later, but then, he will have to use one mapping for >document element/attributes and another mapping for query expressions that >may use them. Not too good, at all. >I.e.: > ><schema xmlns="http://www.ascc.net/xml/schematron" > xmlns:xhtml="http://www.w3.org/1999/xhtml"> > <ns prefix="xhtml" uri="http://www.w3.org/1999/xhtml"> > ... > <assert test="xhtml:body[@style]"> > <xhtml:h1>You should use the class attribute to style the >body</xhtml:h1> > > > sch:ns for namespaces in expressions. xmlns for namespaces in elements and attribute names. Seems simple enough. Of course when you embed Schematron elements in other languages, you have to use their rules for obtaining namespaces. >>Annex A: RelaxNG Schema >> >> > >Daniel says: My inexperience with RelaxNG showed up in these comments. After >using it for some days now, I feel comfortable with it and understand what >the spec specifies with it. Thanks for clarifying. > > > I read an interesting article somewhere denying that anything is "user friendly": instead it depends on what we have been habituated to. I have a brother who ran a large refugee program here, and he had Somalians who did not know how to operate door knobs! I did not like RELAX NG (compact or otherwise) much when I started to use it, but it one me over by the end of writing my first (and only) schema in it. >>>So, each localized version of the diagnostic element must have a different >>> >>> >ID, right? > > >>>I guess it would be better to allow them to all have the same ID >>>(provided they have different xml:lang attribute), so only one ID must be >>> >>> >referenced. > > > >>Rick says: that definitely has attractive points, but I would prefer to >> >> >stick to something that can be validated using IDREFS. > >Daniel says: Interesting. I think a schematron implementation can validate >schematron schemas with a schematron schema too, so this kind of restriction >can be easily checked, instead of relying on IDREFS. In fairly big schemas, >I think it will be very inconvenient to modify all asserts just to include a >new language. You already have constraints that can't be expressed with >RelaxNG and are added as a normative Schematron schema. This could be part >of it. But now the question is: how on earth do you split a string with >XPath/XSLT alone? :S ... Too bad... only EXSLT can do so easily :(. >I guess there's no workaround for this... > > That is a good point. Does anyone know, does XPath2 provide any extra features that would be useful for IDREFs? (I believe that XPath and XSLT have such bad support for IDREFs because they expected XLink complex links to take over.) Cheers Rick Jelliffe ------------------------------------------------------- This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com