Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Proper usage of XML with ASPX

Status
Not open for further replies.

kennyaidan

Programmer
Apr 9, 2003
54
IE
Hi,
I'm a beginner aspx programmer and i am about to start learning aspx and some simple xml. I was wondering what were the apprioate steps in creating aspx files using xml.
Would you start with a simple xml file similar to the following

epo.xml

<episodes>
<episode series=&quot;TNG&quot; season=&quot;7&quot;>
<name>All Good Things</name>
<desc>The final episode of TNG.</desc>
</episode>
</episodes>

A xsl file like the following
epo.xsl

<?xml version=&quot;1.0&quot;?>

<xsl:stylesheet version=&quot;1.1&quot; xmlns:xsl=&quot;<xsl:eek:utput method=&quot;html&quot; indent=&quot;yes&quot; />
<xsl:template match=&quot;/&quot;>
<font face=&quot;Verdana&quot; size=&quot;2&quot;>

<ul>
<xsl:for-each select=&quot;episodes/episode&quot;>
<p />
Series:<b><i> <xsl:value-of select=&quot;@series&quot; /></i></b><br />
Season:<b> <xsl:value-of select=&quot;@season&quot; /></b><br />
<li>
<b><xsl:value-of select=&quot;name&quot;/></b>
</li>
<br />
<xsl:value-of select=&quot;desc&quot;/>

</xsl:for-each>
</ul>
</font>
</xsl:template>
</xsl:stylesheet>

And then simple bring the two together using this asp.net file epo.aspx

<asp:xml runat=&quot;server&quot; DocumentSource=&quot;epo.xml&quot; TransformSource=&quot;epo.xsl&quot; />

I got this code from the following website
and i am wondering whether this is the normal way to create aspx files using xml. I want to get the steps and technique right before i move on. Can anyone suggest other tutorials that may be of benefit
thanks
aidan
 
Has some good articles/examples.

I used the XML control and the only downfall I encountered was that it was a little slow with a large number of records (i.e. 500+).

Hope this helps,
NatGreen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top