Skip to main content
Fixed the question formation - missing auxiliary (or helping) verb - see e.g. <https://www.youtube.com/watch?v=t4yWEt0OSpg&t=1m49s> (see also <https://www.youtube.com/watch?v=kS5NfSzXfrI> (QUASM)) - alternatively, drop the question mark.
Link
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134

How tocan I parse XML and get instances of a particular node attribute?

Question and answers are not limited to counting. Reword misleading title introduced in edit #6.
Source Link
Mateen Ulhaq
  • 27.9k
  • 21
  • 121
  • 155

How to parse XML and countget instances of a particular node attribute?

I have many rows in XML and I'm trying to countget instances of a particular node attribute.

<foo> <bar> <type foobar="1"/> <type foobar="2"/> </bar> </foo> 

How cando I access the attributesvalues of the attribute foobar? In this example, I want "1" and "2".

How to parse XML and count instances of a particular node attribute?

I have many rows in XML and I'm trying to count instances of a particular node attribute.

<foo> <bar> <type foobar="1"/> <type foobar="2"/> </bar> </foo> 

How can I access the attributes of foobar? In this example, I want "1" and "2".

How to parse XML and get instances of a particular node attribute?

I have many rows in XML and I'm trying to get instances of a particular node attribute.

<foo> <bar> <type foobar="1"/> <type foobar="2"/> </bar> </foo> 

How do I access the values of the attribute foobar? In this example, I want "1" and "2".

Shorten.
Source Link
Mateen Ulhaq
  • 27.9k
  • 21
  • 121
  • 155

I have many rows in a database that contains XML and I'm trying to write a Python script to count instances of a particular node attribute.

My tree looks like:

<foo> <bar> <type foobar="1"/> <type foobar="2"/> </bar> </foo> 

How can I access the attributes of foobar? In this example, I want "1" and "2" in the XML using Python?.

I have many rows in a database that contains XML and I'm trying to write a Python script to count instances of a particular node attribute.

My tree looks like:

<foo> <bar> <type foobar="1"/> <type foobar="2"/> </bar> </foo> 

How can I access the attributes "1" and "2" in the XML using Python?

I have many rows in XML and I'm trying to count instances of a particular node attribute.

<foo> <bar> <type foobar="1"/> <type foobar="2"/> </bar> </foo> 

How can I access the attributes of foobar? In this example, I want "1" and "2".

Edited title to better express question being asked and removed language tag. Improved formatting.
Source Link
martineau
  • 124.1k
  • 29
  • 181
  • 319
Loading
edited for readability
Source Link
the Tin Man
  • 160.9k
  • 44
  • 222
  • 308
Loading
Question Protected by cs95
spelling
Source Link
Martin Thoma
  • 138.6k
  • 174
  • 687
  • 1.1k
Loading
title rephrased to not include superlative, grammar
Source Link
Brad Koch
  • 20.5k
  • 21
  • 114
  • 141
Loading
Post Reopened by daniels, Vlad, mmmmmm, dmeister, Kevin
Change the final question to make it more constructive.
Source Link
dmeister
  • 35.9k
  • 19
  • 76
  • 98
Loading
Post Closed as "not constructive" by Bill the Lizard
Source Link
randombits
  • 48.7k
  • 79
  • 275
  • 450
Loading