שאלה על תצוגת קובץ xml

shinza

New member
שאלה על תצוגת קובץ xml

איך כותבים בnet את הקוד הבא:
<html> <body> <script type="text/vbscript"> set xmlDoc=CreateObject("Microsoft.XMLDOM") xmlDoc.async="false" xmlDoc.load("cdcatalog.xml") path="/catalog/cd/price/text()" set nodes=xmlDoc.selectNodes(path) for each x in nodes document.write("<xmp>") document.write(x.xml) document.write("</xmp>") next </script> </body> </html>​
תודה
 

nattygur

New member
משתמשים במחלקה :

System.Xml.XmlDataDocument. יש הרבה תעוד ודוגמאות ב Google. בעקרון זה מאוד דומה ...
 

shinza

New member
תודה, אני מנסה מאוד בסיסי ולא מצליח

<%@ Page Language="VB" Debug="true" %> <%@ import Namespace="System.Data" %> <script runat="server"> sub Page_Load if Not Page.IsPostBack then dim mycdcatalog=New DataSet mycdcatalog.ReadXml(MapPath("cdcatalog.xml")) While (mycdcatalog.Read()) title.Text = mycdcatalog("id").ToString End While end if end sub </script> <html> <head> </head> <body> <asp:Label id="title" runat="server"></asp:Label> </body> </html>​
שגיעה: System.MissingMemberException: Public member 'Read' on type 'DataSet' not found
 

shinza

New member
אורי הצלחתי ... אבל

<script runat="server"> sub Page_Load if Not Page.IsPostBack then dim mycdcatalog=New DataSet Dim nodesa As DataRow mycdcatalog.ReadXml(MapPath("cdcatalog.xml")) nodesa = new mycdcatalog.selectNodes(catalog/cd/price/text()) For Each nodes In mycdcatalog.Tables(0).Rows title.Text = nodesa("id") next end if end dub </script> Type 'mycdcatalog.selectNodes' is not defined.​
 
למעלה