CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
including XML fragments into the main xml file

 



zatlas1
Novice

Sep 3, 2011, 8:44 PM

Post #1 of 4 (1835 views)
including XML fragments into the main xml file Can't Post

Hi all

I have a main XML file like this:


Code
   

<myxmlroot>

<myxmlproject>
<myxmlincludetype1 filename="ABC.EFG"/>
<myxmlincludetype2 filename="HIJ.KLM" attributes.../>
<myxmlbranchhead branchname="STEP1" attributes...>
<myxmlleafnode leafnodename="LFNM1" attributes.../>
etc.
<myxmlbranchhead/>
<myxmlproject/>
<myxmlroot/>



The fragments look like


Code
  

<myxmlroot>
<myxmlincludetype2 filename="NOP.QRS" attributes.../>
<myxmlbranchhead branchname="STEP3" attributes...>
<myxmlleafnode leafnodename="LFNM3" attributes.../>
etc.
<myxmlbranchhead/>
<myxmlroot/>



The myxmlincludetype1 and type2 are optional. When present they mean that the filename, which contain the fragment should be read, stripped from the myxmlroot tags and embeded in the output XML.

Could anybody please guide me where to look, it is the first time I deal with XML.

Thanks

ZA


wickedxter
User

Sep 4, 2011, 12:28 PM

Post #2 of 4 (1763 views)
Re: [zatlas1] including XML fragments into the main xml file [In reply to] Can't Post

The best thing for XML is useing of one the many modules on cpan.org


zatlas1
Novice

Sep 4, 2011, 1:42 PM

Post #3 of 4 (1758 views)
Re: [wickedxter] including XML fragments into the main xml file [In reply to] Can't Post

Hi
Thank you
I know that and I actually did a lot of research in the last 24 hours. I realized that I will have to use:
use XML::LibXSLT;
use XML::LibXML;
It is possible that I can get away with something simpler then libXML but it looks like I cannot avoid XSLT, oh well, learn yet another language! I am comfortable with Perl and use it for many text analysis projects, but this one involves XML which is news for me.
ZA


wickedxter
User

Sep 4, 2011, 1:57 PM

Post #4 of 4 (1754 views)
Re: [zatlas1] including XML fragments into the main xml file [In reply to] Can't Post

dealing with XML is like larning a new language. Modules can be complex to simple at usage so like you said some research and looking at the different modules to find the one that suits your needs and usage.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives