Roy MacLean wrote:
> 
> I've just been trying out the Spreadsheet extensions to XXE. This is really
> interesting, and a very neat solution.
> 
> One question though. I've worked through the tutorial, which is obviously on
> an XHTML document. For me, I'd want to do this on a DITA topic. However, in
> the latter document, I can't get the formulas to work with element ids.
> 
> So I have:
> <p>In 2009 we made £<ph id="previous">234</ph></p>
> 
> But the formula:
> <p>Previous = <?xxe-formula formula='=$(previous)'?></p>
> does not return a result (but no error).
> 
> However, the XPath version:
> <p>Previous = <?xxe-formula formula='=`//*...@id=&#39;previous&#39;]`'?></p>
> does work.
> 
> Similar behaviour happens when the referenced element is a <stentry>.
> 
> What am I doing wrong here?

Nothing wrong.

The "id" attribute of a topic, concept, task, etc, elements is an actual
ID (ID in capital case). The "id" attribute of all the other elements
are mere NMTOKENs. See
http://docs.oasis-open.org/dita/v1.1/OS/langspec/common/id-atts.html.

That's why something like "$(previous)", which means the element having
"previous" as its ID, whatever the name of the attribute used to specify
it, cannot work.

Note that is not difficult to create and register with XXE your own
custom spreadsheet functions. See
http://www.xmlmind.com/xmleditor/_distrib/doc/spreadsheet/custom_functions.html.


Doing that will spare you the effort of having to type //*...@id="XXX"] in
all your formulas.



> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>        Roy MacLean -- IT Training & Technical Writing
>                       http://roymaclean-it.co.uk
>                     [email protected]
>                              07 956 474 911
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to