parsing mixed XML content
|
|||
|
Rank: ? (2)
Member #: 25742 |
Hello,
I have an XML file such as: <users> <name>Joe</name> ... </users> <users> <name>Joe1</name> ... </users> <users> <name>Joe2</name> ... </users> now how can i grab only the name portions of the XML file and put them into an array. I have been trying different modules, but cant seem tot get it to work. Any help would be great. |
||
|
|||
|
|||
|
Rank: ? (171)
Member #: 11947 |
To parse the XML completely you need to use dynamic regular expressions (a regular expression in which it references itself).
The following regular expression will help you out. /<name>\s*(\w+?)\s*<\/name>/ |
||
|
|||
|
|||
|
Rank: ? (2)
Member #: 25742 |
i was looking around today, and you can do this with the XML::XPath module.
|
||
|
|||
|
|||
|
Rank: ? (171)
Member #: 11947 |
I thought you wanted to do it the hard way
|
||
|
Please login or register to post a reply.