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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Asp.net, xml and xsl newbie

Status
Not open for further replies.

jordan11

Technical User
May 24, 2003
150
0
0
GB
Hi,

I trying to write an application that will allow a user to go in and see a list of articles, once they selects an article they should have the options to delete,edit or add new article.

I am doing this using asp.net (vb), xml and xsl.


At the moment I am able to display a page using using the above methods but I am not sure how to edit delete or add new. Also on save the data is saved to 2 xml documents.





This is the xml I am using

site_map.xml


<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="site_map.xsl"?>
<levels>
<level1 id="1" title="article1" teaser="all about article3" show=""/>
<level1 id="2" title="article2" teaser="all about article3"show="" />
<level1 id="3" title="article3" teaser="all about article3" show="" />
</levels>

each Id has its own content
so this is an e.g of the content for id="1" so on save if I am adding a new article the title will be saved in site_map.xml with a new id and and create a new content using the new id in paggecontet.xml as the name of the xml so at the moment I have content saved as

1.xml
2.xml
3.xml

which are all link to the site_map.xml
<?xml version="1.0"?>

<page>

<pagecontentblocks>
<pagecontent><![CDATA[<strong>article 1</strong> test data 1]]></pagecontent>
</pagecontentblocks>
</page>


This xsl displays all the information in site_map xml and gives the user the option to add, delete, edit and save

edit.xsl
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="<xsl:eek:utput method="html" />

<xsl:param name="pgid" select="1"/>

<xsl:template match="/">

<xsl:call-template name="content"/>

</xsl:template>
<xsl:template name="content">
<tr><td id="{@id}"><a title="Follow link to add new article"
href="cms_edit.aspx?" ><b>Add a new article</b></a></td></tr>
<xsl:for-each select="levels/level1">
<tr>
<td>
<span><xsl:value-of select="@title" /></span></td>
<td id="{@id}"><a title="Follow link for {@title}"
href="cms_edit.aspx?pageID={@id}&amp;title={@title}" > Edit</a>
</td>
<td><a
title="link for {@name}"
href="delete.aspx?pageID={@id}&amp;title={@title}" >Delete</a>
</td>
</tr>
</xsl:for-each>
</xsl:template>

</xsl:stylesheet>


thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top