On 10/20/2010 01:07 PM, Roy MacLean wrote:
> 
> Just to clarify:
> -- the ids referenced in XXE formulas must be IDs, not just NMTOKENs
> -- non-topic/map elements in DITA have @id of type NMTOKEN

Yes.


> -- but in XHTML, @id is of type ID

Yes, and the same in DocBook 4 (@id) and 5 (@xml:id).


> -- I could package up the XPath search for @id in a custom function - say,
> element(id).

Yes, simply add:

---
<spreadsheetFunctions location="custom_spreadsheet_functions.xml" />
---

to your customize.xxe and add attached custom_spreadsheet_functions.xml
file in the directory containing customize.xxe and you are done.

custom_spreadsheet_functions.xml is:
---
<f:functions xmlns="http://www.w3.org/1999/xhtml";
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xmlns:xs="http://www.w3.org/2001/XMLSchema";
  xmlns:ns="http://www.w3.org/1999/xhtml";
  xmlns:f="http://www.xmlmind.com/xmleditor/schema/spreadsheet/functions";>

  <f:function>
    <f:name>element</f:name>
    <f:parameters>id</f:parameters>
    <f:category>Custom</f:category>
    <f:description>
      <body>
        <p>Returns a nodeset containing all the elements
        (generally a single element)
        having specified "id" attribute.</p>
      </body>
    </f:description>
    <f:macro><![CDATA[=`//*...@id=$id]`]]></f:macro>
  </f:function>

</f:functions>
--

It has been created using XXE after installing the "XMLmind XML Editor
Configuration Pack" add-on. Documentation of this add-on:
http://www.xmlmind.com/xmleditor/addons_doc.html#xxe_config_pack


<?xml version="1.0" encoding="UTF-8"?>
<f:functions xmlns="http://www.w3.org/1999/xhtml";
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
             xmlns:xs="http://www.w3.org/2001/XMLSchema";
             xmlns:ns="http://www.w3.org/1999/xhtml";
             xmlns:f="http://www.xmlmind.com/xmleditor/schema/spreadsheet/functions";>
  <f:function>
    <f:name>element</f:name>
    <f:parameters>id</f:parameters>
    <f:category>Custom</f:category>
    <f:description>
      <body>
        <p>Returns a nodeset containing all the elements (generally a single
        element) having specified "id" attribute.</p>
      </body>
    </f:description>
    <f:macro><![CDATA[=`//*...@id=$id]`]]></f:macro>
  </f:function>
</f:functions>
 
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to