473,382 Members | 1,180 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,382 software developers and data experts.

Resultant Transformation not appearing

Hi,

My Xml and Xsl files are included here...
On executing my xml file, i am not getting anything in my browser..
my browser shows blank..
please give me some solution or point where the problem is..

---------------xml file------------------------------------------------

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="MenuRender.xsl"?>

<TopMenu Caption="Links">
<Menu Type="SubMenu" Caption="Cybernet">
<Menu Type="MenuItem" href="http://cybernetsoft.com">
Cybernet Software Systems
</Menu>

<Menu Type="MenuItem" href="http://11.1.15.10">
Time Sheet
</Menu>
</Menu>

<Menu Type="SubMenu" Caption="Slash Support">
<Menu Type="MenuItem" href="http://slashsupport.com">
Slash Homepage
</Menu>

<Menu Type="MenuItem" href="http://24carats.slashsupport.com">
24 Carats Program
</Menu>
</Menu>

<Menu Type="MenuItem" href="http://readytestgo.com">
RTG Homepage
</Menu>
</TopMenu>

----------------------end of xml------------------------------------

-----------------------xsl file--------------------------------------

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<!-- <xsl:param name="CurrentPage">CurrentPage</xsl:param>
<xsl:param name="MenuId">1</xsl:param> -->

<xsl:template match="/">
<HTML>
<BODY>
<table width="100px" border="0px" cellspacing="0px" cellpadding="0px">
<TR>
<TD class="MenuTitleBar">
<xsl:value-of select="@Caption"/>
</TD>
</TR>
<xsl:for-each select="Menu">
<xsl:choose>
<xsl:when test="@Type='SubMenu'">
<TR>
<TD class="SubMenu">
<xsl:value-of select="text()" />
</TD>
</TR>
<xsl:for-each select="Menu">
<TR>
<TD class="MenuItem">
<A>
<xsl:attribute name="href">
<xsl:value-of select="href" />
</xsl:attribute>
<xsl:value-of select="text()"/>
</A>
</TD>
</TR>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<TR>
<TD class="MenuItem">
<A>
<xsl:attribute name="href">
<xsl:value-of select="href" />
</xsl:attribute>
<xsl:value-of select="text()"/>
</A>
</TD>
</TR>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</table>
</BODY>
</HTML>
</xsl:template>

</xsl:stylesheet>
------------------------end of xsl file-----------------------

I am a newbie to xml. Please excuse me if there are silly mistakes.

Thanks,
Raghu
Jul 20 '05 #1
3 1276
Hi,

You are getting a result - it just doesn't have much that will be visibly
noticeable.

Your problem is...

<xsl:for-each select="Menu">

but at that point your context node is the document root node (not the
document root element) - because you are in the template... <xsl:template
match="/">

If you change...
<xsl:template match="/">
to...
<xsl:template match="TopMenu">

Or if you change...
<xsl:for-each select="Menu">
to...

<xsl:for-each select="TopMenu/Menu">

then you should start to see some results.

HTH
Marrow
http://www.marrowsoft.com - home of Xselerator (XSLT IDE and debugger)
http://www.topxml.com/Xselerator
"Raghavendra RAV" <ra*************@cybernetsoft.com> wrote in message
news:ec**************************@posting.google.c om...
Hi,

My Xml and Xsl files are included here...
On executing my xml file, i am not getting anything in my browser..
my browser shows blank..
please give me some solution or point where the problem is..

---------------xml file------------------------------------------------

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="MenuRender.xsl"?>

<TopMenu Caption="Links">
<Menu Type="SubMenu" Caption="Cybernet">
<Menu Type="MenuItem" href="http://cybernetsoft.com">
Cybernet Software Systems
</Menu>

<Menu Type="MenuItem" href="http://11.1.15.10">
Time Sheet
</Menu>
</Menu>

<Menu Type="SubMenu" Caption="Slash Support">
<Menu Type="MenuItem" href="http://slashsupport.com">
Slash Homepage
</Menu>

<Menu Type="MenuItem" href="http://24carats.slashsupport.com">
24 Carats Program
</Menu>
</Menu>

<Menu Type="MenuItem" href="http://readytestgo.com">
RTG Homepage
</Menu>
</TopMenu>

----------------------end of xml------------------------------------

-----------------------xsl file--------------------------------------

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- <xsl:param name="CurrentPage">CurrentPage</xsl:param>
<xsl:param name="MenuId">1</xsl:param> -->

