Hi,
Totally new to XML, so my apologies for my beginner to advanced(?) questions below. I have to get up to race speed, even though I am just learning to walk. I have searched and read several articles and tutorials on the Internet to try to learn and find answers, but the amount of useful information I was able to find has been limited, or beyond my comprehension.
I have millions (not an exageration) of XML files that I need to covert to text files. A third party provides us, and their other clients, with XML files for each of customers. From my research, I found the easiest way would be by using an XSL style-sheet. Each XML could contain 10 to well over 100 different elements. Several parents, but also 3-4+ child layers deep.
Here is a sample of my XSLT.
<?xml version="1.0" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="<xsl:strip-space elements="*" />
<xsl:template match="/">
<xsl:for-each select="/TPlist/TP">
<xsl:apply-templates select="document(@file)"/>
</xsl:for-each>
</xsl:template>
<xsl:template match="Jurisdiction">Jurisdiction,
<xsl:value-of select="."/>,
</xsl:template>
This XSLT uses <xsl:template match=" code for of the 200+ elements. These elements are taken (discovered) from about 10-15 XSD files.
I created a test XML as a master XML file (from what I read on the Internet) to "apply" my XSLT to each of the million++ XML files. However, I don't know how to get that to work with my XLST.
Here is the test XML master file.
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="XSLTTest.xsl"?>
<TPlist>
<TP file="20121.xml"/>
<TP file="20122.xml"/>
</TPlist>
While this is using actual XML file names, it would be impossible to list all million++ files in this master. Is there code to have the XSLT applied to all the XML files in a folder?
Another question I have. What is the code for XSLT to transform to text? I found various sites trasnforming to XHTML, HTML, PDF, etc. But no text.
Last question. After I created the XSLT and added this code "<?xml-stylesheet type="text/xsl" href="XSLTTest.xsl"?>" to my two test XML files "20121.xml" and "20122.xml" and double clicked one of the XML files it opens up Internet Explorer. Is there a software that I need to install (or is it already on my PC) that will open up XML? Also, once/if I get the text transform working in my XSLT, where will the ouptut be?
Thanks and God Bless, Genesius
Totally new to XML, so my apologies for my beginner to advanced(?) questions below. I have to get up to race speed, even though I am just learning to walk. I have searched and read several articles and tutorials on the Internet to try to learn and find answers, but the amount of useful information I was able to find has been limited, or beyond my comprehension.
I have millions (not an exageration) of XML files that I need to covert to text files. A third party provides us, and their other clients, with XML files for each of customers. From my research, I found the easiest way would be by using an XSL style-sheet. Each XML could contain 10 to well over 100 different elements. Several parents, but also 3-4+ child layers deep.
Here is a sample of my XSLT.
<?xml version="1.0" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="<xsl:strip-space elements="*" />
<xsl:template match="/">
<xsl:for-each select="/TPlist/TP">
<xsl:apply-templates select="document(@file)"/>
</xsl:for-each>
</xsl:template>
<xsl:template match="Jurisdiction">Jurisdiction,
<xsl:value-of select="."/>,
</xsl:template>
This XSLT uses <xsl:template match=" code for of the 200+ elements. These elements are taken (discovered) from about 10-15 XSD files.
I created a test XML as a master XML file (from what I read on the Internet) to "apply" my XSLT to each of the million++ XML files. However, I don't know how to get that to work with my XLST.
Here is the test XML master file.
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="XSLTTest.xsl"?>
<TPlist>
<TP file="20121.xml"/>
<TP file="20122.xml"/>
</TPlist>
While this is using actual XML file names, it would be impossible to list all million++ files in this master. Is there code to have the XSLT applied to all the XML files in a folder?
Another question I have. What is the code for XSLT to transform to text? I found various sites trasnforming to XHTML, HTML, PDF, etc. But no text.
Last question. After I created the XSLT and added this code "<?xml-stylesheet type="text/xsl" href="XSLTTest.xsl"?>" to my two test XML files "20121.xml" and "20122.xml" and double clicked one of the XML files it opens up Internet Explorer. Is there a software that I need to install (or is it already on my PC) that will open up XML? Also, once/if I get the text transform working in my XSLT, where will the ouptut be?
Thanks and God Bless, Genesius