Re: rule context="X" semantic?

Oliver Becker <[email protected]> Thu, 4 Mar 2004 17:13:42 +0100 (MET)
Newsgroups gmane.text.xml.schematron
Message-ID <[email protected]>
> > Is there a default namespace declaration somewhere in between in your
> > XML data?
> > 
> 
> Yes, there is - but only in the root element.

Then I'm surprised that your context="B" works. ;-)
A default namespace declaration puts all elements without prefix into
the specified namespace. However, a path expression doesn't use this
default namespace. A path "B/C" *always* refers to elements B and C
in the null namespace.

Solution: declare a prefix for the namespace in the schematron schema.
e.g. in your XML there is ... xmlns="http://some.uri"
then in your Schematron you have to add 
<ns uri="http://some.uri" prefix="foo" />
(I believe ...; you may use instead of "foo" something better)
and replace in all paths the unprefixed with prefixed elements:
context="foo:B/foo:C"
   test="@bar=../../foo:V/@baz">
etc.
   
Hope this helps,
Oliver


/-------------------------------------------------------------------\
|  ob|do        Dipl.Inf. Oliver Becker                             |
|  --+--        E-Mail: [email protected]             |
|  op|qo        WWW:    http://www.informatik.hu-berlin.de/~obecker |
\-------------------------------------------------------------------/



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click