<xsl:template match="/">
<HTML>
<BODY>
<table width="100px" border="0px" cellspacing="0px" cellpadding="0px">
<TR>
<TD class="MenuTitleBar">
<xsl:value-of select="@Caption"/>
</TD>
</TR>
<xsl:for-each select="Menu">
<xsl:choose>
<xsl:when test="@Type='SubMenu'">
<TR>
<TD class="SubMenu">
<xsl:value-of select="text()" />
</TD>
</TR>
<xsl:for-each select="Menu">
<TR>
<TD class="MenuItem">
<A>
<xsl:attribute name="href">
<xsl:value-of select="href" />
</xsl:attribute>
<xsl:value-of select="text()"/>
</A>
</TD>
</TR>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<TR>
<TD class="MenuItem">
<A>
<xsl:attribute name="href">
<xsl:value-of select="href" />
</xsl:attribute>
<xsl:value-of select="text()"/>
</A>
</TD>
</TR>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</table>
</BODY>
</HTML>
</xsl:template>

</xsl:stylesheet>
------------------------end of xsl file-----------------------

I am a newbie to xml. Please excuse me if there are silly mistakes.

Thanks,
Raghu

Jul 20 '05 #2


Raghavendra RAV wrote:

My Xml and Xsl files are included here...
On executing my xml file, i am not getting anything in my browser..
my browser shows blank..
please give me some solution or point where the problem is..

---------------xml file------------------------------------------------

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="MenuRender.xsl"?>

<TopMenu Caption="Links">
<Menu Type="SubMenu" Caption="Cybernet">
<Menu Type="MenuItem" href="http://cybernetsoft.com">
Cybernet Software Systems
</Menu>

<Menu Type="MenuItem" href="http://11.1.15.10">
Time Sheet
</Menu>
</Menu>

<Menu Type="SubMenu" Caption="Slash Support">
<Menu Type="MenuItem" href="http://slashsupport.com">
Slash Homepage
</Menu>

<Menu Type="MenuItem" href="http://24carats.slashsupport.com">
24 Carats Program
</Menu>
</Menu>

<Menu Type="MenuItem" href="http://readytestgo.com">
RTG Homepage
</Menu>
</TopMenu>

----------------------end of xml------------------------------------

-----------------------xsl file--------------------------------------

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<!-- <xsl:param name="CurrentPage">CurrentPage</xsl:param>
<xsl:param name="MenuId">1</xsl:param> -->

<xsl:template match="/">
<HTML>
<BODY>
<table width="100px" border="0px" cellspacing="0px" cellpadding="0px">
<TR>
<TD class="MenuTitleBar">
<xsl:value-of select="@Caption"/>
Use
<xsl:value-of select="TopMenu/@Caption" />
</TD>
</TR>
<xsl:for-each select="Menu">


Try
<xsl:for-each select="TopMenu/Menu">
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #3
Hi,

Both clues were perfect.

Thanks a lot dear Marrow & Martin.

Thanks Again,
Raghu

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #4

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

Similar topics

0
by: Sergio del Amo | last post by:
Hi, I use the xslt functions provided by php. I am running in my computer the package xampp(www.apachefriends.org) which includes php/apache/mysql .. In this package the php includes the sablotron...
3
by: pradeep gummi | last post by:
I have an XML FILE that is to be converted to Plain Text using an XSL file. Since I just want plain text, I do not want to set any root element during transformation.And if I do not any root...
4
by: Kevin Dean | last post by:
I'm trying to create an XSL transformation that will strip out development-specific attributes from deployment descriptors and other XML files. I have already successfully done so with web.xml but...
7
by: CK | last post by:
Hello, I have the 60 MB XML string and I am coding a program in Visual Basic to run a XSL transformation on it. Currently, I'm using the Microsoft standard MSXML 2.0 to create a DOM document, load...
8
by: Will | last post by:
I was thrust into XML about 2 weeks ago and don't know much yet. From another department in the corp I am receiving an XML file which concatenates nodes all on one line i.e....
4
by: Mike Conmackie | last post by:
Hi Folks, I've probably omitted something very basic but I have no idea what it might be. The results of my transformation _should_ be an xml file but all I get is the xml declaration...
6
by: Jain, Pranay Kumar | last post by:
Hi All, We have created a simple application that takes a dataset and generates the data in Excel schema format. It uses an xslt file to do the transformation for excel 2002 and so on. We are...
2
by: TomekR | last post by:
Hello ! I was developing xslt sheet lately and - experimenting - I made mistake resulting in that, the effect of the transformation is not well-formed xml document. I made these tests using...
2
by: HendrikLeder | last post by:
Hello everybody :-) Next year I`ll write my diploma in computer science for business (It`s a degree in Germany) and I`ve some questions about the topic. The diploma will handle about refactoring...
1
by: newbie | last post by:
This is probably a too general question, thanks for any feedback in advance. I am trying to write a class to do transformation on a data set. I want to make it easy to maintain in the long-run...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.