Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^6: Is there a module for object-oriented substring handling/substitution?

by smls (Friar)
on Jan 26, 2013 at 22:38 UTC ( #1015539=note: print w/ replies, xml ) Need Help??


in reply to Re^5: Is there a module for object-oriented substring handling/substitution?
in thread Is there a module for object-oriented substring handling/substitution?

But then I could not guarantee that the output is exactly the same as the input outside of the specific values being updated.

DOM-tree<-->wiki-syntax is a one-to-many relationship, for example each of the following is a valid wiki-syntax representation of a table row containing 3 cells with the contents A, B, and C:

|- | A || B || C

|- | A | B | C

<tr> <td>A</td> <td>B</td> <td>C</td> </tr>

Also, I doubt that writing a full-blown parser and serializer would result in less work and less code than a regex-based solutions supported by linked substrings.


Comment on Re^6: Is there a module for object-oriented substring handling/substitution?
Select or Download Code
Re^7: Is there a module for object-oriented substring handling/substitution?
by Anonymous Monk on Jan 28, 2013 at 09:28 UTC

    But then I could not guarantee that the output is exactly the same as the input outside of the specific values being updated.

    :) Sure you could. While HTML DOM doesn't guarantee same representation, there is no reason your DOM couldn't -- hey, if PPI can do it, you can too :) whitespace can be significant if you make it so

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1015539]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2015-07-04 22:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls