emilkarlen at netscape.net wrote: > I am trying to develop a macro but is stuck at the "selectNode" command when > trying to select an ancestor. > > I have found that it does work together with the supplied DTD configuration > example > (http://www.xmlmind.com/xmleditor/_distrib/doc/configure/ch02s01.html) but > not with the Schema configuration example > (http://www.xmlmind.com/xmleditor/_distrib/doc/configure/ch02s02.html), > although both examples uses the same document structure. > > My code is - use F2 to select the para-anscestor: > > <binding> > <keyPressed code="F2" /> > <command name="eok2.selTest" /> > </binding> > > <command name="eok2.selTest"> > <macro> > <sequence> > <command name="selectNode" > parameter="ancestorOrSelf[implicitElement] para" /> > </sequence> > </macro> > </command> > >
The content model of the DTD uses element "para", with no namespace. The content model of the DTD uses element "para" in namespace "http://www.xmlmind.com/xmleditor/schema/example2". Therefore, in the case of the W3C XML Schema, the macro should be written like this: --- <binding> <keyPressed code="F2" /> <command name="eok2.selTest" /> </binding> <command name="eok2.selTest"> <macro> <sequence> <command name="selectNode" parameter="ancestorOrSelf[implicitElement] {http://www.xmlmind.com/xmleditor/schema/example2}para" /> </sequence> </macro> </command> --- Command parameters are plain strings which may be specified in very different contexts (e.g. interactively). Therefore it is not possible to use namespace prefixes in them. The following (non-standard) notation should be used instead: {namespace_URI}local_name

