If I modify the grammar, do I have to modify the file in the installation 
directory, or can I do it in my local support directory? I'm on a Mac, so it's 
in ~/Library/Application Support/XMLMind/...

-K

On Mar 19, 2010, at 2:08 PM, Hussein Shafie wrote:

> Kathryn Huxtable wrote:
>> In XMLEditer version 4.4 I can create a DocBook 4.5 document with elements 
>> such as
>> 
>>      <ulink 
>> url="http://myhost/myproject/${project.version}/usage.html";>usage</ulink>
>> 
>> I have a post-processing phase after converting to HTML that replaces the 
>> ${...} element with my project version, or whatever.
>> 
>> When I create a DocBook 5+ document, however, the preferred conversion for 
>> this, according to the DocBook docs at
>> 
>>      http://www.sagehill.net/docbookxsl/Db5Tools.html#Db5UnivLinking
>> 
>> is
>> 
>>    <link 
>> xlink:href="http://myhost/myproject/${project.version}/usage.html";>usage</link>
>> 
>> I have three problems.
>> 
>> 1) At least in version 4.4 adding xlink:href attributes to a link element is 
>> not allowed. I can create them externally and open the file and all is well.
>> 
>> 2) In version 4.4 the linkend attribute is required, but is not present in 
>> the DocBook5 doc. Again, if I create the element externally and open the 
>> file, it is accepted as valid.
>> 
>> 3) This is the biggest problem. The "$" and and curly brace characters are 
>> seen as invalid by the validation mechanism and are flagged as such. There 
>> is also no way to enter the text manually. Escaping the text using %24 for 
>> the "$", for instance, does not work because it is never expanded and my 
>> Velocity macro processor doesn't detect it.
>> 
>> Are there workarounds for any of these problems? Are any of them different 
>> in version 4.5 of XMLEditor?
> 
> --> DocBook 5 is pretty different from DocBook 4. For example, with
> DocBook 5, the link element *must* have a linkend attribute *or* a
> xlink:href attribute, but not both attributes.
> 
> Two different methods to create a link to an external target in a
> Docbook 5 document.
> 
> Method #1 (Recommended)
> * Select some text.
> * Click the "Convert to link" toolbar button.
> * Select the "link[xlink:href]" item from the menu displayed by the button.
> * Use the Attributes tool to specify the value of the xlink:href attribute.
> 
> Method #2 (Low-level)
> * Select some text.
> * Use Edit|Convert (Ctrl-T) to convert the selected text to an element.
> * Select "link" from the element list.
> * In the Attributes tool, right-click on attribute "linkend" and select
> "Force Removal" from the menu.
> * Use the Attributes tool to specify the value of the xlink:href attribute.
> 
> 
> 
> --> About "${project.version}" in the value of the xlink:href attribute.
> 
> The DocBook 5 grammar specifies that the type of the xlink:href
> attribute is xsd:anyURI. A substring like "${project.version}" is not
> allowed in an URI. Therefore the error reported by XMLmind XML Editor is
> legitimate.
> 
> You can either ignore the error
> OR
> modify the DocBook 5 grammar to replace "anyURI" by "string".
> 
> Excerpts of XXE_install_dir/addon/config/docbook5/rng/V5.0/docbook.rng
> ---
>   <define name="db.xlink.href.attribute">
>    <attribute name="xlink:href">
>      <a:documentation>Identifies a link target with a
>      URI</a:documentation>
>      <data type="anyURI"/>
>    </attribute>
> ---
> 
> 
> 
> --> No need to upgrade to XMLmind XML Editor v4.5.2. Doing this would
> not help you.
> 
> 

Reply via email to