63 questions
0
votes
0
answers
53
views
What happened to the use of PCData when parsing XML in Scala3?
I'm using version 2.3.0 of the XML parser but there seems to be a difference between the Scala2 version and the Scala3 version.
In particular, CDATA constructs in the XML do not appear to be converted ...
0
votes
1
answer
502
views
How to generate case class with annotation using ScalaXB
I am using the ScalaXB plugin to convert XSD files to Scala case classes and it is working fine but is there any way to add javax.xml.bind.annotation with it?
The reason I need is to marshal/unmarshal ...
0
votes
1
answer
46
views
scala.xml.Node reporting non-access
I am currently processing big XML files using Scala 3. I wish every node (XML element) to report automatically if not all their attributes and children were read. I have developed a solution, but feel ...
0
votes
1
answer
106
views
Suspicious Shadowing by a Type Parameter while defining Scala 3 Type Class
I'm trying to implement some small quality-of-life improvements around an XML parser, basically trying to ape the way Circe looks like for Json parsing in Scala.
The idea then would be to come up with ...
0
votes
1
answer
129
views
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 := "...
1
vote
0
answers
104
views
Change dependency version number in pom.xml using scala-xml
I want to use scala-xml to change the version number of one dependency in a bunch of pom.xml files. I know this is normally not the best way to approach such a task but in my use case I think it is.
...
1
vote
1
answer
142
views
NullPointerException on XML.loadFile()
I am trying to load an xml file using scala-xml_2.12-1.0.6.jar but it gives me NullPointerEexception while loading
Following is my line of code to load xml
import scala.xml.XML
val xml = XML.loadFile(&...
0
votes
1
answer
881
views
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
<annotation>
<folder>home</...
0
votes
1
answer
106
views
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 ...
1
vote
1
answer
470
views
scala-xml for Scala 2.13 on Debian and Ubuntu
In order to make them fully JVM 11 compatible, I want to update several Scala scripts on Debian and Ubuntu systems from Scala 2.12.12 to Scala 2.13.3.
The first problem I encountered is that the scala-...
0
votes
1
answer
610
views
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....
3
votes
1
answer
147
views
Scala how to retrieve xml tag with optional attribute
I am trying to get scala xml node tag with attribute. I would like to get just the tag name with attribute and not the child elements.
I have this input:
<substance-classes>
<nucleic-...
2
votes
2
answers
363
views
Scala XML pattern matching, top level element
Consider the following XML node:
<Interval>
<P v="1"/>
<Q v="0.0"/>
</Interval>
What is the correct way to pattern match the top level element in Scala? I would ...
3
votes
3
answers
181
views
Why I cannot filter on this condition on reading xml and filter
I have a sample code
import org.apache.spark.sql.Row
import scala.xml._
object reading_xml {
def main(args: Array[String]): Unit = {
//I have 42 Millions of records
val records = List(
...
-1
votes
1
answer
153
views
Write List of Map data into csv
val rdd = df.rdd.map(line => Row.fromSeq((
scala.xml.XML.loadString("<?xml version='1.0' encoding='utf-8'?>" + line(1)).child
.filter(elem =>
elem.label == "...