{"id":45357,"date":"2016-04-09T16:54:17","date_gmt":"2016-04-09T16:54:17","guid":{"rendered":"http:\/\/webkul.com\/blog\/?p=45357"},"modified":"2016-04-13T16:40:42","modified_gmt":"2016-04-13T16:40:42","slug":"style-sheets-xml","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/style-sheets-xml\/","title":{"rendered":"Style Sheets for XML"},"content":{"rendered":"<p>Today we are going to learn about how to add styles to XML elements. As we know HTML have predefined tags and we can add styles to HTML element by CSS but XML does not use predefined tags so we can add styles to XML element by XSL that is Xtensible style sheets language. By XSL we can transform, navigate,format the XML documents.<\/p>\n<p>For giving styles to XML document it needs a proper style sheets declaration on the top of the XML document.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-45358\" src=\"http:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/04\/xml.1.png\" alt=\"xml.1\" width=\"531\" height=\"39\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/04\/xml.1.png 531w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/04\/xml.1-250x18.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/04\/xml.1-300x22.png 300w\" sizes=\"(max-width: 531px) 100vw, 531px\" loading=\"lazy\" \/><\/p>\n<p>Here is a XML document named style-sheets.xml<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-45361\" src=\"http:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/04\/xml3-1.png\" alt=\"xml3\" width=\"538\" height=\"221\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/04\/xml3-1.png 538w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/04\/xml3-1-250x103.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/04\/xml3-1-300x123.png 300w\" sizes=\"(max-width: 538px) 100vw, 538px\" loading=\"lazy\" \/><\/p>\n<p>We have to link a XSL style sheet file to the XML document so that XML document will behave as per the XSL style sheet. Here is a XSL file named style_sheet.xsl<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-45362\" src=\"http:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/04\/xml4.png\" alt=\"xml4\" width=\"507\" height=\"473\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/04\/xml4.png 507w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/04\/xml4-250x233.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/04\/xml4-300x280.png 300w\" sizes=\"(max-width: 507px) 100vw, 507px\" loading=\"lazy\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Result &#8211;<\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-45857\" src=\"http:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/04\/xml9.png\" alt=\"xml9\" width=\"496\" height=\"316\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/04\/xml9.png 496w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/04\/xml9-250x159.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/04\/xml9-300x191.png 300w\" sizes=\"(max-width: 496px) 100vw, 496px\" loading=\"lazy\" \/><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today we are going to learn about how to add styles to XML elements. As we know HTML have predefined tags and we can add styles to HTML element by CSS but XML does not use predefined tags so we can add styles to XML element by XSL that is Xtensible style sheets language. By <a href=\"https:\/\/webkul.com\/blog\/style-sheets-xml\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":71,"featured_media":41008,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[305,1177],"tags":[2071],"class_list":["post-45357","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-opencart","category-theme","tag-opencart"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Style Sheets for XML - Webkul Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/style-sheets-xml\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Style Sheets for XML - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"Today we are going to learn about how to add styles to XML elements. As we know HTML have predefined tags and we can add styles to HTML element by CSS but XML does not use predefined tags so we can add styles to XML element by XSL that is Xtensible style sheets language. By [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/style-sheets-xml\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2016-04-09T16:54:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-04-13T16:40:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png\" \/>\n\t<meta property=\"og:image:width\" content=\"825\" \/>\n\t<meta property=\"og:image:height\" content=\"260\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Sambit Pattanayak\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sambit Pattanayak\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/style-sheets-xml\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/style-sheets-xml\/\"},\"author\":{\"name\":\"Sambit Pattanayak\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/23309d7bfba5b06d58b50ea5e3191f01\"},\"headline\":\"Style Sheets for XML\",\"datePublished\":\"2016-04-09T16:54:17+00:00\",\"dateModified\":\"2016-04-13T16:40:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/style-sheets-xml\/\"},\"wordCount\":135,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/style-sheets-xml\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png\",\"keywords\":[\"opencart\"],\"articleSection\":[\"opencart\",\"Theme\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/style-sheets-xml\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/style-sheets-xml\/\",\"url\":\"https:\/\/webkul.com\/blog\/style-sheets-xml\/\",\"name\":\"Style Sheets for XML - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/style-sheets-xml\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/style-sheets-xml\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png\",\"datePublished\":\"2016-04-09T16:54:17+00:00\",\"dateModified\":\"2016-04-13T16:40:42+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/style-sheets-xml\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/style-sheets-xml\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/style-sheets-xml\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png\",\"width\":825,\"height\":260},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/style-sheets-xml\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Style Sheets for XML\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/23309d7bfba5b06d58b50ea5e3191f01\",\"name\":\"Sambit Pattanayak\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b470681418ca47d8211cf413884189c631a12188462ba25500fa51c897318975?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b470681418ca47d8211cf413884189c631a12188462ba25500fa51c897318975?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g\",\"caption\":\"Sambit Pattanayak\"},\"sameAs\":[\"http:\/\/webkul.com\"],\"url\":\"https:\/\/webkul.com\/blog\/author\/sambit-p819\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Style Sheets for XML - Webkul Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/style-sheets-xml\/","og_locale":"en_US","og_type":"article","og_title":"Style Sheets for XML - Webkul Blog","og_description":"Today we are going to learn about how to add styles to XML elements. As we know HTML have predefined tags and we can add styles to HTML element by CSS but XML does not use predefined tags so we can add styles to XML element by XSL that is Xtensible style sheets language. By [...]","og_url":"https:\/\/webkul.com\/blog\/style-sheets-xml\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2016-04-09T16:54:17+00:00","article_modified_time":"2016-04-13T16:40:42+00:00","og_image":[{"width":825,"height":260,"url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png","type":"image\/png"}],"author":"Sambit Pattanayak","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Sambit Pattanayak","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/style-sheets-xml\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/style-sheets-xml\/"},"author":{"name":"Sambit Pattanayak","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/23309d7bfba5b06d58b50ea5e3191f01"},"headline":"Style Sheets for XML","datePublished":"2016-04-09T16:54:17+00:00","dateModified":"2016-04-13T16:40:42+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/style-sheets-xml\/"},"wordCount":135,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/style-sheets-xml\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png","keywords":["opencart"],"articleSection":["opencart","Theme"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/style-sheets-xml\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/style-sheets-xml\/","url":"https:\/\/webkul.com\/blog\/style-sheets-xml\/","name":"Style Sheets for XML - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/style-sheets-xml\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/style-sheets-xml\/#primaryimage"},"thumbnailUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png","datePublished":"2016-04-09T16:54:17+00:00","dateModified":"2016-04-13T16:40:42+00:00","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/style-sheets-xml\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/style-sheets-xml\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/style-sheets-xml\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2016\/02\/Opencart-Code-Snippet.png","width":825,"height":260},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/style-sheets-xml\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Style Sheets for XML"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/23309d7bfba5b06d58b50ea5e3191f01","name":"Sambit Pattanayak","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b470681418ca47d8211cf413884189c631a12188462ba25500fa51c897318975?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b470681418ca47d8211cf413884189c631a12188462ba25500fa51c897318975?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Fmike.png&r=g","caption":"Sambit Pattanayak"},"sameAs":["http:\/\/webkul.com"],"url":"https:\/\/webkul.com\/blog\/author\/sambit-p819\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/45357","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/71"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=45357"}],"version-history":[{"count":6,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/45357\/revisions"}],"predecessor-version":[{"id":45858,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/45357\/revisions\/45858"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media\/41008"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=45357"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=45357"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=45357"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}