|
Thanks for that,
However it returns me a single value of the valueofSurname.
For example if the surname is "Stevens" will populate every surname with "Stevens" in the column.
What I need to do is to be able to change the value-of column and select firstname instead of surname.
regards
Tony
|
|
|
|
|
Then u can incorporate the same in ur xslt itself, u just need to use xpath,select desired node and directly put the value. If u can give me same xml and xsl may be i can give u an example of the same.
|
|
|
|
|
I have a XSLT and I want to pass a parameter runtime with javascript. Here is my XSL
<xsl:param name="surname">;
...
...
...
<xsl:template match="customer">
<xsl:value-of select="$surname/><br mode=" hold=" /><xsl:value-of select=" title="">
<xsl:value-of select="DOB">
I need to populate the surname, I am using the DOM object in javascript
Thanks in advance
Tony
|
|
|
|
|
i got an XmlDocument which contains the following nodes:
<br />
<br />
<msg t='xt'><body action='xtRes' r='-1'><![CDATA[<dataObj><var n='email' t='s'>9292</var><var n='name' t='s'>uds kan</var><var n='usersOnline' t='n'>1761</var><var n='bonus' t='s'>0</var><var n='points' t='n'>37</var><var n='_cmd' t='s'>logOK</var></dataObj>]]></body></msg><br />
<br />
<br />
my question is how do i Parse the CDATA section in the xml to a data object?
( i am using c sharp )
modified on Friday, December 07, 2007 9:16:34 AM
|
|
|
|
|
In www.eurostall.com I have created RSS feed like this only. Just you go to the file www.eurostall.com/sitemap.xml and analyse. It may help.
|
|
|
|
|
hi all,
I want to compare 2 xml files with each other. One xml file is standard on my pc and has the name standard.xml. the other xml file is on the server and has the name server.xml
i want to compare these 2 files with each other and if it contains new info it should be added in the pc.xml file.
in msdn, i found that XML diff and patch tool is used to compare two xml files. but i do not want to add a additional tool to be installed for this purpose.
i tried to do the comparison by getting the nodes in a XmlNodeList and comparing the two nodelists. but i am struck at one point.
how can i find out whether a node already exists in a xml document. say for eg,
in my xml file,i have a structure like this,
<Main>
<url type_node="S" tool_tip="http://www.mysite.com/sample.xml">http://www.mysite.com/sample.xml</url>
<Category2>
<url type_node="S" tool_tip="http://www.mysite.com/sample1.xml">http://www.mysite.com/sample1.xml</url>
</Category2>
</Main>
in this,
Category2 is a childnode of Main. i want to check if the url element for sample exists already in the document.
how can i do this. i tried using xmldoc.getElementsByTagName(node.innerText);
but i am always getting a count of 1 even if the node does not exits in the document.
Hope i am clear in my question.
Any suggestions?
Thanks in advance.
Regards
Anuradha
|
|
|
|
|
Can you explain it more.may be i can help.
|
|
|
|
|
Im Serializing this Object 'PersonNode'. It Serializing ok but the attribute 'name' is not coming through. Why would this be?
[Serializable]
public class PersonNode: List<child>
{
[XmlAttribute("name")]
public string name;
|
|
|
|
|
Without reading ur xml and .cs file Its not possible to answer your query...
|
|
|
|
|
I'v been advised to, and have chosen to follow that advice to, author a schema (xsd) that represents a hierarchy of classes (not an inheritance hierarchy, rather a master-child) and to generate the classes using the Visual Studio xsd.exe tool. This makes sense to me, as I currently have draft XML documents, for which I have hand [crafted] classes to represent functioning parts of the object described by the XML.
Currently I'm just taking my first step beyond the demo/prototype stage, where each class has hard-coded logic, even hard-coded element and attribute mappings, and moving toward a more generic serialization mechanism. This xsd.exe seems ideal, as my schema should be the driving artifact, not the classes. What I would like now is a crash course in schema authoring, an online resource I can print or download and take home with me. Who can recommend what for me?
|
|
|
|
|
I'm writing a C# Windows/.Net 2.0 app which will take a large XML document as an initial input. My form has 4 basic controls: 3 comboboxes (Country, State, and City) for filtering the XML data and a DataGrid to display the results. The XML doc has this format:
<updates xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<locations>
<country name="United States">
<state name="California">
<city name="Santa Monica">
<location id="2" venue_id="1" category="Hotel" name="Example Hotel" address="3214 Wilshire Blvd." zipcode="90404"/>
<location id="3" venue_id="2" category="Airport" name="Santa Monica Airport" address=" 3223 Donald Douglas Loop"/>
</city>
<city name="Los Angeles">
<location id="4" venue_id="3" category="wwan" name="Cell Carrier GPRS Network" address="Entire LA Metro Area"/>
</city>
<city name="San Diego">
<location id="5" venue_id="1" category="Hotel" name="Mike Hotel" address="3214 Mike Blvd." zipcode="90414"/>
<location id="6" venue_id="2" category="Airport" name="John Airport" address=" 3223 john Douglas Loop S Ste 3"/>
<location id="7" venue_id="1" category="Cafe" name="New Hotel" address="3214 New Scott Blvd." zipcode="90434"/>
<location id="8" venue_id="2" category="Bar" name="New Airport" address=" 3223 New Douglas Loop S Ste 4"/>
</city>
</state>
<state name="Colorado">
<city name="Colorado Springs">
<location id="2" venue_id="1" category="Hotel" name="Example Hotel" address="3214 El Paso Blvd." zipcode="90404"/>
<location id="3" venue_id="2" category="Airport" name="Colorado Springs Airport" address=" 3223 Airport Drive"/>
</city>
<city name="Denver">
<location id="4" venue_id="3" category="wwan" name="Cell Carrier GPRS Network" address="Entire COSP Metro Area"/>
</city>
</state>
</country>
</locations>
</updates>
I have no problem using XPath queries to extract the values to populate the Country, State, and City comboboxes; each selection drives the data in the subsequent combobox. Upon selection in the City combobox, I can query for a resulting set of 'locations'. My problem is how to stuff this XmlNodeList into a DataSet which I can then use with my DataGrid. I have no problem reading an entire document into a DataSet
DataSet ds = new DataSet();
ds.ReadXml("Test.Search.xml");
but have no idea how to stuff an XmlNodeList into one.
Thanks.
Jack80918
|
|
|
|
|
As you probably already know, an XmlNodeList is really a collection XmlNode s. You have mentioned you can read an XML document directly into a DataSet . So, I can give you a some suggestions.
1. You can create an XmlDocument populating it with XmlNode s cloned from the XmlNodeList .
2. You can create an XmlDocument using XSLT with the same criteria you used to create the XmlNodeList .
3. You can create a DataTable (or DataTable s) that corresponds to your XmlNodeList and extract data from your XmlNode s into the appropriate rows and columns.
There are certainly other ways of doing this. So, search the web for ideas or just be creative.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
I tried to apply data islands to ordered list. But it is not working. I checked the data islands in table. It is working correctly. Please let me know why it is not working on ordered list?
Thanks and Regards,
Hogan
|
|
|
|
|
hogan.smith wrote: Please let me know why it is not working on ordered list?
That might be possible Hogan, but at least for me I require more specific information.
What does "apply data island to ordered list" mean?
What does "it is not working" mean?
|
|
|
|
|
Hi mike,
Thanks for reply. I tried to load data into an ordered list from an xml file.
Content of test.xml file.
<?xml version="1.0" encoding="utf-8"?>
<menu>
<node>
<name>Link 1</name>
<link>link1.htm</link>
</node>
<node>
<name>Link 2</name>
<link>link2.htm</link>
</node>
<node>
<name>Link 3</name>
<link>link3.htm</link>
</node>
<node>
<name>Link 4</name>
<link>link4.htm</link>
</node>
<node>
<name>Link 5</name>
<link>link5.htm</link>
</node>
</menu>
Html code
<html>
<head>
</head>
<body>
<xml id="menu" src="test.xml"></xml>
<ol datasrc="#menu">
<li><span datafld="name"></span></li>
</ol>
</body>
</html>
Thanks and regards,
Hogan
|
|
|
|
|
Hi,
could you please recommend me a free XSLT files generator?
Thank you in advance
|
|
|
|
|
Yoyosch wrote: could you please recommend me a free XSLT files generator?
try using Yoyosch
|
|
|
|
|
|
led mike believes you are capable of creating XSLT code after studying XSLT syntax. As far as the existense of free XSLT generator software, I haven't had any reason to look for that. However, XSLT is just XML, and can be created as you would an XML document. IMHO, XSLT generator software would be for a special purpose.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Where can i get open source code for Media RSS 2.0 parser?
I want the output to be generated in XML format by passing url of type Media RSS 2.0.
For this where can i get open source code?
Rajshri
|
|
|
|
|
hi everyone ..i m working on one zoo project ..so i need some information .. i want 2 create xml file as a database and i want 2 insert data ,delete data,and update .. in xml database plzz can any one tell how it ll do?? in using C# code..
thanks 2 all..
|
|
|
|
|
Insert and delete are pretty simple methods. U just need to access proper node with the help of Xpath query.
Post ur specific question if u have any...
|
|
|
|
|
can u provide insert and delete code..plz...
thanks 2 all..
|
|
|
|
|
|
Check This Out...It will work out...
Protected Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GridView1.RowUpdating
Dim i As Integer = GridView1.Rows(e.RowIndex).DataItemIndex
Dim strId As String = CType(GridView1.Rows(e.RowIndex).Cells(2).Controls(0), TextBox).Text
Dim strName As String = CType(GridView1.Rows(e.RowIndex).Cells(3).Controls(0), TextBox).Text
GridView1.EditIndex = -1
BindGrid()
' Update the XML file using the new values
Dim oDs As Data.DataSet = GridView1.DataSource
oDs.Tables(0).Rows(i).Item(0) = strId
oDs.Tables(0).Rows(i).Item(1) = strName
oDs.WriteXml(Request.PhysicalApplicationPath + "books.xml")
BindGrid()
End Sub
Protected Sub GridView1_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GridView1.RowDeleting
BindGrid()
Dim oDs As Data.DataSet = GridView1.DataSource
oDs.Tables(0).Rows(GridView1.Rows(e.RowIndex).DataItemIndex).Delete()
oDs.WriteXml(Request.PhysicalApplicationPath + "books.xml")
BindGrid()
End Sub
Protected Sub GridView1_RowCancelingEdit(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GridView1.RowCancelingEdit
GridView1.EditIndex = -1
BindGrid()
End Sub
Protected Sub GridView1_RowEditing(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GridView1.RowEditing
GridView1.EditIndex = e.NewEditIndex
BindGrid()
End Sub
Protected Sub GridView1_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles GridView1.PageIndexChanging
GridView1.PageIndex = e.NewPageIndex
BindGrid()
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Page.IsPostBack = False Then
BindGrid()
End If
End Sub
Sub BindGrid()
Dim oDs As New Data.DataSet
oDs.ReadXml(Request.PhysicalApplicationPath + "books.xml")
GridView1.DataSource = oDs
GridView1.DataBind()
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
If txtId.Text = "" Or txtName.Text = "" Then
MsgBox("A Value Is Required...!")
Else
BindGrid()
Dim oDs As Data.DataSet = GridView1.DataSource
Dim oDr As Data.DataRow = oDs.Tables(0).NewRow
oDr("Name") = txtId.Text
oDr("Author") = txtName.Text
oDs.Tables(0).Rows.Add(oDr)
oDs.WriteXml(Request.PhysicalApplicationPath + "books.xml")
BindGrid()
txtId.Text = ""
txtName.Text = ""
txtId.Focus()
End If
End Sub
Regards
Abhishek,Nanda
|
|
|
|