Hi,
Thanks for the reply, Peroli. And sorry for not making things clear.
>Peroli wrote:
>Since you are a starter with XML, XML::* modules are pure perl
I am not a starter in XML and not a starter in Perl either, but surely
a newbie in using modules for processing XML.
>foreach ($xmlDom->documentElement->findnodes('/root/image')) {
>if($_->findvalue('name') =~ /^IMG_/) {
>#dosomething
>}
>}
Thanks again for the clearly-understandable example, that almost
matched what I had in mind, but don't we have to repeat the same loop
for all the elements that need to be validated?
Is there a shorter way to do this, by associating each XML element with
its corresponding validation subroutine.
>Doing this thing in SAX would require a new strategy. I think if you
>are a newbie start with DOM, because its a lot easy to visualize the
>whole problem.
I need to check for IDs, IDREFs and IDREF content also. For that I need
to process IDs before I check IDREFs. Because the order is not
sequential will this work with SAX?
Thanks for all the clarifications.
Sara.
|