all groups > dotnet xml > december 2004 >
You're in the

dotnet xml

group:

XSLT example does not work?


XSLT example does not work? Paolo Pignatelli
12/20/2004 10:18:17 AM
dotnet xml:
I am trying to work the example on
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q315888 .

I follow esxactly the advice (I beleive):
Here are the files:
WebForm1.aspx:
--
....
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:Xml id="XmlTransform" runat="server"></asp:Xml>
</form>
</body>
</HTML>
--
(Code Behind for page)
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

'Put user code to initialize the page here

XmlTransform.DocumentSource = Request.QueryString("xml")

XmlTransform.TransformSource = Request.QueryString("xls")

End Sub

----------------------------------------------------------------------------
---------------------

Books.xml

<?xml version="1.0" encoding="utf-8" ?>

<Books>

<Book>

<Title>Beginning XML</Title>

<Author>John</Author>

</Book>

<Book>

<Title>Mastering XML</Title>

<Author>Peter</Author>

</Book>

</Books>

----------------------------------------------------------------------------
---------------------------------

Books.xslt:

<?xml version="1.0" encoding="UTF-8" ?>

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

<xsl:template match="Books">

<HTML>

<BODY>

<TABLE BORDER="2">

<TR>

<TD>Title</TD>

<TD>Author</TD>

</TR>

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

<TR>

<TD><xsl:value-of select="Title"/></TD>

<TD><xsl:value-of select="Author"/></TD>

</TR>

</xsl:for-each>

</TABLE>

</BODY>

</HTML>

</xsl:template>

</stylesheet>

------------------------------------------------

the link to see the result in browser ....

http://localhost/SlideShow1/WebForm1.aspx?xml=Books.xml&xsl=Books.xslt

but this is the result :

JohnPeter

*It is missing information and is totally unformatted. *



What am I doing wrong?



TIA,



Paolo


Re: XSLT example does not work? Paolo Pignatelli
12/20/2004 11:23:12 AM
Thanks!!


[quoted text, click to view]

Re: XSLT example does not work? Martin Honnen
12/20/2004 4:29:20 PM


[quoted text, click to view]


[quoted text, click to view]
^^^

[quoted text, click to view]
^^^

Those two need to match that is you need to use either xls in both
places or xsl in both places.

--

Martin Honnen
AddThis Social Bookmark Button