Skip to content
Snippets Groups Projects
Commit e066c171 authored by Richard Alam's avatar Richard Alam
Browse files

- generate xml

parent 018c2209
No related branches found
No related tags found
No related merge requests found
......@@ -70,3 +70,24 @@ val preview = extensions \ "preview"
val imagesNodes = preview \ "images"
val images = (imagesNodes \ "image") .map { n =>
val w = (n \ "@width").text
val h = (n \ "@height").text
val alt = (n \ "@alt").text
val link = (n.text)
new MetaImage(w, h, alt, link)
}
val x = new scala.xml.NodeBuffer
images foreach { im =>
x += <image width={im.width} height={im.height} alt={im.alt}>{im.link}</image>
}
val imageElem = <images>{x}</images>
println(imageElem)
case class MetaImage(width: String, height: String, alt: String, link: String)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment