<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How do we pass the row tags dynamically while reading a XML file into a dataframe? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-do-we-pass-the-row-tags-dynamically-while-reading-a-xml-file/m-p/28911#M20676</link>
    <description>&lt;P&gt;I have a set of xml files where the row tags change dynamically. How can we achieve this scenario in databricks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;df1=spark.read.format('xml').option('rootTag','XRoot').option('rowTag','PL1PLLL').load("dbfs:/FileStore/tables/ins/")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We need to pass a value dynamically in place of PL1PLLL &lt;B&gt;option('rowTag','PL1PLLL') &lt;/B&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Oct 2022 11:34:37 GMT</pubDate>
    <dc:creator>Stita</dc:creator>
    <dc:date>2022-10-06T11:34:37Z</dc:date>
    <item>
      <title>How do we pass the row tags dynamically while reading a XML file into a dataframe?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-do-we-pass-the-row-tags-dynamically-while-reading-a-xml-file/m-p/28911#M20676</link>
      <description>&lt;P&gt;I have a set of xml files where the row tags change dynamically. How can we achieve this scenario in databricks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;df1=spark.read.format('xml').option('rootTag','XRoot').option('rowTag','PL1PLLL').load("dbfs:/FileStore/tables/ins/")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We need to pass a value dynamically in place of PL1PLLL &lt;B&gt;option('rowTag','PL1PLLL') &lt;/B&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 11:34:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-do-we-pass-the-row-tags-dynamically-while-reading-a-xml-file/m-p/28911#M20676</guid>
      <dc:creator>Stita</dc:creator>
      <dc:date>2022-10-06T11:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do we pass the row tags dynamically while reading a XML file into a dataframe?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-do-we-pass-the-row-tags-dynamically-while-reading-a-xml-file/m-p/28914#M20679</link>
      <description>&lt;P&gt;If it is dynamically for the whole file, you can just use variable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;tag = 'PL1PLLL'
df1=spark.read.format('xml').option('rootTag','XRoot').option('rowTag' ,tag).load("dbfs:/FileStore/tables/ins/file.xml")&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Oct 2022 11:42:33 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-do-we-pass-the-row-tags-dynamically-while-reading-a-xml-file/m-p/28914#M20679</guid>
      <dc:creator>Hubert-Dudek</dc:creator>
      <dc:date>2022-10-14T11:42:33Z</dc:date>
    </item>
  </channel>
</rss>

