473,787 Members | 2,938 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.microso ft.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="Employme nt
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:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<ul>
<xsl:for-each select="siteMap Node/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 1600
<xsl:for-each select="siteMap Node[@location = 'top']">

"-D-" <so*****@NOSPAM .comwrote in message
news:u1******** ******@TK2MSFTN GP03.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.microso ft.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.Mi crosoft.comwrot e in message
news:uU******** ******@TK2MSFTN GP02.phx.gbl...
<xsl:for-each select="siteMap Node[@location = 'top']">

"-D-" <so*****@NOSPAM .comwrote in message
news:u1******** ******@TK2MSFTN GP03.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.microso ft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="~/index.aspx" title="Home" location="top">


Jul 21 '06 #3


-D- wrote:

<siteMap xmlns="http://schemas.microso ft.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:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">
xmlns:sm="http://schemas.microso ft.com/AspNet/SiteMap-File-1.0"

<ul>
<xsl:for-each select="siteMap Node/location/top">
<xsl:for-each select="ms:site Map/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******** ******@TK2MSFTN GP05.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.Mi crosoft.comwrot e in message
news:uU******** ******@TK2MSFTN GP02.phx.gbl...
><xsl:for-each select="siteMap Node[@location = 'top']">

"-D-" <so*****@NOSPAM .comwrote in message
news:u1******* *******@TK2MSFT NGP03.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.microso ft.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
2593
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.3 - but it's REALLY slow. Basically, you specify two directed line segments in the coordinate system of a raster image and use the difference between those two lines to transform the image.
2
1370
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> <Hotel>Clarendon</Hotel> <Depart>1er janvier</Depart> <Duree>1 semaine</Duree>
2
1024
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 well for simple transforms. But as soon as I add Xsl variables or For each loops to the XSL string in the db, it fails to transform the XML. I can see that it will transform everything until that point. ALso If I copy the XSL & XML I am trying to...
4
4824
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 transform via code? Any examples would be great.
0
1087
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 advance! -Sam Error Message:
1
1860
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 System.Xml.XPath.XPathNavigator Dim transform As System.Xml.Xsl.XslTransform .. ..
8
5050
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 dll to a window application. I used DESCryptoServiceProvider Algorithm to encrypt and decrypt then with same Key and IV. But unable to decrypt it back to original text. This project I plan to use all algorithm and Hash. This is Phase One. There is...
4
1922
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 post. Basically, this will work correctly if I remove all non-form related tags from the form =eg span, div, but I want to format the form all pretty like so??? Right now, it only collects 2 parts of the form fields =sites &
6
4970
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 doSomething (std::wstring const& str) { // do something to copy of str and return new value }
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10172
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6749
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5535
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.