JoeBo747
asked on
Filter xml file
Hi Experts,
I have a xml file that is constructed by using a view on an SQL table, the xml file is used to supply mapping co-ordinates,
unfortunately I am unable to filter this view at source. How could I Filter this xml by the Title element
and use this filter to write another xml file with the same elements.
<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:georss="http://www.georss.org/georss/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
<channel>
<item>
<title>XTLM500</title>
<type>1</type>
<description><img src= Images/Small.jpg><br > United Kingdom<br><stron g>Vehic le Type</description>
<icon>Images/truck-small-p icture5.gi f</icon>
<ordnum>YourOrderNum</ordn um>
<geo:lat>51.6922833333333< /geo:lat>
<geo:long>-1.8727466666666 7</geo:lon g>
</item>
</channel>
</rss>
Regards,
JoeBo
I have a xml file that is constructed by using a view on an SQL table, the xml file is used to supply mapping co-ordinates,
unfortunately I am unable to filter this view at source. How could I Filter this xml by the Title element
and use this filter to write another xml file with the same elements.
<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:georss="http://www.georss.org/georss/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
<channel>
<item>
<title>XTLM500</title>
<type>1</type>
<description><img src= Images/Small.jpg><br
<icon>Images/truck-small-p
<ordnum>YourOrderNum</ordn
<geo:lat>51.6922833333333<
<geo:long>-1.8727466666666
</item>
</channel>
</rss>
Regards,
JoeBo
I don't quite get the context for the question. Are you saying that you have a DataSet that is constructed and filled from an XML file, and you want to create a RowFilter for a DataView?
ASKER
Hi TheLearnedOnei,
Thanks for the reply I have an XML file that plots positions on virtual earth the XML file is created using the a dblm datasource (monitoring) is created using a view on sql server 2005. This view has some fixed delimiters but I also wish to further limit the data source using a variable that must be supplied at runtime. The view does not allow this to happen so I need to either find a method that will achieve this or filter the resulting XML file a rebuild an xml file with the required records. Can you suggest a fix? I have reproduced the code that plots the position.
regards,
JoeBo
Thanks for the reply I have an XML file that plots positions on virtual earth the XML file is created using the a dblm datasource (monitoring) is created using a view on sql server 2005. This view has some fixed delimiters but I also wish to further limit the data source using a variable that must be supplied at runtime. The view does not allow this to happen so I need to either find a method that will achieve this or filter the resulting XML file a rebuild an xml file with the required records. Can you suggest a fix? I have reproduced the code that plots the position.
regards,
JoeBo
Try
Dim db As New MonitoringDataContext
Dim geoRSS = _
<rss xmlns:georss="http://www.georss.org/georss/">
<channel>
<%= From Monitoring In db.MonViews _
Let desc = "<img src= Images/SmallGBA.jpg" _
& "><br>" & Monitoring.Location _
& "<br><strong>Vehicle Type" _
Select <item>
<title><%= Monitoring.OrdNum %></title>
<type><%= Monitoring.TripType %></type>
<description><%= desc %></description>
<icon><%= Monitoring.VehDescription %></icon>
<ordnum><%= Monitoring.OrdNum %></ordnum>
<geo:lat><%= Monitoring.Latitude %></geo:lat>
<geo:long><%= Monitoring.Longitude %></geo:long>
</item> %>
</channel>
</rss>
geoRSS.Save(Server.MapPath("Monitoring.xml"))
'Me.TextBox1.Text = (geoRSS.ToString)
'LoadTree()
If geoRSS...<item>.Count > 0 Then
Session("georss") = geoRSS
Me.body.Attributes.Add("onload", String.Format("GetMap()"))
Else
'Me.lblStatus.Visible = True
Session("georss") = <rss></rss>
End If
Catch ex As Exception
MsgBox(Err.Description)
Finally
If Not Page.IsPostBack Then LoadTree()
End Try
Are you talking about version 3.5, and LINQ?
ASKER
Hi TheLearnedOne,
Sorry about the delay I have been out. Yes I am using version 3.5 and LINQ!
Regards,
JoeBo
Sorry about the delay I have been out. Yes I am using version 3.5 and LINQ!
Regards,
JoeBo
I am sorry, but I can't help you with that, yet.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.