{"id":23181,"date":"2013-05-13T17:01:21","date_gmt":"2013-05-13T11:31:21","guid":{"rendered":"http:\/\/vskills.in\/certification\/tutorial\/?p=23181"},"modified":"2024-04-12T14:23:50","modified_gmt":"2024-04-12T08:53:50","slug":"create-and-apply-templates","status":"publish","type":"page","link":"https:\/\/www.vskills.in\/certification\/tutorial\/create-and-apply-templates\/","title":{"rendered":"Create and Apply templates"},"content":{"rendered":"<h1>XML templates<\/h1>\n<div>\n<p>XML content assist provides a comment template, a section of predefined code that you can insert into a file. You may find a template useful when you have a certain piece of code you want to reuse several times, and you do not want to write it out every time.<\/p>\n<div>\n<p>You can use a default template as provided, customize that template, or create your own templates.<\/p>\n<p>For example, you can work on a group of XML pages that should all contain a table with a specific appearance. Create a template that contains the tags for that table, including the appropriate attributes and attribute values for each tag. (You can copy and paste the tags from a structured text editor into the template&#8217;s\u00a0Pattern\u00a0field.) Then select the name of the template from a content assist proposal list whenever you want to insert your custom table into an XML file.<\/p>\n<p>To create a new XML template, complete the following steps:<\/p>\n<\/div>\n<ol>\n<li>Click\u00a0Window\u00a0&gt;\u00a0Preferences\u00a0and select\u00a0XML\u00a0&gt;\u00a0XML Files\u00a0&gt;\u00a0Templates.<\/li>\n<li>Click\u00a0New\u00a0if you want to create a completely new template.<\/li>\n<li>Supply a new template\u00a0Name\u00a0and\u00a0Description.<\/li>\n<li>Specify the\u00a0Context\u00a0for the template.\u00a0This is the context in which the template is available in the proposal list when content assist is requested.<\/li>\n<li>Specify the\u00a0Pattern\u00a0for your template using the appropriate tags, attributes, or attribute values to be inserted by content assist.<\/li>\n<li>If you want to insert a variable, click the\u00a0Insert Variable\u00a0button and select the variable to be inserted.For example, the\u00a0<strong>date<\/strong>\u00a0variable indicates the current date will be inserted.<\/li>\n<li>Click\u00a0OK\u00a0and then\u00a0Apply\u00a0to save your changes.<\/li>\n<\/ol>\n<div>You can edit, remove, import, or export a template by using the same preferences page. If you have modified a default template, you can restore it to its default value. You can also restore a removed template if you have not exited from the workbench since it was removed.<\/div>\n<div><\/div>\n<div><\/div>\n<div><strong>Template Rules<\/strong><\/div>\n<div><\/div>\n<div>\n<p>File: Data.xml<\/p>\n<p>&lt;?xml version=&#8221;1.0&#8243;?&gt;<br \/>\n&lt;employees&gt;<br \/>\n&lt;animal&gt;<br \/>\n&lt;name language=&#8221;English&#8221;&gt;T1&lt;\/name&gt;<br \/>\n&lt;name language=&#8221;Latin&#8221;&gt;T2&lt;\/name&gt;<br \/>\n&lt;projects&gt;<br \/>\n&lt;project&gt;project1&lt;\/project&gt;<br \/>\n&lt;\/projects&gt;<br \/>\n&lt;\/animal&gt;<br \/>\n&lt;\/employees&gt;<\/p>\n<p>File: Transform.xslt<\/p>\n<p>&lt;?xml version=&#8221;1.0&#8243;?&gt;<br \/>\n&lt;xsl:stylesheet xmlns:xsl=&#8221;http:\/\/www.w3.org\/1999\/XSL\/Transform&#8221;<br \/>\nversion=&#8221;1.0&#8243;&gt;<\/p>\n<p>&lt;xsl:template match=&#8221;\/&#8221;&gt;<br \/>\n&lt;html&gt;<br \/>\n&lt;head&gt;<br \/>\n&lt;title&gt;this is the title&lt;\/title&gt;<br \/>\n&lt;\/head&gt;<br \/>\n&lt;body bgcolor=&#8221;white&#8221;&gt;<br \/>\n&lt;xsl:apply-templates select=&#8221;employees\/animal&#8221; \/&gt;<br \/>\n&lt;\/body&gt;<br \/>\n&lt;\/html&gt;<br \/>\n&lt;\/xsl:template&gt;<\/p>\n<p>&lt;xsl:template match=&#8221;animal&#8221;&gt;<br \/>\n&lt;p align=&#8221;center&#8221;&gt;<br \/>\n&lt;br \/&gt;<br \/>\n&lt;font size=&#8221;+3&#8243;&gt;<br \/>\n&lt;xsl:apply-templates select=&#8221;name&#8221; \/&gt;<br \/>\n&lt;\/font&gt;<br \/>\n&lt;\/p&gt;<br \/>\n&lt;paragraph&gt;<br \/>\n&lt;xsl:value-of select=&#8221;name[@language=&#8217;English&#8217;]&#8221; \/&gt;<br \/>\n&lt;a href=&#8221;http:\/\/www.java2s.com&#8221;&gt;pages&lt;\/a&gt;<br \/>\n&lt;\/p&gt;<br \/>\n&lt;hr \/&gt;<br \/>\n&lt;\/xsl:template&gt;<\/p>\n<p>&lt;xsl:template match=&#8221;name[@language=&#8217;English&#8217;]&#8221;&gt;<br \/>\n&lt;nobr&gt;<br \/>\n&lt;b&gt;<br \/>\n&lt;xsl:value-of select=&#8221;.&#8221; \/&gt;<br \/>\n:<br \/>\n&lt;\/b&gt;<br \/>\n&lt;\/nobr&gt;<br \/>\n&lt;\/xsl:template&gt;<\/p>\n<p>&lt;xsl:template match=&#8221;name[@language=&#8217;Latin&#8217;]&#8221;&gt;<br \/>\n&lt;nobr&gt;<br \/>\n&lt;i&gt;<br \/>\n&lt;xsl:value-of select=&#8221;.&#8221; \/&gt;<br \/>\n&lt;\/i&gt;<br \/>\n&lt;\/nobr&gt;<br \/>\n&lt;\/xsl:template&gt;<br \/>\n&lt;\/xsl:stylesheet&gt;<\/p>\n<p>Output:<\/p>\n<p>&lt;<strong>html<\/strong>&gt;<br \/>\n&lt;head&gt;<br \/>\n&lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;text\/html; charset=UTF-8&#8243;&gt;<br \/>\n&lt;title&gt;<strong>this<\/strong> is the title&lt;\/title&gt;<br \/>\n&lt;\/head&gt;<br \/>\n&lt;<strong>body<\/strong> bgcolor=&#8221;white&#8221;&gt;<br \/>\n&lt;p align=&#8221;center&#8221;&gt;&lt;br&gt;&lt;font size=&#8221;+3&#8243;&gt;<br \/>\n&lt;nobr&gt;&lt;b&gt;T1<br \/>\n:<br \/>\n&lt;\/b&gt;&lt;\/nobr&gt;<br \/>\n&lt;nobr&gt;&lt;i&gt;T2&lt;\/i&gt;&lt;\/nobr&gt;&lt;\/font&gt;&lt;\/p&gt;<br \/>\n&lt;paragraph&gt;T1&lt;a href=&#8221;http:\/\/www.java2s.com&#8221;&gt;pages&lt;\/a&gt;&lt;\/p&gt;<br \/>\n&lt;hr&gt;<br \/>\n&lt;\/body&gt;<br \/>\n&lt;\/html&gt;<\/p>\n<div class=\"apply\">\n<h5>Go to- <a href=\"https:\/\/www.vskills.in\/certification\/tutorial\/xml-developer\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>Certified XML Developer Tutorial<\/strong><\/a><\/h5>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>XML templates XML content assist provides a comment template, a section of predefined code that you can insert into a file. You may find a template useful when you have a certain piece of code you want to reuse several times, and you do not want to write it out every time. You can use&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[3353],"tags":[4546,4545,4548,4547],"class_list":["post-23181","page","type-page","status-publish","hentry","category-xml","tag-apply-templates","tag-create-and-apply-templates","tag-template-rules","tag-xml-templates"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Create and Apply templates - Tutorial<\/title>\n<meta name=\"description\" content=\"Create and Apply templates\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.vskills.in\/certification\/tutorial\/create-and-apply-templates\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create and Apply templates - Tutorial\" \/>\n<meta property=\"og:description\" content=\"Create and Apply templates\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.vskills.in\/certification\/tutorial\/create-and-apply-templates\/\" \/>\n<meta property=\"og:site_name\" content=\"Tutorial\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/vskills.in\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-12T08:53:50+00:00\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/create-and-apply-templates\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/create-and-apply-templates\/\",\"name\":\"Create and Apply templates - Tutorial\",\"isPartOf\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\"},\"datePublished\":\"2013-05-13T11:31:21+00:00\",\"dateModified\":\"2024-04-12T08:53:50+00:00\",\"description\":\"Create and Apply templates\",\"breadcrumb\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/create-and-apply-templates\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.vskills.in\/certification\/tutorial\/create-and-apply-templates\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/create-and-apply-templates\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Create and Apply templates\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#website\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"name\":\"Tutorial\",\"description\":\"Vskills - A initiative in elearning and certification\",\"publisher\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#organization\",\"name\":\"Vskills\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"contentUrl\":\"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg\",\"width\":73,\"height\":55,\"caption\":\"Vskills\"},\"image\":{\"@id\":\"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/vskills.in\/\",\"https:\/\/x.com\/vskills_in\",\"https:\/\/www.linkedin.com\/company-beta\/1371554\/\",\"https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Create and Apply templates - Tutorial","description":"Create and Apply templates","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:\/\/www.vskills.in\/certification\/tutorial\/create-and-apply-templates\/","og_locale":"en_US","og_type":"article","og_title":"Create and Apply templates - Tutorial","og_description":"Create and Apply templates","og_url":"https:\/\/www.vskills.in\/certification\/tutorial\/create-and-apply-templates\/","og_site_name":"Tutorial","article_publisher":"https:\/\/www.facebook.com\/vskills.in\/","article_modified_time":"2024-04-12T08:53:50+00:00","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/create-and-apply-templates\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/create-and-apply-templates\/","name":"Create and Apply templates - Tutorial","isPartOf":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website"},"datePublished":"2013-05-13T11:31:21+00:00","dateModified":"2024-04-12T08:53:50+00:00","description":"Create and Apply templates","breadcrumb":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/create-and-apply-templates\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.vskills.in\/certification\/tutorial\/create-and-apply-templates\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/create-and-apply-templates\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.vskills.in\/certification\/tutorial\/"},{"@type":"ListItem","position":2,"name":"Create and Apply templates"}]},{"@type":"WebSite","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#website","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","name":"Tutorial","description":"Vskills - A initiative in elearning and certification","publisher":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.vskills.in\/certification\/tutorial\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#organization","name":"Vskills","url":"https:\/\/www.vskills.in\/certification\/tutorial\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/","url":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","contentUrl":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-content\/uploads\/2017\/07\/vskills-min-logo.jpg","width":73,"height":55,"caption":"Vskills"},"image":{"@id":"https:\/\/www.vskills.in\/certification\/tutorial\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/vskills.in\/","https:\/\/x.com\/vskills_in","https:\/\/www.linkedin.com\/company-beta\/1371554\/","https:\/\/www.youtube.com\/channel\/UCMWnscxPwRF_PqXo9B7q_Tw"]}]}},"_links":{"self":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/23181","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/comments?post=23181"}],"version-history":[{"count":4,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/23181\/revisions"}],"predecessor-version":[{"id":134006,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/pages\/23181\/revisions\/134006"}],"wp:attachment":[{"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/media?parent=23181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/categories?post=23181"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vskills.in\/certification\/tutorial\/wp-json\/wp\/v2\/tags?post=23181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}