{"id":27398098,"url":"https://github.com/bernardodiasc/xslt","last_synced_at":"2026-01-23T02:38:52.137Z","repository":{"id":31146016,"uuid":"34705868","full_name":"bernardodiasc/xslt","owner":"bernardodiasc","description":"XSLT Components Showcase [tutorial]","archived":false,"fork":false,"pushed_at":"2015-04-30T00:25:07.000Z","size":150,"stargazers_count":2,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"gh-pages","last_synced_at":"2025-04-14T01:33:45.514Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://bernardodiasc.github.io/xslt/","language":"XSLT","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bernardodiasc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-28T03:24:06.000Z","updated_at":"2016-06-19T02:48:00.000Z","dependencies_parsed_at":"2022-08-27T09:11:51.182Z","dependency_job_id":null,"html_url":"https://github.com/bernardodiasc/xslt","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bernardodiasc/xslt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernardodiasc%2Fxslt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernardodiasc%2Fxslt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernardodiasc%2Fxslt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernardodiasc%2Fxslt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bernardodiasc","download_url":"https://codeload.github.com/bernardodiasc/xslt/tar.gz/refs/heads/gh-pages","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernardodiasc%2Fxslt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28679137,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T01:00:35.747Z","status":"online","status_checked_at":"2026-01-23T02:00:08.296Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-14T01:29:13.138Z","updated_at":"2026-01-23T02:38:52.124Z","avatar_url":"https://github.com/bernardodiasc.png","language":"XSLT","funding_links":[],"categories":[],"sub_categories":[],"readme":"# XSLT Demonstration\n\n- Setup: don't need! just open the xml in your browser! :D\n- Preview: [http://bernardodiasc.github.io/xslt/](http://bernardodiasc.github.io/xslt/)\n\n\u003e Make sure to check the source code of the preview page - it's **XML**\n\n## Templates\n\nIn this demonstration only have the `navigation` component ([/templates/navigation/index.xsl](https://github.com/bernardodiasc/xslt/blob/gh-pages/templates/navigation/index.xsl)). There is 2 templates for the same matched data, one called `simple` and the other `complex`. The `model-name` is used here to represent a data source.\n\n### Navigation mode simple\n\nThe mode `simple` copy the matched xml nodes as html. This is ok since XHTML is XML.\n\n- Match: `data/module[@name='navigation']`\n- Mode: simple \n- Usage:\n\n```xml\n\u003cxsl:apply-templates select=\"/data/module[@name='navigation' and @model='model-name']\" mode=\"simple\"/\u003e`\n```\n\n- Sample XML:\n\n```xml\n\u003c!-- Example of pure HTML data --\u003e\n\u003cmodule name=\"navigation\" model=\"model-name\"\u003e\n  \u003cnav\u003e\n    \u003ch2\u003eNavigation\u003c/h2\u003e\n    \u003cul\u003e\n      \u003cli\u003e\u003ca href=\"#about-us\"\u003eAbout us\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"#team\"\u003eTeam\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"#projects\"\u003eProjects\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"#contacts\"\u003eContacts\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003ca href=\"#partners\"\u003ePartners\u003c/a\u003e\u003c/li\u003e\n    \u003c/ul\u003e\n  \u003c/nav\u003e\n\u003c/module\u003e\n```\n\n- XSLT Template:\n\n```xml\n\u003cxsl:template match=\"data/module[@name='navigation']\" mode=\"simple\"\u003e\n  \u003cxsl:copy-of select=\"current()/*\"/\u003e\n\u003c/xsl:template\u003e\n```\n\n### Navigation mode complex\n\nThe mode `complex` iterate the matched xml nodes and build the markup with an alternative markup structure.\n\nIn this case the markup resulted is intentionaly the same of simple mode markup. The structured data is parsed to build the html.\n\n- Match: `data/module[@name='navigation']`\n- Mode: complex\n- Usage:\n\n```xml\n\u003cxsl:apply-templates select=\"/data/module[@name='navigation' and @model='model-name']\" mode=\"complex\"/\u003e\n```\n\n- Sample XML:\n\n```xml\n\u003c!-- Example of structured content --\u003e\n\u003cmodule name=\"navigation\" model=\"model-name\"\u003e\n  \u003cheading\u003eNavigation\u003c/heading\u003e\n  \u003clist\u003e\n    \u003citem data-title=\"Know more about us\" data-url=\"#about-us\"\u003eAbout us\u003c/item\u003e\n    \u003citem data-title=\"The team\" data-url=\"#team\"\u003eTeam\u003c/item\u003e\n    \u003citem data-title=\"Projects we worked\" data-url=\"#projects\"\u003eProjects\u003c/item\u003e\n    \u003citem data-title=\"Contact us\" data-url=\"#contacts\"\u003eContacts\u003c/item\u003e\n    \u003citem data-title=\"Meet our partners\" data-url=\"#partners\"\u003ePartners\u003c/item\u003e\n  \u003c/list\u003e\n\u003c/module\u003e\n```\n\n- XSLT Template:\n\n```xml\n\u003cxsl:template match=\"data/module[@name='navigation']\" mode=\"complex\"\u003e\n  \u003cxsl:variable name=\"model\" select=\"@model\"/\u003e\n\n  \u003cxsl:for-each select=\"current()\"\u003e\n    \u003cnav class=\"navigation {$model}\"\u003e\n      \u003ch2\u003e\u003cxsl:value-of select=\"heading\"/\u003e\u003c/h2\u003e\n      \u003cul\u003e\n        \u003cxsl:for-each select=\"list/item\"\u003e\n          \u003cli\u003e\u003ca href=\"{@data-url}\"\u003e\u003cxsl:value-of select=\"current()\"/\u003e\u003c/a\u003e - \u003cxsl:value-of select=\"@data-title\"/\u003e\u003c/li\u003e\n        \u003c/xsl:for-each\u003e\n      \u003c/ul\u003e\n    \u003c/nav\u003e\n  \u003c/xsl:for-each\u003e\n\u003c/xsl:template\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbernardodiasc%2Fxslt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbernardodiasc%2Fxslt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbernardodiasc%2Fxslt/lists"}