Then use any XML parser, XML::Parser, XML::Twig, etc. to extract the <choices> and <answer> parts separately. Yould could also probably do this using XSLT, too, if you wanted to reamin XML pure. But I would go for the perl-based solutions first.<?xml version="1.0"?> <data> <question id="1"> <qtext>What does KB stand for?</qtext> <choices> <choice>Kilo Bits</choice> <choice>Key Board</choice> <choice>Kilo Bytes</choice> <choice>None</choice> </choices> <answer>2</answer> <answer>3</answer> </question> <question id="2"> <qtext>CPU stands for</qtext> <choices> <choice>Central Processing Unit</choice> <choice>Central Power Unit</choice> <choice>Core Processing Unit</choice> <choice>Core Power Unit</choice> </choices> <answer>1</answer> <answer>4</answer> </question> <question id="3"> <qtext>1 KB equals</qtext> <choices> <choice>1000 Bytes</choice> <choice>1024 Bytes</choice> <choice>1000 Bits</choice> <choice>1024 Bits</choice> <choice>Nothing</choice> </choices> <answer>2</answer> <answer>1</answer> </question> </data>
-Mark
In reply to Re: XML templates + variables??
by kvale
in thread XML templates + variables??
by dagb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |