Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Open Source > Perl
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 28th, 2010, 06:16 AM
Authorized User
Points: 234, Level: 4
Points: 234, Level: 4 Points: 234, Level: 4 Points: 234, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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>
Reply With Quote
  #2 (permalink)  
Old December 28th, 2010, 02:22 PM
Authorized User
Points: 93, Level: 1
Points: 93, Level: 1 Points: 93, Level: 1 Points: 93, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2009
Location: Moldova
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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 01:13 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.