Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Open Source > Perl
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Perl section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 28th, 2010, 06:16 AM
Authorized User
 
Join Date: Nov 2010
Posts: 50
Thanks: 0
Thanked 1 Time in 1 Post
Default how to propagete text.

Hi,

We need to propagate some element. Here i have pasted input and output file for your reference.

Instruction:

1. If "</HR-CP><HR-CP>" occurs then <DE> and <OR> tags are copied within the HR-CP closing and opening.

2. In case <OR> Tag placed in between </HR-CP> and <HR-CP> then we have to use <DE>

3. if morethan one <DE> comes in xml we have to use the second <DE> propagate on </HR-CP> and <HR-CP>

For your reference please see below sample:

Input File:
<HR>
<DE>[]FIRST DESCRIPTOR[]</DE>
<OR>&amp;rtrif; 64.451</OR>
<OR>&amp;rtrif; 64.452</OR>
<OR>&amp;rtrif; 64.458</OR>
<HR-CP>In passing upon petitions to sever craft or departmental not limited to the following:</HR-CP>
<HR-CP>(1) Whether proposed unit consists of distinct and homogeneous group of separate representation exists</HR-CP>
<OR>&amp;rtrif; 64.457</OR>
<HR-CP>(2) History of collective bargaining of stable labor relations and whether such stability will be unduly disrupted by severance.</HR-CP>
<OR>&amp;rtrif; 64.457</OR>
<HR-CP>(3) Extent to which employees sought have established and obtain separate representation</HR-CP>
<OR>&amp;rtrif; 64.457</OR>
<HR-CP>(4) History and pattern of collective bargaining in industry involved</HR-CP>
<OR>&amp;rtrif; 64.453</OR>
<HR-CP>(5) Degree of integration of employer&lt;A1&gt;s production processes, employees in proposed unit</HR-CP>
<OR>&amp;rtrif; 64.458</OR>
<HR-CP>(6) Qualifications of union seeking to action</HR-CP>
<OR>&amp;rtrif; 64.451</OR>
<OR>&amp;rtrif; 64.452</OR>
<OR>&amp;rtrif; 64.453</OR>
<OR>&amp;rtrif; 64.458</OR>
<HR-CP>In passing upon petitions to sever </HR-CP>
<DE>[]SECOND DESCRIPTOR[]</DE>
<OR>&amp;rtrif; 64.453</OR>
<OR>&amp;rtrif; 64.5312</OR>
<OR>&amp;rtrif; 65.54</OR>
<HR-CP>Unit of instrument mechanics may not be carv</HR-CP>
<HR-CP>Second test text</HR-CP>
</HR>

Outputfile:
<HEADNOTE>
<DESCRIPTOR>FIRST DESCRIPTOR</DESCRIPTOR>
<OUTLINE.REF REF="64.451">&rtrif;64.451</OUTLINE.REF>
<OUTLINE.REF REF="64.452">&rtrif;64.452</OUTLINE.REF>
<OUTLINE.REF REF="64.458">&rtrif;64.458</OUTLINE.REF>
<PARA>In passing upon petitions to sever craft or departmental not limited to the following:</PARA>
</HEADNOTE>
<HEADNOTE>
<DESCRIPTOR>FIRST DESCRIPTOR</DESCRIPTOR>
<OUTLINE.REF REF="64.451">&rtrif;64.451</OUTLINE.REF>
<OUTLINE.REF REF="64.452">&rtrif;64.452</OUTLINE.REF>
<OUTLINE.REF REF="64.458">&rtrif;64.458</OUTLINE.REF>
<PARA>(1) Whether proposed unit consists of distinct and homogeneous group of separate representation exists</PARA>
</HEADNOTE>
<HEADNOTE>
<DESCRIPTOR>FIRST DESCRIPTOR</DESCRIPTOR>
<OUTLINE.REF REF="64.457">&rtrif;64.457</OUTLINE.REF>
<PARA>(2) History of collective bargaining of stable labor relations and whether such stability will be unduly disrupted by severance.</PARA>
</HEADNOTE>
<HEADNOTE>
<DESCRIPTOR>FIRST DESCRIPTOR</DESCRIPTOR>
<OUTLINE.REF REF="64.457">&rtrif;64.457</OUTLINE.REF>
<PARA>(3) Extent to which employees sought have established and obtain separate representation</PARA>
</HEADNOTE>
<HEADNOTE>
<DESCRIPTOR>FIRST DESCRIPTOR</DESCRIPTOR>
<OUTLINE.REF REF="64.457">&rtrif;64.457</OUTLINE.REF>
<PARA>(4) History and pattern of collective bargaining in industry involved</PARA>
</HEADNOTE>
<HEADNOTE>
<DESCRIPTOR>FIRST DESCRIPTOR</DESCRIPTOR>
<OUTLINE.REF REF="64.453">&rtrif;64.453</OUTLINE.REF>
<PARA>(5) Degree of integration of employer&lt;A1&gt;s production processes, employees in proposed unit</PARA>
</HEADNOTE>
<HEADNOTE>
<DESCRIPTOR>FIRST DESCRIPTOR</DESCRIPTOR>
<OUTLINE.REF REF="64.458">&rtrif;64.458</OUTLINE.REF>
<PARA>(6) Qualifications of union seeking to action</PARA>
</HEADNOTE>
<HEADNOTE>
<DESCRIPTOR>FIRST DESCRIPTOR</DESCRIPTOR>
<OUTLINE.REF REF="64.451">&rtrif;64.451</OUTLINE.REF>
<OUTLINE.REF REF="64.452">&rtrif;64.452</OUTLINE.REF>
<OUTLINE.REF REF="64.453">&rtrif;64.453</OUTLINE.REF>
<PARA>In passing upon petitions to sever</>
</HEADNOTE>
<HEADNOTE>
<DESCRIPTOR>SECOND DESCRIPTOR</DESCRIPTOR>
<OUTLINE.REF REF="64.453">&rtrif;64.453</OUTLINE.REF>
<OUTLINE.REF REF="64.5312">&rtrif;64.5312</OUTLINE.REF>
<OUTLINE.REF REF="65.54">&rtrif;65.54</OUTLINE.REF>
<PARA>Unit of instrument mechanics may not be carv</PARA>
</HEADNOTE>
<HEADNOTE>
<DESCRIPTOR>SECOND DESCRIPTOR</DESCRIPTOR>
<OUTLINE.REF REF="64.453">&rtrif;64.453</OUTLINE.REF>
<OUTLINE.REF REF="64.5312">&rtrif;64.5312</OUTLINE.REF>
<OUTLINE.REF REF="65.54">&rtrif;65.54</OUTLINE.REF>
<PARA>Second test text</PARA>
</HEADNOTE>
 
Old December 28th, 2010, 02:22 PM
Authorized User
 
Join Date: Aug 2009
Posts: 23
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Your rules are not clear, but you should start with XML parser, for example XML::Smart or XML::LibXML.





Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP+Curl, Sending Post request to update text inside a text area Dotnetnuke .ASPX webspace969 ASP.NET 4 General Discussion 1 October 10th, 2010 03:15 PM
Convert Text(Sql Server Text Field) to Image(JPG) srinivas72 ADO.NET 2 February 13th, 2009 06:31 PM
Text Box .text Property Displays conflicting Valus JPOhlman Visual Basic 2005 Basics 3 August 23rd, 2006 02:39 PM
Extract text from text file & put in dropdown box tsukey Beginning PHP 5 July 20th, 2004 09:49 PM
Ch3, P.76 - text.html/text.php not working Hostile BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 4 May 15th, 2004 11:09 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.