I'm trying to replicate some of the bindings from
xhtml.xxe and use them for my own document type, but
I'm only partially successful.
Certain elements in my document are containers for
xhtml content:
<xs:complexType name="text.type" mixed="true">
<xs:complexContent>
<xs:extension base="xhtml:Flow">
<xs:attributeGroup ref="xhtml:attrs"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
I was able to implement the "ENTER" binding behavior
and it works as expected after prefixing the p element
with the xhtml namespace in curly braces, but I had no
such luck with the "DELETE" and "BACK_SPACE" macro.
<macro trace="true">
<choice>
<sequence>
<test
expression="$dot/ancestor::xhtml:p and
not($selected) and not($mark)" />
<command
name="deleteSelectionOrJoinOrDeleteChar"
parameter="%0" />
</sequence>
<command name="deleteSelectionOrDeleteChar"
parameter="%0" />
</choice>
</macro>
The test fails.
----------
-->try.delete:choice: checking...
-->try.delete:sequence: checking...
-->try.delete:test: checking...
<--try.delete:test: CANNOT EXECUTE
<--try.delete:sequence: CANNOT EXECUTE
-->try.delete:command: checking...
deleteSelectionOrDeleteChar "backwards"
<--try.delete:command: can execute
<--try.delete:choice: can execute
----------
==========
-->try.delete:choice: executing...
-->try.delete:command: executing...
deleteSelectionOrDeleteChar "backwards"
----------
How do I specify the test, so that it passes when the
cursor is at .../xhtml:p/#text? Couls it be a
namespace related issue?
Likewise, the macros appendSame, prependSame,
appendListItem, prependListItem and the toolbar
buttons for adding p, li, ul, ol, and dl only work
partially (i.e., differently than in an xhtml document
- only inserting the top-most element) or not at all
(e.g., appendListItem - may be due to an issue with
the match).
<macro trace="true" undoable="true" label="Add li">
<sequence>
<command name="selectNode"
parameter="ancestorOrSelf[implicitElement]
{http://www.w3.org/1999/xhtml}li" />
<match context="$selected" pattern="xhtml:li" />
<command name="insertNode"
parameter="sameElementAfter" />
</sequence>
</macro>
-->try.appendListItem:sequence: executing...
-->try.appendListItem:command: executing...
selectNode "ancestorOrSelf[implicitElement]
{http://www.w3.org/1999/xhtml}li"
<--try.appendListItem:command: executed
-->try.appendListItem:match: checking...
<--try.appendListItem:match: CANNOT EXECUTE
<--try.appendListItem:sequence: executed
Am I attempting something that is not supported?
If yes, what would be my best alternatives?
If no, how can I get more feedback from the system to
help my analyze the issue further?
Is the command com.xmlmind.xmleditapp.xhtml.AddBlock
functioning properly in my container (see above)?
I also noticed that when the document starts up and
whenever I click into the document, the appendListItem
macro is executed. This is true for the xhtml
configuration as well. I couldn't find anything in
the configuration file that would explain it. Is this
implicit? And why is it necessary?
Any insights into the matter are much appreciated.
Regards,
Andreas
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com