This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Dumb HTML <A> question


Jack A. Zucker wrote:
> I'm dynamically generating links in html from my xsl processing using the
> following code:
> 
> <xsl:template match="HelpFile">
>   <xsl:element name="A">
>     <xsl:attribute name = "href" ><xsl:value-of select="."
> /></xsl:attribute>Help
>   </xsl:element>
> </xsl:template>
> 
> This works fine but seems to be a bit terse. Is there a simpler way to do
> this other than building the <A> and @href nodes programmatically?

I think you're confused about what "terse" means :)
What you have is verbose. You want something terse, like this:

<xsl:template match="HelpFile">
  <A href="{.}">Help</A>
</xsl:template>

There are times when verbose syntax is more desirable, such as:

  - when the attribute itself, not just its value, is optional
  - when trying to avoid having namespace nodes copied to the result tree

It's funny that you asked this question, because most people learn the
terse syntax and have to be taught the longhand.

> The other issue is not really related to xml/xsl but is a html help issue.
> My actual link is to a .chm file which is registered to point to hh.exe (the
> microsoft html help executable). The link works fine but I want to be able
> to specify a help topic to the html help engine

It took me about 3 minutes of searching on msdn.microsoft.com to find this:

http://msdn.microsoft.com/library/tools/htmlhelp/wkshp/faq.htm#7

   - Mike
____________________________________________________________________
Mike J. Brown, software engineer at            My XML/XSL resources: 
webb.net in Denver, Colorado, USA              http://skew.org/xml/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]