I'm taking my first stab at using xml, so please bear with my novice
questions and understanding of xml.
I'm trying to create an xml file that holds all my website navigation. If I
understand correctly, I can use xslt to create different menus from the xml
file.
What I'm trying to accomplish is to create a top menu bar, left navigation
menu bar and sub header navigation bar. Then place the transformed xslt
menus into user controls that I can drop into my pages.
Here is how I structured my xml file:
<?xml version="1.0" encoding="utf-8" ?>
<sitemap>
<category title="Home">
<page url="index.aspx" title="Home" />
</category>
<category title="About Us">
<page url="/about_us/index.aspx" title="About Us" />
<page url="/about_us/mediaroom.aspx" title="Media Room" />
<page url="/about_us/awards.aspx" title="Awards" />
<page url="/about_us/employment.aspx" title="Employment Opportunities" />
<page url="/about_us/events.aspx" title="Trade Show Calendar" />
<page url="/about_us/partners.aspx" title="Partners and Alliances" />
<page url="/about_us/wrcmedia.aspx" title="WRC Media" />
</category>
<category title="Contact Us">
<page url="contact.aspx" title="Contact Us" />
</category>
<category title="Customer Support">
<page url="http://support.compasslearning.com" title="Customer Support" />
</category>
<category title="Site Map">
<page url="sitemap.aspx" title="Site Map" />
</category>
<category title="Technology">
<page url="/technology/index.aspx" title="Technology" />
<page url="/technology/subscription.aspx" title="Odyssey Subscription" />
<page url="/technology/hosted.aspx" title="Odyssey Hosted" />
<page url="/technology/enterprise.aspx" title="Odyssey Enterprise" />
</category>
<category title="Research">
<page url="/research/index.aspx" title="Research" />
</category>
<category title="Assessment">
<page url="/assessment/index.aspx" title="Assessment" />
<page url="/assessment/custom.aspx" title="Custom Assessment" />
<page url="/assessment/explorer.aspx" title="CompassLearning Explorer" />
</category>
<category title="Curriculum">
<page url="/curriculum/index.aspx" title="Curriculum" />
<page url="/research/index.aspx" title="Scientifically-Based Research" />
<page url="/curriculum/prek.aspx" title="Pre-K" />
<page url="/curriculum/reading.aspx" title="Reading/Language Arts" />
<page url="/curriculum/writing.aspx" title="Writing" />
<page url="/curriculum/math.aspx" title="Mathematics" />
<page url="/curriculum/spanmath.aspx" title="Matemáticas" />
<page url="/curriculum/science.aspx" title="Science" />
<page url="/curriculum/socialstudies.aspx" title="Social Studies" />
<page url="/curriculum/crosscurricular.aspx" title="Cross Curricular" />
<page url="/curriculum/ell.aspx" title="English Language Learners" />
<page url="/curriculum/specialneeds.aspx" title="Children with Spcial
Needs" />
<page url="/curriculum/secondary.aspx" title="Secondary" />
</category>
<category title="Data Management">
<page url="/data_management/index.aspx" title="Data Management" />
<page url="/data_management/students.aspx" title="Managing Students" />
<page url="/data_management/standards.aspx" title="Managing Standards" />
<page url="/data_management/reporting.aspx" title="Managing Reporting" />
</category>
<category title="Services">
<page url="/services/index.aspx" title="Services" />
<page url="/services/custservice.aspx" title="Customer Service" />
<page url="/services/implementservice.aspx" title="Implementation
Services" />
<page url="/services/supportplan.aspx" title="Annual Support Plans" />
<page url="/services/options.aspx" title="More Options" />
<page url="/services/prodev.aspx" title="Professional Development" />
</category>
<category title="Results">
<page url="/results/index.aspx" title="Results" />
<page url="/results/research.aspx" title="Product Research" />
<page url="/results/achievement.aspx" title="Achievement Results" />
</category>
</sitemap>
for my top navigation menu, I'm trying to create an unordered list menu:
<?xml version="1.0" encoding="UTF-8" ?>
<stylesheet version="1.0" xmlns="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<ul>
<xsl:for-each select="category/page">
<li><a href="<xsl:value-of select="url"/>"><xsl:value-of
select="title"/></a></li>
</xsl:for-each>
</ul>
</xsl:template>
</stylesheet>
I'm probably way off on this and need some help. I might have structured my
xml file incorrectly as well.
Using the xml file, I want to create the top navigation menu that displays
only:
<page url="index.aspx" title="Home" />
<page url="/about_us/index.aspx" title="About Us" />
<page url="contact.aspx" title="Contact Us" />
<page url="sitemap.aspx" title="Site Map" />
Can anyone take a look at my code (probably a mess) and help me out.
Thank you.