title: XSLT copy-of but change values
body: <p>I have a XML file which has non standard html elements like so:
  Note: Paragraphs have been shortend.</p>
  
  <pre><code>                 &lt;content&gt;
                        Sacrifice. It's Mass Effect 3's major theme...
                        &lt;p /&gt;
                        Mass Effect was about time and place; you d...
                        &lt;p /&gt;
                        Mass Effect 3 is focused more on plot th...
                        &lt;p /&gt;
                        &lt;img url="me3_img1.jpg"&gt;Plenty of games feat...&lt;/img&gt;
                        Like Star Wars, Mass Effect 3 is an inc...
                        &lt;p /&gt;
                        The reapers aren't your only adver...
                        &lt;p /&gt;
                        &lt;img url="me3_img2.jpg"&gt;If looks could kill..&lt;/img&gt;
                        The series' focus on player choice is as vi...
                        &lt;p /&gt;
                        This intense narrative is met wi...
                        &lt;p /&gt;
                        &lt;img url="me3_img3.jpg"&gt;The sun is sett...&lt;/img&gt;
                        These are exquis...
                   &lt;/content&gt;
  </code></pre>
  
  <p>Each  will be a gap between the paragraphs.
  Each image must appear in-between paragraphs where they apear in the content, the  must also have a caption, with the content being that between  and 
  Note also that the  has a url and not a src, so this must change.</p>
  
  <p>My current xslt only copy-of, and css fixes the layout, but img are not displaying because I can't change url to src, aswell as set the caption.</p>
  
  <p>Please help.</p>
  
  <p>Update:</p>
  
  <pre><code>&lt;xsl:for-each select='./review/content/child::*'&gt;
                            &lt;xsl:value-of select="name()"/&gt;
                            &lt;xsl:choose&gt;
                              &lt;xsl:when test="name()='p'"&gt;
                                &lt;p /&gt;
                              &lt;/xsl:when&gt;
                              &lt;xsl:when test="name()='img'"&gt;
                                &lt;div class="reviewImage"&gt;
                                  &lt;img&gt;
                                    &lt;xsl:attribute name="src"&gt;
                                      &lt;xsl:value-of select="./@url"/&gt;
                                    &lt;/xsl:attribute&gt;
                                  &lt;/img&gt;
                                  &lt;xsl:value-of select="."/&gt;
                                &lt;/div&gt;                                
                              &lt;/xsl:when&gt;
                              &lt;xsl:otherwise&gt;
                                &lt;xsl:value-of select="."/&gt;
                              &lt;/xsl:otherwise&gt;
                            &lt;/xsl:choose&gt;
                          &lt;/xsl:for-each&gt;
  </code></pre>
  
  <p>It is not outputing any of the text(). The Images and captions are sorted now though.</p>
  
  <p>Solution found:</p>
  
  <pre><code>                       &lt;xsl:for-each select='./review/content/node()'&gt;
                            &lt;xsl:choose&gt;
                              &lt;xsl:when test="name()='p'"&gt;
                                &lt;p /&gt;
                              &lt;/xsl:when&gt;
                              &lt;xsl:when test="name()='img'"&gt;
                                &lt;div class="reviewImage"&gt;
                                  &lt;img&gt;
                                    &lt;xsl:attribute name="src"&gt;
                                      &lt;xsl:value-of select="./@url"/&gt;
                                    &lt;/xsl:attribute&gt;
                                  &lt;/img&gt;
                                  &lt;xsl:value-of select="."/&gt;
                                &lt;/div&gt;                                
                              &lt;/xsl:when&gt;
                              &lt;xsl:otherwise&gt;
                                &lt;xsl:value-of select="."/&gt;
                              &lt;/xsl:otherwise&gt;
                            &lt;/xsl:choose&gt;
                          &lt;/xsl:for-each&gt;
  </code></pre>