XML::XPath createNode with the same name??
"Brian" <[email protected]>
| Newsgroups | gmane.comp.lang.perl.xml |
|---|---|
| Message-ID | <[email protected]> |
Using XML::Xpath, I would like to be able to add multiple child nodes to
the <recipientList> node, all called <recipient>
When done, I need to have a file that looks like:
<?xml version="1.0" encoding="UTF-8"?>
<myCompanyDocument>
<corporateHeader>
<companyName>MyCompany, Inc.</companyName>
</corporateHeader>
<document>
<documentHeader>
<documentTyp>NotificationRequest</documentTyp>
<documentTitle>EnterpriseCollaborator_NotificationRequest</documentTitle>
<documentDate>2010-03-25</documentDate>
<documentDesc>A request of Enterprise Notification
to notify</documentDesc>
</documentHeader>
<notificationRequest>
<notificationRequestHdr>
<originationDateTime/>
<isRegistered/>
<notificationRgstdDesc/>
<requestOriginator/>
<recipientList>
<recipient> [email protected]
</recipient>
<recipient> [email protected] </recipient>
<recipient> [email protected]
</recipient>
<recipient> [email protected]
</recipient>
</recipientList>
</notificationRequestHdr>
<notificationRequestBody>
<notificationRequestDtlList/>
</notificationRequestBody>
</notificationRequest>
</document>
</myCompanyDocument>
Using XML::XPAth I can create one child node, but I am having issues
creating multiple nodes with the same name. Is this possible with
XML::XPath? If so, can I get an example? I've been wrestling with this
for the better part of a day and really need to figure out the best way to
do this. I'm trying to avoid installing yet another perl module if I can,
but if what I need isn't possible with XML::XPath, I'm open to suggestions
on what to try next.
- Brian
_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs