Klocker Christoph wrote:
> Please find attached a part of my xml file and the stylesheet.
>
> The xpath expression I was talking about.
> Can't define the values at forehand, as the author will add constantly new
> values for g_kuerzel.
>
> content: attr(idref) combo-box(values,
> xpath("join(/steuerindex/teil/kapitel/gesetz/g_kuerzel, '\A')"));
We've studied your problem. It is not easy to solve. And we don't see
how it can be solved by enhancing our product. That is, you need to
implement a custom, efficient, solution for your specific problem.
Here's what I would do to solve it:
[1] Create a DocumentHook for my type of documents.
See
http://www.xmlmind.com/xmleditor/_distrib/docs/api/com/xmlmind/xmleditapp/dochook/DocumentHook.html
The only thing that this DocumentHook does is to register a
DocumentListener with the newly created or newly opened document.
See
http://www.xmlmind.com/xmleditor/_distrib/docs/dev/ar01s09.html
See
http://www.xmlmind.com/xmleditor/_distrib/docs/api/com/xmlmind/xmledit/doc/DocumentListener.html
[2] This DocumentListener observes all element insertions and deletions
(ElementStructureEvent).
See
http://www.xmlmind.com/xmleditor/_distrib/docs/api/com/xmlmind/xmledit/doc/ElementStructureEvent.html
The goal this DocumentListener is to update a list of g_kuerzel
character data.
This list is initialized when the DocumentListener is created and after
that, it is updated incrementally.
This list is stored as a property of the Document using method
putProperty().
See
http://www.xmlmind.com/xmleditor/_distrib/docs/dev/ar01s04.html#treeproperties
See
http://www.xmlmind.com/xmleditor/_distrib/docs/api/com/xmlmind/xmledit/doc/Document.html#putProperty(java.lang.Object,%20java.lang.Object)
[3] Write a Java class (example: com.acme.Util) with static method
called makeList().
See http://www.xmlmind.com/xmleditor/_distrib/docs/commands/ch07s02.html
makeList() has a single argument: a
com.xmlmind.xmledit.xpath.NodeIterator (See
http://www.xmlmind.com/xmleditor/_distrib/docs/api/com/xmlmind/xmledit/xpath/NodeIterator.html
)
which gives access to the element of the Document. This allows to fetch
the custom property containing the list.
[4] Replace:
xpath("join(/steuerindex/teil/kapitel/gesetz/g_kuerzel, '\A')")
by:
xpath("util:makeList(.)")
where xmlns:util="java:com.acme.Util"
Yes, this is complex but this is also:
* feasible without asking XMLmind to change anything in XXE,
* easy to maintain (completely separated from XXE core, only uses
public, stable, APIs),
* cannot be faster (because it works incrementally).