xsl-list
[Top] [All Lists]

Re: Schema aware transformations

2005-06-22 06:27:05

  Is it feasible for a schema aware processor to detect unreachable
  templates?


really a question for Michael I suppose:-)
But anyway...

I think that it's feasible that it could detect that, if it knew that
they were unreachable.

Unless I missed something, you can import a schema into the stylesheet
so the system will know those schma derived types (and could then almost
certainly know that your match pattern doesn't match any schema valid
element) But I don't think that you can tell teh system that you input
is indeed valid, or that it won't use document() to pull in some ramdon
well formed bit of XML, so knowing that a template doesn't match any
element that is valid to a schema that has been imported into the
stylesheet, and knowing that th etemplate will not match any element in
teh input are not quite the same thing.

For debugging purposes of course a warning that the templates doesn't
match schema-valid elements would probbaly be enough.

Alternatively you can explictly declare that you want the template to
match only schea valid elements by going


template match="schema-element(a)/schema-element(b)"

then if you made a typo and the element is really c you'll get an error
straight away that there is no such declared element in the schema.
er I think, you'd need to check exactly what happens for locally
declared elements etc..


(of couse, as schema's replace the DTDs).

Schema languages come and go, but DTDs will live forever!

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

--~------------------------------------------------------------------
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>
--~--