Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Resultant Transformation not appearing

Reply
Thread Tools

Resultant Transformation not appearing

 
 
Raghavendra RAV
Guest
Posts: n/a
 
      08-25-2004
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" xmlnssl="http://www.w3.org/1999/XSL/Transform">

<!-- <xslaram name="CurrentPage">CurrentPage</xslaram>
<xslaram name="MenuId">1</xslaram> -->

<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>
<xsltherwise>
<TR>
<TD class="MenuItem">
<A>
<xsl:attribute name="href">
<xsl:value-of select="href" />
</xsl:attribute>
<xsl:value-of select="text()"/>
</A>
</TD>
</TR>
</xsltherwise>
</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
 
Reply With Quote
 
 
 
 
Marrow
Guest
Posts: n/a
 
      08-25-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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"

xmlnssl="http://www.w3.org/1999/XSL/Transform">
>
> <!-- <xslaram name="CurrentPage">CurrentPage</xslaram>
> <xslaram name="MenuId">1</xslaram> -->
>
> <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>
> <xsltherwise>
> <TR>
> <TD class="MenuItem">
> <A>
> <xsl:attribute name="href">
> <xsl:value-of select="href" />
> </xsl:attribute>
> <xsl:value-of select="text()"/>
> </A>
> </TD>
> </TR>
> </xsltherwise>
> </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



 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      08-25-2004


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" xmlnssl="http://www.w3.org/1999/XSL/Transform">
>
> <!-- <xslaram name="CurrentPage">CurrentPage</xslaram>
> <xslaram name="MenuId">1</xslaram> -->
>
> <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/
 
Reply With Quote
 
Raghavendra RAV
Guest
Posts: n/a
 
      08-26-2004
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!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
resultant text height Keith G Hicks ASP .Net 0 02-14-2008 05:11 PM
Textarea challenge: caret pos, resultant text Csaba Gabor Javascript 0 04-04-2006 08:12 PM
Links in Outlook Express not working,page not appearing Thaqalain Computer Support 7 09-30-2005 12:48 PM
CCD And Resultant Aspect Ratio ? (relative to 4x6 printing) Quest., Please Robert11 Digital Photography 9 01-16-2004 09:04 PM
MSXML : i want to get the resultant HTML in a variable asim ASP General 0 07-18-2003 01:16 PM



Advertisments