IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Profile: azriley
About
User Name: azriley
Forum Rank: Newbie
Real Name:
Location
Occupation:
Interests:
Gender: None Specified
Statistics
Joined: Tuesday, April 26, 2016
Last Visit: Wednesday, April 27, 2016 2:42:46 PM
Number of Posts: 2
[0.01% of all post / 0.00 posts per day]
Avatar
Last 10 Posts
Topic: help getting title of second level category links
Posted: Wednesday, April 27, 2016 2:42:45 PM
Thanks for the reply!

That was enough to get me moving in the right direction. Used the below:

Code:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html" indent="yes" />
    <xsl:param name="page_id">0</xsl:param>
    <xsl:variable name="parent" select="site/page/page[@id=$page_id or .//page/@id=$page_id]" />
    <xsl:template match="/">
<!-- example override page id for testing -->
        <xsl:variable name="page_id" select="2605" />

        <xsl:if test="$parent">
            <h3>
                <a href="default.aspx?id={$parent/@id}">
                    <xsl:value-of select="$parent/@title" disable-output-escaping="yes" />
                </a>
            </h3>

        </xsl:if>

  </xsl:template>
</xsl:stylesheet>

Topic: help getting title of second level category links
Posted: Tuesday, April 26, 2016 7:27:12 PM
Hi,

Probably a simple one but how do you get just the top level (2nd page node) categories in the below XML so that if you're in Online or PersonalizedEducation you get WHY? as the title? and if you're in Grad or Undergrad you get Programs as the title of the parent?

Thanks,
Aaron


Code:
<site>
<page id="2604" linktarget="" map="1" nav="1" alias="Home" title="Home">
    <page id="2605" linktarget="" alias="Why" title="WHY?" map="1" nav="1">
        <page id="2606" linktarget="" alias="AboutOurSchool" title="About Our School" map="1" nav="1">
            <page id="2609" linktarget="" alias="PersonalizedEducation" title="Personalized Education" map="1" nav="1" />
            <page id="2610" linktarget="" alias="Online" title="Online" map="1" nav="1" />
        </page>
        <page id="2611" linktarget="" alias="BecomingaTeacher" title="Becoming a Teacher" map="1" nav="1"/>
        <page id="2612" linktarget="" alias="Partnerships" title="Partnerships" map="1" nav="1" />
        <page id="2613" linktarget="" alias="AdvancedPractice" title="Advanced Practice" map="1" nav="1" />
    </page>

    <page id="2607" linktarget="" alias="PROGRAMS" title="PROGRAMS" map="1" nav="1">
        <page id="2645" linktarget="" alias="Undergrad" title="Undergrad" map="1" nav="1"/>
        <page id="2646" linktarget="" alias="Grad" title="Grad" map="1" nav="1" />

    </page>
    <page id="2608" linktarget="" alias="TRANSFER" title="TRANSFER" map="1" nav="1">
        <page id="2647" linktarget="" alias="Transfer" title="Transfer" map="1" nav="1"/>
    </page>
    <page id="2614" linktarget="" alias="EDUCATION" title="EDUCATION" map="1" nav="1">
        <page id="2648" linktarget="" alias="Education" title="Education" map="1" nav="1"/>
    </page>
    <page id="2615" linktarget="" alias="SOCIALSCIENCES" title="SOCIAL SCIENCES" map="1" nav="1">
        <page id="2649" linktarget="" alias="Social Sciences" title="Social Sciences" map="1" nav="1"/>
    </page>
    <page id="2616" linktarget="" alias="PHD" title="PHD" map="1" nav="1">
        <page id="2650" linktarget="" alias="PhD" title="PhD" map="1" nav="1"/>
    </page>
    <page id="2617" linktarget="" alias="ALUMNI" title="ALUMNI" map="1" nav="1">
        <page id="2651" linktarget="" alias="Alumni" title="Alumni" map="1" nav="1"/>
    </page>
</page>
</site>




Use of the Altova User Forum(s) is governed by the Altova Terms of Use.