Last active
December 19, 2015 14:39
-
-
Save craibuc/5970414 to your computer and use it in GitHub Desktop.
Convert HTML table at http://epic.usergroup.healthitsocial.com/page/epic-hospitals to XML using a YQL query with this XSLT.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> | |
| <xsl:template match="//table[@width='623']"> | |
| <locations> | |
| <xsl:apply-templates select="descendant::tr" /> | |
| </locations> | |
| </xsl:template> | |
| <xsl:template match="//tr"> | |
| <location> | |
| <xsl:attribute name='name'> | |
| <xsl:value-of select="td[1]/p" /> | |
| </xsl:attribute> | |
| <xsl:attribute name='city'> | |
| <xsl:value-of select="td[2]/p" /> | |
| </xsl:attribute> | |
| <xsl:attribute name='region'> | |
| <xsl:value-of select="td[3]/p" /> | |
| </xsl:attribute> | |
| </location> | |
| </xsl:template> | |
| </xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment