473,326 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

New to xml - what's wrong with my transform

-D-
I'm trying to write my xsl to display an unordered list fromt the xml file
where location is equal to top:

<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="~/index.aspx" title="Home" location="top">
<siteMapNode url="~/about_us/index.aspx" title="About Us" location="top" >
<siteMapNode url="~/about_us/mediaroom.aspx" title="Media Room" />
<siteMapNode url="~/about_us/awards.aspx" title="Awards" />
<siteMapNode url="~/about_us/employment.aspx" title="Employment
Opportunities" />
<siteMapNode url="~/about_us/events.aspx" title="Trade Show Calendar" />
<siteMapNode url="~/about_us/partners.aspx" title="Partners and Alliances"
/>
<siteMapNode url="~/about_us/wrcmedia.aspx" title="WRC Media" />
</siteMapNode>
<siteMapNode url="~/contact.aspx" title="Contact Us" location="top" />
<siteMapNode url="http://www.mysite.com" title="Customer Support"
location="top" />
<siteMapNode url="~/sitemap.aspx" title="Site Map" location="top" />
</siteMap>

xsl:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<ul>
<xsl:for-each select="siteMapNode/location/top">
<li>
<a href="{@url}"><xsl:value-of select="@title"/></a>
</li>
</xsl:for-each>
</ul>
</xsl:template>
</xsl:stylesheet>

Jul 21 '06 #1
4 1584
<xsl:for-each select="siteMapNode[@location = 'top']">

"-D-" <so*****@NOSPAM.comwrote in message
news:u1**************@TK2MSFTNGP03.phx.gbl...
I'm trying to write my xsl to display an unordered list fromt the xml file
where location is equal to top:

<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="~/index.aspx" title="Home" location="top">

Jul 21 '06 #2
-D-
The transform is still not displaying? Can I use xsl transform on the
default web.sitemap file provided with asp.net 2.0?
"Sergey Dubinets" <sd**@NoSpam.Microsoft.comwrote in message
news:uU**************@TK2MSFTNGP02.phx.gbl...
<xsl:for-each select="siteMapNode[@location = 'top']">

"-D-" <so*****@NOSPAM.comwrote in message
news:u1**************@TK2MSFTNGP03.phx.gbl...
I'm trying to write my xsl to display an unordered list fromt the xml
file
where location is equal to top:

<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="~/index.aspx" title="Home" location="top">


Jul 21 '06 #3


-D- wrote:

<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^
You have a namespace declaration here for which you need to account in
your stylesheet and in your XPath expressions and match patterns
<siteMapNode url="~/index.aspx" title="Home" location="top">
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
xmlns:sm="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0"

<ul>
<xsl:for-each select="siteMapNode/location/top">
<xsl:for-each select="ms:siteMap/ms:siteMapNode[@location = 'top']">

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Jul 22 '06 #4
XML you posted is not well formed.

Some siteMapNode are children of other siteMapNode. If you don't want
preserve this hierarch try:
<xsl:for-each select="//siteMapNode[@location = 'top']">

Sergey

"-D-" <so*****@NOSPAM.comwrote in message
news:uD**************@TK2MSFTNGP05.phx.gbl...
The transform is still not displaying? Can I use xsl transform on the
default web.sitemap file provided with asp.net 2.0?
"Sergey Dubinets" <sd**@NoSpam.Microsoft.comwrote in message
news:uU**************@TK2MSFTNGP02.phx.gbl...
><xsl:for-each select="siteMapNode[@location = 'top']">

"-D-" <so*****@NOSPAM.comwrote in message
news:u1**************@TK2MSFTNGP03.phx.gbl...
I'm trying to write my xsl to display an unordered list fromt the xml
file
where location is equal to top:

<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="~/index.aspx" title="Home" location="top">



Jul 24 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Jason | last post by:
Hey, I'm an experience programmer but new to Python. I'm doing a simple implementation of a field morphing techinique due to Beier and Neely (1992) and I have the simple case working in Python...
2
by: WebSLS | last post by:
What am I doing wrong ? Here is my XML: <?xml version="1.0" standalone="yes"?> <Specials xmlns="http://tempuri.org/Specials.xsd"> <Trip> <ID>0</ID> <Lieux>Canada</Lieux>...
2
by: John Lehmann | last post by:
I have an interesting problem. I am performing an XSL transform using the System.Xml.Xsl.Transform class. I have a database that contains the XSL style sheet string. And it seems to work pretty...
4
by: schneider | last post by:
Anyone know if there is a way to dynamicly create a Xslt template/s and use them as an xml transform with-out use files for the Xslt? All the methods I see use files. I want to create a Xslt...
0
by: Sam | last post by:
Hi there, For some very bizzare reason I can't get ASP.NET to read an XSLT stylesheet properly. I always get a the message below. Any ideas as to how to get around this problem? Thanks in...
1
by: Mike Hofer | last post by:
I've got two statements in my code that are both generating weird, weird, weird messages: The first one was, Dim document As System.Xml.XmlDocument Dim navigator As...
8
by: den 2005 | last post by:
Hi everybody, I am not sure where to put this in this forum. So, I posted this at several topics. I created a class library that has two public methods Encrypt() and Decrypt(). I reference this...
4
by: _Raven | last post by:
Okay, I am playing with submitting forms with Ajax. I am trying to adapt this script to my forms: http://www.captain.at/howto-ajax-form-post-get.php I have included my code at the bottom of this...
6
by: Vijai Kalyan | last post by:
Hello, I am trying to use std::transform to take in a collection of strings, transform them and insert the result into an output container. So, I wrote something like this: std::wstring...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.