Hi Peter,
first, please note that the following does not work:
<a href="#{= ui:label(?section) }">
The problem is that attributes (here: href) can only contain {...} expressions
if those expressions cover the whole length of the string. So the following
would work:
<a href='{= fn:concat("#", ui:label(?section))'>
[ fn:concat is a built-in that takes two or more strings and concatenates them
]. The mixed form of expressions inside of attributes might be supported at
some point in the future, but not right now.
Second, ui:label will by default create human-readable labels, and those may
not be well-formed anchor names. Instead, you may want to use
ui:encodeNode(?section), afn:localName(?section) or smf:qname. The afn
namespace is native to Jena, and smf: is native to TopBraid. The ui: prefix is
native to UISPIN. As long as you stay in TopBraid, all of those will work. All
solutions assume that you have defined proper prefixes for all resources.
Cheers,
Holger
On May 6, 2010, at 7:11 PM, peter wrote:
> Probably a silly question, but ...
> I'm using UISPIN to create printable documents for an entire ontology.
> I'd like to create a Table of Contents using internal anchors defined
> by existing labels. So my TOC contains something like
> <a href="#{= ui:label(?section) }">{= ui:label(?
> section) }</a>
> (Actually, I'd use ids for uniqueness and safety but that's not my
> point.)
> I'm struggling with prefixing the '#' onto the label for the anchor. I
> can find many references to string manipulation functions in
> SparqlMotion, am I just missing something obvious in UISPIN?
>
> Peter
>
> --
> You received this message because you are subscribed to the Google
> Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
> TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
> To post to this group, send email to
> [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/topbraid-users?hl=en
--
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en