Questions tagged [scala-xml]

Scala XML is the standard XML library built for Scala.

Scala XML is the standard XML library built for Scala. It provides options for working with XML documents - parsing, processing, building, manipulating and navigating within, and others. Since Scala version 2.11, the Scala XML is a separate, independent library.

63 questions
0
votes
1 answer

Unable to run compiled scala project wither with scala or java "classNotFoundException: scala.xml.XML"

I created a project with sbt new scala/scala3.g8 This is my modified build.sbt val scala3Version = "3.2.1" lazy val root = project .in(file(".")) .settings( name := "bloomberg-clone", version := "0.1.0-SNAPSHOT", scalaVersion :=…
Rauññ
  • 378
  • 3
  • 17
0
votes
1 answer

How do I parse XML with repetetive tags in Scala, xtract library?

I have the following problem: I'm using [xtract][1], a Scala library for parsing XMLs. The latest version, 2.0.0 I'm trying to parse an XML file like this home source
Alexander
  • 15
  • 1
  • 4
0
votes
1 answer

Scala XML Elem Not Showing Up

I have a class where I want a conditional Elem in xml to be added, but I am unable to do this. Please help. The ShortName block is supposed to be conditional. While debugging I see that get shortname gets executed. In fact if I try wrapping that in…
Koustav Ray
  • 1,112
  • 13
  • 26
0
votes
1 answer

ClassNotFoundException in scala-xml with Scala 2.13

I have been using scala-xml successfully for a long time on Linux. I recently upgraded to Scala 2.13.0 and scala-xml 1.2.0. I am using sbt 1.2.8 with this line: libraryDependencies += "org.scala-lang.modules" %% "scala-xml" % "1.2.0" It compiles,…
Russ P.
  • 47
  • 5
0
votes
2 answers

Function calls for dynamic XML in Scala

Let's say I have the following code: import scala.xml._ def foo(bar:String) = s"The FOO is $bar" var xml = {foo("text node")} val txt = "{foo(\"updated\")}" XML.loadString(txt) That…
vnfedotov
  • 21
  • 4
0
votes
3 answers

Scala convert XML to key value map

Related to This topic Problem is as follows, imagine an XML without any particular schema 2 john Snow female
Sparky
  • 717
  • 1
  • 7
  • 17
0
votes
1 answer

error: object xml is not a member of package com.databricks.spark

I am trying to read XML file using SBT but i am facing issue when i compile it. build.sbt name:= "First Spark" version:= "1.0" organization := "in.goai" scalaVersion := "2.11.8" libraryDependencies += "org.apache.spark" %% "spark-core" %…
user8510536
0
votes
1 answer

Error running introductory example of scala-xml

I'm trying to run the simple example provided on the README of scala-xml, but the code won't run: import org.apache.spark.sql.SQLContext val sqlContext = new SQLContext(sc) val df = sqlContext.read .format("com.databricks.spark.xml") …
MichaelChirico
  • 33,841
  • 14
  • 113
  • 198
0
votes
0 answers

What is easiest way of changing XML at given XPath in scala?

val template = 555
An Illusion
  • 769
  • 1
  • 10
  • 24
0
votes
1 answer

Modifying xml contents scala

I have a problem similar to Scala - modifying nested elements in xml I have reproduced the same code in this post. I am trying to modify content in an element and I have to call a function to get the content. For eg. object test extends App { …
user3044440
  • 115
  • 9
0
votes
1 answer

Scala Xml Parsing: How to get Node with a attribute excluding subnode

I have a xml as follows:
Alok
  • 1,374
  • 3
  • 18
  • 44
0
votes
1 answer

Scala XML Html like split at
?

Hello currently given the following string: HeadlineLine 1
Line 2
Line 3
Line 4
Line 5
How could I extract the text so that I get: Headline Line 1 Line 2 ... Currently the biggest problem for me is that Scala…
Christian Schmitt
  • 837
  • 16
  • 47
0
votes
1 answer

Parsing xml with scala

I'm trying to parse the xml response from AWIS(alexa rest apis from amazon) api's with scala.xml.XML without any success. XML Response:
user773366
0
votes
2 answers

Scala XML attribute replacement results in appending modified node as a child

Im trying to write an XML parsing utility that allows a user to modify an XML attribute through providing an attribute name, the current attribute value and the new value they would like the attribute to have. Here is my code: def main (args:…
Zee
  • 1,321
  • 2
  • 18
  • 41
0
votes
1 answer

Can I tell scala.xml to match any of two tags?

body \\ "div" matches the "div" tags, and body \\ "p" matches the "p" tags. But what if I'd like to match all the "div" and "p" tags? Is it possible with one expression in scala.xml? And if not, is there another way to iterate over all the "div" and…
Ilya Kogan
  • 21,995
  • 15
  • 85
  • 141