Skip to content

Instantly share code, notes, and snippets.

@lg3bass
Last active December 28, 2017 19:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lg3bass/7c1b727825886b5155e70e0570acefbe to your computer and use it in GitHub Desktop.
Save lg3bass/7c1b727825886b5155e70e0570acefbe to your computer and use it in GitHub Desktop.
XSLT>XML-TREE(chrome extension) EXAMPLES
//METHOD : select nodes in the extension.
//TIP: If you hover over any of the xml nodes and click on of them you will see the xpath in the extension window.
// Next with the path in the window, Click "XPath/Parse" to the right.
// This will display all the nodes at that path.
// e.g. source: https://hssmedia.pearsoncmg.com/chapter_audio/data/hss_kagan_westernheritage_11/data.xml
// e.g. xpath : /audiobook/chapters/chapter/entry/file
// e.g. result: listing of all the mp3 files. (you may have to scroll down)
//METHOD : Use an xslt stylesheet
//XML TREE CHROME EXTENSION
https://chrome.google.com/webstore/detail/xml-tree/gbammbheopgpmaagmckhpjbfgdfkpadb?hl=en
-- process xslt right in chrome!!!
//SOURCE XML
https://mediadev.pearsoncmg.com/ph/hss/hss_stokstad_arthistory_5_myartslab/mmnd_carousel/closer_looks/data.xml
//XSLT PROCESSOR
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="audiobook">
<data>
<xsl:for-each select="chapters/chapter">
<name><xsl:value-of select="./@name"/></name>
</xsl:for-each>
</data>
</xsl:template>
</xsl:stylesheet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment