•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the XML, XSLT and XPATH section within the Software Development category of DaniWeb, a massive community of 426,133 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,772 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our XML, XSLT and XPATH advertiser: Programming Forums
Views: 1148 | Replies: 0
![]() |
•
•
Join Date: Apr 2007
Posts: 12
Reputation:
Rep Power: 2
Solved Threads: 0
this is one feed
- <category name="Television" timeGenerated="2007-05-28T23:21:13" >
- <event name="Channel1" eventid="573512.20" date="20090701" time="1000" meeting="" >
- <televisiontype name=" Outright" inrunning="0">
<TV name="Videocon" id="16007131.20" price="$222" />
<TV name="Philips" id="16007132.20" price="$322" />
<TV name="Western" id="16007133.20" price="$121" />
</televisiontype>
</event>
</category>
this is another XML feed
<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE abcd SYSTEM "abcd.dtd"><abcd version="6.0" created="2007-05-29 06:15:26" lastMsgId="3080173">
<response>
<returnStatus>
<code>100</code>
<message>success</message>
</returnStatus>
<respQueryApplyXSLT>
<class>
<id>9</id>
<name>Television</name>
<type>
<id>4020</id>
<name>Videocon</name>
<event>
<id>2890</id>
<name>channel1</name>
<date>2007-06-07</date>
<time>09:30:00</time>
<market>
<id>11819</id>
<name>Asia</name>
<eachway>
<reduction>/</reduction>
<place/>
</eachway>
<outcome>
<name>Speaker</name>
<price>$2000</price>
</outcome>
</type>
<type>
<id>4020</id>
<name>Philips</name>
<event>
<id>2890</id>
<name>channel1</name>
<date>2007-06-07</date>
<time>09:30:00</time>
<market>
<id>11819</id>
<name>Africa</name>
<eachway>
<reduction>/</reduction>
<place/>
</eachway>
<outcome>
<name>Speaker</name>
<price>$2100</price>
</outcome>
</type>
</class>
</respQueryApplyXSLT>
</response>
</abcd>
now i have database fields like
categoryname
eventname
Typename
Price
from the first set of xml feeds i have done like
xmldocument xmldoc=new xmldocument();
xmldoc.LoadXML(URL);
Xmlnode nevents=xmldoc.Childnodes[0];
categoryname=nevents.attributes["name"];
foreach(xmlnode nevent in nevents)
{
eventname=?
foreach(xmlnode type in nevent.childnodes)
{
typename=?
foreach(Xmlnode nprice in type)
{
price=?
}
}
}
now taking a look at the second xml feed the contents are same like
i need to match the price alone
for example i need to load only the price for videocon from the second feed matching the first feed
i dont know how to proceed on this
plz help me on this regard
Shruthi
- <category name="Television" timeGenerated="2007-05-28T23:21:13" >
- <event name="Channel1" eventid="573512.20" date="20090701" time="1000" meeting="" >
- <televisiontype name=" Outright" inrunning="0">
<TV name="Videocon" id="16007131.20" price="$222" />
<TV name="Philips" id="16007132.20" price="$322" />
<TV name="Western" id="16007133.20" price="$121" />
</televisiontype>
</event>
</category>
this is another XML feed
<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE abcd SYSTEM "abcd.dtd"><abcd version="6.0" created="2007-05-29 06:15:26" lastMsgId="3080173">
<response>
<returnStatus>
<code>100</code>
<message>success</message>
</returnStatus>
<respQueryApplyXSLT>
<class>
<id>9</id>
<name>Television</name>
<type>
<id>4020</id>
<name>Videocon</name>
<event>
<id>2890</id>
<name>channel1</name>
<date>2007-06-07</date>
<time>09:30:00</time>
<market>
<id>11819</id>
<name>Asia</name>
<eachway>
<reduction>/</reduction>
<place/>
</eachway>
<outcome>
<name>Speaker</name>
<price>$2000</price>
</outcome>
</type>
<type>
<id>4020</id>
<name>Philips</name>
<event>
<id>2890</id>
<name>channel1</name>
<date>2007-06-07</date>
<time>09:30:00</time>
<market>
<id>11819</id>
<name>Africa</name>
<eachway>
<reduction>/</reduction>
<place/>
</eachway>
<outcome>
<name>Speaker</name>
<price>$2100</price>
</outcome>
</type>
</class>
</respQueryApplyXSLT>
</response>
</abcd>
now i have database fields like
categoryname
eventname
Typename
Price
from the first set of xml feeds i have done like
xmldocument xmldoc=new xmldocument();
xmldoc.LoadXML(URL);
Xmlnode nevents=xmldoc.Childnodes[0];
categoryname=nevents.attributes["name"];
foreach(xmlnode nevent in nevents)
{
eventname=?
foreach(xmlnode type in nevent.childnodes)
{
typename=?
foreach(Xmlnode nprice in type)
{
price=?
}
}
}
now taking a look at the second xml feed the contents are same like
i need to match the price alone
for example i need to load only the price for videocon from the second feed matching the first feed
i dont know how to proceed on this
plz help me on this regard
Shruthi
![]() |
•
•
•
•
•
•
•
•
DaniWeb XML, XSLT and XPATH Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- IT Programmer wanted (Tech / IT Consultant Job Offers)
- how to read multiple xml feeds (XML, XSLT and XPATH)
- using php to check for filenames (PHP)
- Parse XML from ASP!!! (ASP)
- Concept to fruition - the chronicle of a new site (Growing an Online Community)
- Rss Feeds! (RSS, Web Services and SOAP)
Other Threads in the XML, XSLT and XPATH Forum
- Previous Thread: how to read multiple xml feeds
- Next Thread: XML or XSL or What??


Linear Mode