Dave,
The initial NVDL processing splits the document into sections. Each
section contains elements (or attributes in case of attribute sections)
all in the same namespace.
The context specifies a path inside a section, thus there is no need for
qualified names as all the elements are in the same namespace. Plus you
have the possibility to match the namespaces using wildcards so you may
not even have a prefix defined for the matched namespace.
Now, back to your sample... That is equivalent with an NVDL script
without the context element. In order to allow XHTML content only inside
the Atom content element then you need a script like
<rules xmlns="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0"
xmlns:a="http://www.w3.org/2005/Atom" xmlns:x="http://www.w3.org/1999/xhtml"
startMode="doc"
>
<mode name="doc">
<namespace ns="http://www.w3.org/2005/Atom">
<validate schema="atom.rng" useMode="doc">
<context path="/feed/entry/content" useMode="xhtml"/>
</validate>
</namespace>
</mode>
<mode name="xhtml">
<namespace ns="http://www.w3.org/1999/xhtml">
<validate schema="xhtml.sbp.rng" />
</namespace>
</mode>
</rules>
That is, keep the doc mode as default for the first validate action and
change it only in the context of content if a new section starts inside
it. Note that useMode="doc" can be removed as the same mode will be used
implicitly by actions.
Best Regards,
George
-- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com Dave Pawson wrote: > 2008/5/14 George Cristian Bina <george@oxygenxml.com>: >> Hi Dave, >> >> The context path uses local names, not qualified names to specify the path >> as that path is in the section matched by the current rule so the namespace >> of the elements in that section is the same. You have specified qualified >> names and they are not valid names (local names) thus the error you got from >> oNVDL. > > Thanks George. That works: > > <mode name="doc"> > <namespace ns="http://www.w3.org/2005/Atom"> > <validate schema="atom.rng" useMode="xhtml"> > <context path="/feed/content/div" useMode="xhtml"/> > </validate> > </namespace> > </mode> > > Is it an xpath (without namespaces?) The regex used in the schema seems > to imply not. > > I used namespaces since the current section has mixed namespaces, > i.e. > > a:feed > a:entry > x:div > > Adding 'errors' to the input document shows it to be working now > so I'm happy. > > regards > > > > -- DSDL comments To unsubscribe, please send a message with the command "unsubscribe" to dsdl-comment-request@dsdl.org (mailto:dsdl-comment-request@dsdl.org?Subject=unsubscribe)Received on Wed May 14 10:32:34 2008
This archive was generated by hypermail 2.1.8 : Wed May 14 2008 - 08:53:02 UTC