Click here to Skip to main content
15,886,919 members
Home / Discussions / XML / XSL
   

XML / XSL

 
Questionserialize colors and fonts in XML Pin
urbane.tiger9-Oct-07 21:09
urbane.tiger9-Oct-07 21:09 
AnswerRe: serialize colors and fonts in XML Pin
led mike10-Oct-07 4:36
led mike10-Oct-07 4:36 
GeneralRe: serialize colors and fonts in XML Pin
urbane.tiger10-Oct-07 23:39
urbane.tiger10-Oct-07 23:39 
GeneralRe: serialize colors and fonts in XML Pin
led mike11-Oct-07 5:41
led mike11-Oct-07 5:41 
GeneralRe: serialize colors and fonts in XML Pin
urbane.tiger11-Oct-07 18:28
urbane.tiger11-Oct-07 18:28 
GeneralRe: serialize colors and fonts in XML Pin
led mike12-Oct-07 4:10
led mike12-Oct-07 4:10 
GeneralRe: serialize colors and fonts in XML Pin
urbane.tiger14-Oct-07 19:30
urbane.tiger14-Oct-07 19:30 
QuestionRegarding xpath expressions Pin
anu818-Oct-07 23:48
anu818-Oct-07 23:48 
hi all,
i have the following xml file.

<rss version="2.0" xmlns:media="http://tools.search.yahoo.com/mrss/" >
<channel>
<title>SWF media</title>
<link>http://www.blogdigger.com/media/</link>
<description>Recent .swf files found by Blogdigger</description>
<item>
<title>Dollar Bus Rolls Into Town</title>
<link>http://feeds.feedburner.com/Chicagoist?m=1115</link>
<description>some description</description>
<pubDate>Thu, 23 Mar 2006 14:11:57 EST</pubDate>
<enclosure url="http://www.kitschn.com/flash/MenuCoverPage-DrinksMenu09-05.swf" type="application/x-shockwave-flash"/>
<media:content url="http://www.kitschn.com/flash/MenuCoverPage-DrinksMenu09-05.swf" type="application/x-shockwave-flash"/>
</item>

<item>
<title>E-mail</title>
<link>http://billarnold.typepad.com/poet_in_motion/2006/03/email.html</link>
<description>description 2/description>
<pubDate>Wed, 22 Mar 2006 17:28:28 EST</pubDate>
<enclosure url="http://www.softlab.ece.ntua.gr/~sivann/pub/swf/may02-smilepop-soapbox4.swf" type="application/x-shockwave-flash"/>
<media:content url="http://www.softlab.ece.ntua.gr/~sivann/pub/swf/may02-smilepop-soapbox4.swf" type="application/x-shockwave-flash"/>
</item>
</channel>
</rss>

i am using xpath to navigate through this xml file.
i used the following code to navigate through items node.

XmlDocument doc = new XmlDocument();
doc.Load(xmlfile);

XPathNavigator nav = doc.CreateNavigator();
XPathExpression exp = nav.Compile("rss/channel/item");

XPathNodeIterator iterator = nav.Select(exp);
XPathNodeIterator iter1;
while (iterator.MoveNext())
{
iter1 = iterator.Current.SelectChildren("media:content", "");
if (iter1.Count > 0)
{
while (iter1.MoveNext())
{
if (iter1.Current.HasAttributes == true)
{
string url = iter1.Current.GetAttribute("url", "");
}
}
}
}

but when i execute the code, the iter1.count always returns zero. if i select anyother children(like title or description)i am able to display the value.but when i select media:content(one of the subitems of item) i am not able to display the attribute value.

Where am i going wrong?

Any suggestions please



Thanks in advance.Smile | :)

Regards

Anuradha
AnswerRe: Regarding xpath expressions Pin
anu819-Oct-07 0:31
anu819-Oct-07 0:31 
QuestionWord XML/XSLT Pin
Glenn E. Lanier II8-Oct-07 12:44
Glenn E. Lanier II8-Oct-07 12:44 
QuestionFormula to calculate Equal Monthly Payments Pin
Vtoria8-Oct-07 7:35
Vtoria8-Oct-07 7:35 
AnswerRe: Formula to calculate Equal Monthly Payments Pin
Howard Richards22-Oct-07 5:16
Howard Richards22-Oct-07 5:16 
QuestionSimple Filter Question Pin
Glenn E. Lanier II8-Oct-07 4:35
Glenn E. Lanier II8-Oct-07 4:35 
AnswerRe: Simple Filter Question Pin
pmarfleet8-Oct-07 10:03
pmarfleet8-Oct-07 10:03 
GeneralRe: Simple Filter Question Pin
Glenn E. Lanier II8-Oct-07 10:09
Glenn E. Lanier II8-Oct-07 10:09 
QuestionXSL creation Problem Pin
Vanamaindia3-Oct-07 23:45
Vanamaindia3-Oct-07 23:45 
AnswerRe: XSL creation Problem Pin
Not Active4-Oct-07 2:22
mentorNot Active4-Oct-07 2:22 
Questionerror when adding web reference Pin
vijayaBTS3-Oct-07 21:15
vijayaBTS3-Oct-07 21:15 
QuestionSchema with Entity -- Validating Error Pin
xfun5563-Oct-07 3:08
xfun5563-Oct-07 3:08 
Questionxml serializer Pin
mukkanti0073-Oct-07 2:05
mukkanti0073-Oct-07 2:05 
AnswerRe: xml serializer Pin
Ilya Verbitskiy3-Oct-07 4:48
Ilya Verbitskiy3-Oct-07 4:48 
AnswerRe: xml serializer Pin
Dave Kreskowiak3-Oct-07 5:03
mveDave Kreskowiak3-Oct-07 5:03 
QuestionImage display problem Pin
SUDHAKAR PALLAM2-Oct-07 18:34
SUDHAKAR PALLAM2-Oct-07 18:34 
Questionsimple XPATH help Pin
eggie52-Oct-07 9:04
eggie52-Oct-07 9:04 
AnswerRe: simple XPATH help Pin
Scott Dorman2-Oct-07 16:45
professionalScott Dorman2-Oct-07 16:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.