Hi,
I figured really small examples work better than big complicated ones for us just starting out. Trying to learn how to "transform?" the first XML document (Example 1 - baseball.xml) so that it ends us as an XML file that looks like this coding below. I have several tables in MS Access that pretty well follow the same structure below....just need to see how this small example works (or links that explain how this works for us new persons to XML).
Hope this makes sense.....obviously I have a long ways to go to understand XML and XSL.
Jerry
END RESULT - baseballtransformed.xml
<?xml version="1.0" encoding="UTF-8" ?>
<dataroot xmlnsd="urn:schemas-microsoft-comfficedata" generated="2009-11-20T08:22:04">
<baseball>
<player>
<1 name="George" team="Detroit" other=""/>
<2 name="Roger" team="Chicago" other=""/>
<3 name="Will" team="Chicago" other="Out Sick"/>
<4 name="Joe" team="Detroit" other="Left Handed"/>
</player>
</baseball>
</dataroot>
NOTE: When I click on my Example 1 baseball.xml file, I see the following in my webbrowser:
< 1 name="George" team="1" other="" /> < 2 name="Roger" team="2" other="" />< 3 name="Will" team="2" other="Out Sick" />< 4 name="Joe" team="1" other="Left Handed" />
----------------------------------------------------
EXAMPLE 1 - baseball.xml
<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="baseball.xsl"?>
<dataroot xmlnsd="urn:schemas-microsoft-comfficedata" generated="2009-11-20T08:22:04">
<baseball>
<player>
<id>1</id>
<name>George</name>
<team>1</team>
<other />
</player>
<player>
<id>2</id>
<name>Roger</name>
<team>2</team>
<other />
</player>
<player>
<id>3</id>
<name>Will</name>
<team>2</team>
<other>Out Sick</other>
</player>
<player>
<id>4</id>
<name>Joe</name>
<team>1</team>
<other>Left Handed</other>
</player>
<team>
<id>1</id>
<name>Detroit</name>
</team>
<team>
<id>2</id>
<name>Chicago</name>
</team>
</baseball>
</dataroot>
EXAMPLE 2 - baseball.xsl
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="<xsl:template match="/">
<baseball>
<player>
<xsl:for-each select="baseball/player">
<<xsl:value-of select="id"/> name="<xsl:value-of select="name"/>" team="<xsl:value-of select="team"/>" other="<xsl:value-of select="other"/>"/>
</xsl:for-each>
</player>
</baseball>
</xsl:template>
</xsl:stylesheet>
I figured really small examples work better than big complicated ones for us just starting out. Trying to learn how to "transform?" the first XML document (Example 1 - baseball.xml) so that it ends us as an XML file that looks like this coding below. I have several tables in MS Access that pretty well follow the same structure below....just need to see how this small example works (or links that explain how this works for us new persons to XML).
Hope this makes sense.....obviously I have a long ways to go to understand XML and XSL.
Jerry
END RESULT - baseballtransformed.xml
<?xml version="1.0" encoding="UTF-8" ?>
<dataroot xmlnsd="urn:schemas-microsoft-comfficedata" generated="2009-11-20T08:22:04">
<baseball>
<player>
<1 name="George" team="Detroit" other=""/>
<2 name="Roger" team="Chicago" other=""/>
<3 name="Will" team="Chicago" other="Out Sick"/>
<4 name="Joe" team="Detroit" other="Left Handed"/>
</player>
</baseball>
</dataroot>
NOTE: When I click on my Example 1 baseball.xml file, I see the following in my webbrowser:
< 1 name="George" team="1" other="" /> < 2 name="Roger" team="2" other="" />< 3 name="Will" team="2" other="Out Sick" />< 4 name="Joe" team="1" other="Left Handed" />
----------------------------------------------------
EXAMPLE 1 - baseball.xml
<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="baseball.xsl"?>
<dataroot xmlnsd="urn:schemas-microsoft-comfficedata" generated="2009-11-20T08:22:04">
<baseball>
<player>
<id>1</id>
<name>George</name>
<team>1</team>
<other />
</player>
<player>
<id>2</id>
<name>Roger</name>
<team>2</team>
<other />
</player>
<player>
<id>3</id>
<name>Will</name>
<team>2</team>
<other>Out Sick</other>
</player>
<player>
<id>4</id>
<name>Joe</name>
<team>1</team>
<other>Left Handed</other>
</player>
<team>
<id>1</id>
<name>Detroit</name>
</team>
<team>
<id>2</id>
<name>Chicago</name>
</team>
</baseball>
</dataroot>
EXAMPLE 2 - baseball.xsl
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="<xsl:template match="/">
<baseball>
<player>
<xsl:for-each select="baseball/player">
<<xsl:value-of select="id"/> name="<xsl:value-of select="name"/>" team="<xsl:value-of select="team"/>" other="<xsl:value-of select="other"/>"/>
</xsl:for-each>
</player>
</baseball>
</xsl:template>
</xsl:stylesheet>