Closed avinashpandu closed 6 months ago
I don't think either of those are problems. An extra newline has no meaning between tags, and, you don't need to escape close tags as they are not opened.
Both of these behaviors are not from this library, but from the standard javax.xml.stream writer.
This library is not maintained anymore either, being part of Spark now.
Thank you. Regarding Issue 2, there is an open < tag and it got converted to < ; the same is not happening for >. why is that ?
I presume because there is no need to escape a close tag if there is no open tag. You can see the code in StaxXmlGenerator that just uses the JDK's XML writer to do all this, so this is behavior of the standard library, I assume. https://github.com/databricks/spark-xml/blob/3b40ef48bce114fa9f1f4d96ae500d74dac0ea91/src/main/scala/com/databricks/spark/xml/parsers/StaxXmlGenerator.scala#L22
What is the issue?
I understand your comment Sean. Thank you!
But the string is as follows :
Gregory
Why? But, again: this would be behavior of the standard JDK writer. I don't know if it's controllable. If it is, you'd have to open a PR against Spark, not this library. But I don't know if there is a reason to do this.
Hi, When writing the following dataframe to XML , I am seeing new blank lines inserting in between the ROWS. +--------------------+--------------------+--------------+----------+----------+--------------+------+----------+-------------+--------------------+------------------+------------------+ |PORTFOLIO_MANAGER_ID|EFFECTIVE_START_DATE|DATA_SOURCE_ID| LAST_NAME|FIRST_NAME|MIDDLE_INITIAL|SUFFIX|SHORT_NAME|QUALIFICATION| BIOGRAPHY|SOURCE_SYSTEM_CODE|EFFECTIVE_END_DATE| +--------------------+--------------------+--------------+----------+----------+--------------+------+----------+-------------+--------------------+------------------+------------------+ | 10247| 2019-09-30| 100| McPherson| Heather| null| null| null| null|  ...| MA_1066| 9999-12-31| | 4574| 2018-08-31| 100| Mordy| James| N.| null| null| null|
~~~~~~<di...| MA_68| 9999-12-31| | 4249| 2018-08-31| 100|Lakonishok| Dr. Josef| null| null| null| null|■ <stron...| MA_209| 9999-12-31| +--------------------+--------------------+--------------+----------+----------+--------------+------+----------+-------------+--------------------+------------------+------------------+ XML
Issue1
Blank Empty Line created between Row Tags-
Issue 2 < is getting converted to < ; & is getting converted to & ; But, XML Writer is not converting > to ">"; ( please refer the BIOGRAPHY tag )
Can you please help me understand this? Thank you!