There are several small enhancements to the XXE interface and one large
functionality enhancement that I would like to propose here.
The first idea is one of a configurable document identifying string.
For the purposes of the suggestions here it need not in any way be
unique; rather, it would exist for the user's benefit. An identifyig
string, for instance, could be used in the title bar to identify a
document in a way somewhat more meaningful than the file name of the
document. I would suggest that there be a new configuration element,
<cfg:identification source="xpath"/>, which would set a document's
identification string to the string value of the first node in the node
set identified by xpath expression "xpath". Given this, for example, I
would quickly set source="//title" for both DocBook and XHTML. An
additional use for this identification string might be as a default
filename for new files when saved, as opposed to "Untitled". If the
idenfication element is omitted in a particular configuration, XXE could
easily fall back to its current behavior.
My second suggestion relates to a desire I expressed in a previous
email, which is to be able to perform processing on a set of sibling
nodes. I was initially told that this is not possible, which makes
sense because XXE needs to be able to pass a well formed XML segment to
an XSLT processor. What I would ask for, then, is an ability to select
and submit the parent of these siblings for processing (like
ancestorOrSelf but more like singleOrParent), but which would all one to
pass a parameter to the XSLT script which consists of an xpath
expression that evaluates to a node set which is exactly the "originally
selected" siblings. Mind you, generating this xpath expression might be
difficult, but my initial hypothesis is that it would not be.
An example might help illustrate this second request. Take, for
example, the following XHTML fragment:
<div> <p>1</p> <p>2</p> <p>3</p> <p>4</p> </div>
Say the paragraphs with content 2, 3, and 4 are selected. My proposed
extention would allow you to <cfg:command name="selectNode"
parameter="singleOrParent"/> which would actually return as its value
the xpath expression defined above, in this case "/div/p[position() >= 2
and position() <= 4]" (and there may be a simpler equivalent expression;
it is simply the resulting node set that is important). This would
enable you to, for instance, iterate on that node set within your XSLT
script and modify only those "selected" nodes, for one possible result
of:
<div> <p>1</p> <p><em>2</em></p> <p><em>3</em></p> <p><em>4</em></p>
</div>
I haven't fully thought about the different extentions that might be
possible and similar to this, but others may exist.
Thanks for your consideration, and take care,
John L. Clark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url :
http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20040205/d6eb2fc1/attachment.sig