Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Can Someone Help Me Convert This XML with Regex to look like THIS?

    Hey everyone, so I have a homework assignment to convert XML with Regex.

    Convert This: The Project Gutenberg E-text of The Sonnets, by William Shakespeare

    To This: http://dh.obdurodon.org/shakespeare-sonnets.xml

  • #2
    New to the CF scene
    Join Date
    Oct 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I need to know the step by step processes you did so i can learn this and write it as a report.

  • #3
    New to the CF scene
    Join Date
    Oct 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I need to know the step by step processes you did so i can learn this and write it as a report.

    It should look like this: <sonnets>
    <sonnet number="I">
    <line>From fairest creatures we desire increase,</line>
    <line>That thereby beauty's rose might never die,</line>
    <line>But as the riper should by time decease,</line>
    <line>His tender heir might bear his memory:</line>
    <line>But thou contracted to thine own bright eyes,</line>
    <line>
    Feed'st thy light's flame with self-substantial fuel,
    </line>
    <line>Making a famine where abundance lies,</line>
    <line>Thy self thy foe, to thy sweet self too cruel:</line>
    <line>Thou that art now the world's fresh ornament,</line>
    <line>And only herald to the gaudy spring,</line>
    <line>Within thine own bud buriest thy content,</line>
    <line>And tender churl mak'st waste in niggarding:</line>
    <line>Pity the world, or else this glutton be,</line>
    <line>To eat the world's due, by the grave and thee.</line>
    </sonnet>
    <sonnet number="II">
    <line>When forty winters shall besiege thy brow,</line>
    <line>And dig deep trenches in thy beauty's field,</line>
    <line>Thy youth's proud livery so gazed on now,</line>
    <line>Will be a tatter'd weed of small worth held:</line>
    <line>Then being asked, where all thy beauty lies,</line>
    <line>Where all the treasure of thy lusty days;</line>
    <line>To say, within thine own deep sunken eyes,</line>
    <line>Were an all-eating shame, and thriftless praise.</line>
    <line>How much more praise deserv'd thy beauty's use,</line>
    <line>If thou couldst answer 'This fair child of mine</line>
    <line>Shall sum my count, and make my old excuse,'</line>
    <line>Proving his beauty by succession thine!</line>
    <line>This were to be new made when thou art old,</line>
    <line>And see thy blood warm when thou feel'st it cold.</line>
    </sonnet>
    <sonnet number="III">
    <line>Look in thy glass and tell the face thou viewest</line>
    <line>Now is the time that face should form another;</line>
    <line>Whose fresh repair if now thou not renewest,</line>
    <line>Thou dost beguile the world, unbless some mother.</line>
    <line>For where is she so fair whose unear'd womb</line>
    <line>Disdains the tillage of thy husbandry?</line>
    <line>Or who is he so fond will be the tomb,</line>
    <line>Of his self-love to stop posterity?</line>
    <line>Thou art thy mother's glass and she in thee</line>
    <line>Calls back the lovely April of her prime;</line>
    <line>So thou through windows of thine age shalt see,</line>
    <line>Despite of wrinkles this thy golden time.</line>
    <line>But if thou live, remember'd not to be,</line>
    <line>Die single and thine image dies with thee.</line>
    </sonnet>
    <sonnet number="IV">
    <line>Unthrifty loveliness, why dost thou spend</line>
    <line>Upon thy self thy beauty's legacy?</line>
    <line>Nature's bequest gives nothing, but doth lend,</line>
    <line>And being frank she lends to those are free:</line>
    <line>Then, beauteous niggard, why dost thou abuse</line>
    <line>The bounteous largess given thee to give?</line>
    <line>Profitless usurer, why dost thou use</line>
    <line>So great a sum of sums, yet canst not live?</line>
    <line>For having traffic with thy self alone,</line>
    <line>Thou of thy self thy sweet self dost deceive:</line>
    <line>Then how when nature calls thee to be gone,</line>
    <line>What acceptable audit canst thou leave?</line>
    <line>Thy unused beauty must be tombed with thee,</line>
    <line>Which, used, lives th' executor to be.</line>
    </sonnet>
    <sonnet number="V">
    <line>Those hours, that with gentle work did frame</line>
    <line>The lovely gaze where every eye doth dwell,</line>
    <line>Will play the tyrants to the very same</line>
    <line>And that unfair which fairly doth excel;</line>
    <line>For never-resting time leads summer on</line>
    <line>To hideous winter, and confounds him there;</line>
    <line>
    Sap checked with frost, and lusty leaves quite gone,
    </line>


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •