RX 5.7 wrapping a slot in a UL in a template.

So I have a slot I’m referring to in my template like this:

 <!-- start slot _refresh_section_Travel  -->
<span psxeditslot="no" slotname="_refresh_section_Travel">Travel</span>
<!-- end slot _refresh_section_Travel  -->

which outputs code like this:


<li><a href="/travel/link1.html">link1</a></li>
<li><a href="/travel/link2.html">link2</a></li>
<li><a href="/travel/link3.html">link3</a></li>
<li><a href="/travel/link4.html">link4</a></li>

my snipet for the slot adds in the LI but I can’t figure how to wrap the while think in an UL.

if I do this:

 <ul><!-- start slot _refresh_section_Travel  -->
            <span psxeditslot="no" slotname="_refresh_section_Travel">Travel</span>
            <!-- end slot _refresh_section_Travel  --></ul>

I got the error:

Could not process the HTML file for querying. "tidy" has failed.
Missing closing tag for opening tag:  start slot _refresh_section_Travel

Thanks,
Ken

Hi,

Here is some “working” unordered list code which you could try. I’ve substituted your slot name into it, but you may still need to modify / review the code.

Template code outside xsplit_body :

<!-- _refresh_section_Travel TEMPLATE -->
<xsl:template match=“rxslot[@template=’_refresh_section_Travel’]” mode=“rxslot”>
<xsl:if test=“linkurl”>
<!-- start snippet wrapper -->
<xsl:apply-templates mode=“rxcas-101” select=“linkurl”/>
<!-- end snippet wrapper -->
</xsl:if>
</xsl:template>
<xsl:template match=“linkurl” mode=“rxcas-101”>
<li><xsl:copy-of select=“document(Value/@current)/*/body/node()”/></li>
</xsl:template>

Inside xsplit_body template where you want the list to appear:

<xsl:if test=“count(//sys_AssemblerInfo/RelatedContent/linkurl[@slotname=’_refresh_section_Travel’])>0">
<ul>
<xsl:variable name=“rxslot-101”>
<rxslot psxeditslot=“no” slotname="_refresh_section_Travel" template="_refresh_section_Travel">
<xsl:copy-of select="/
/sys_AssemblerInfo/RelatedContent/linkurl[@slotname=’_refresh_section_Travel’]”/>
</rxslot>
</xsl:variable>
<xsl:apply-templates mode=“rxslot” select="$rxslot-101/*"/>
</ul>
</xsl:if>

Cheers
Jason

hmm, I was really excited! But I get the following error:

Could not process the HTML file for querying. "tidy" has failed.
Errors occured while running tidy on the provided source. 
The following error was reported:
 Tidy (vers 4th August 2000) Parsing "InputStream" line 297 column 1 - Error: <rxslot> is not recognized!  InputStream: Document content looks like HTML 4.01 Transitional 24 warnings/errors were found!  This document has errors that must be fixed before using HTML Tidy to generate a tidied up version.   .

Ok.

Going back to your original code, try putting the <ul> inside the slot markup:

<!-- start slot -->
<ul>
<!-- start snippet wrapper -->
<span psxeditslot=“no” slotname="_refresh_section_Travel">Travel</span>
<!-- end snippet wrapper -->
</ul>
<!-- end slot -->

The <ul> code I posted can be written in a html file as:

<!-- begin XSL -->
<xsl:output method=“xml” omit-xml-declaration=“yes”/>

<xsl:template match=“rxslot[@template=’_refresh_section_Travel’]” mode=“rxslot”>
<xsl:if test=“linkurl”>
<!-- start snippet wrapper -->
<xsl:apply-templates mode=“rxcas-101” select=“linkurl”/>
<!-- end snippet wrapper -->
</xsl:if>
</xsl:template>

<xsl:template match=“linkurl” mode=“rxcas-101”>
<li><xsl:copy-of select=“document(Value/@current)/*/body/node()”/></li>
</xsl:template>
<!-- end XSL -->
<html>

<body>


<!-- begin XSL -->
<xsl:if test=“count(//sys_AssemblerInfo/RelatedContent/linkurl[@slotname=’_refresh_section_Travel’])>0">
<ul>
<xsl:variable name=“rxslot-101”>
<rxslot psxeditslot=“no” slotname="_refresh_section_Travel" template="_refresh_section_Travel">
<xsl:copy-of select="/
/sys_AssemblerInfo/RelatedContent/linkurl[@slotname=’_refresh_section_Travel’]”/>
</rxslot>
</xsl:variable>
<xsl:apply-templates mode=“rxslot” select="$rxslot-101/*"/>
</ul>
</xsl:if>
<!-- end XSL -->

</body>
</html>

Jason