## page was renamed from HelpCenter/Tips/DITA/Release Specific/ePublisher 9.3/DITA_Configuration ## page was renamed from HelpCenter/Tips/DITA/ePublisher_9_3/DITA_Configuration ## page was renamed from HelpCenter/Tips/DITA/ePublisher 9 3/Element Mapping Configuration = DITA Configuration = ePublisher's DITA support allows for user-defined mappings between complex DITA element hierarchies and ePublisher styles. This configuration can be controlled at the source DITA map level or at the ePublisher Project and Target level. Finally, through the use of ePublisher Stationery, configurations can be maintained and deployed throughout your organization to all ePublisher Express and ePublisher !AutoMap users. == Structured Elements and Styles == Before diving into the ePublisher configuration file, users should first understand how ePublisher processes DITA content. At this time, ePublisher is a style-centric publishing system. The focus is on the layout and appearance of elements, not on structure. Consider the following expanded DITA map: {{{ Title Styles Section Title Sections are really great! Task Titles Triumph! Everything should be considered in context. }}} In this map, there are three {{{
Sections are really great!
Everything should be considered in context.
}}} elements: {{{ }}} In style based output formats (such as HTML and RTF), we might choose to treat certain elements with the same style. Here is one possible mapping: ||'''Structure''' ||'''Style''' || ||{{{ }}} ||Title || ||{{{ }}} ||Heading 1, Section 1 || ||{{{ }}} ||Heading 1 || ||{{{ }}} ||Section Body || ||{{{ }}} ||Topic Body || This mapping preserves all structure information one-for-one. Now try "down mapping", converting multiple structures to a single style: ||'''Structure''' ||'''Style''' || ||{{{ }}} ||Title || ||{{{ }}} ||Heading 1 || ||{{{ }}} ||Heading 1 || ||{{{ }}} ||Body || ||{{{ }}} ||Body || Written another way: ||'''Structure''' ||'''Style''' || ||{{{ }}} ||Title || ||{{{[count(ancestor:: or ancestor:) > 1]}}} ||Heading 1 || ||{{{}}} ||Body || Still further rewrites: ||'''Structure''' ||'''Style''' || ||{{{[count(ancestor::) = 1]}}} ||Title || ||{{{[count(ancestor:: or ancestor:) = 2]}}} ||Heading 1 || ||{{{}}} ||Body || == Mapping with XPath == This style mapping we have created seems nice, but ePublisher can't use it yet. Unless we convert it something ePublisher understands. In this case, we will convert the mapping to XPath expressions. ||'''XPath Expression''' ||'''Style''' || ||{{{title[count(ancestor::topic) = 1]}}} ||Title || ||{{{title[count(ancestor::topic or ancestor:section) = 2]}}} ||Heading 1 || ||{{{p}}} ||Body || That looks pretty good. Except DITA supports a little thing call "specialization". It means that I can give elements different names, yet process them the same way. For example, the DITA element {{{}}} is a specialization of the {{{}}} element. This is represented in DITA through DTDs in a class element. So when you see: {{{ ... ... }}} DITA sees: {{{ ... ... }}} If you want to process a {{{}}} element the same way as a {{{}}} element, you simply check for {{{" topic/topic "}}} in the {{{@class}}} attribute. And XPath expression to perform this test is: {{{ *[contains(@class, ' topic/topic ')] }}} Different behaviors for {{{}}} elements can be introduced by checking for the {{{" task/task "}}} class substring: {{{ *[contains(@class, ' task/task ')] }}} Now let's rewrite our mapping to support DITA specialization: ||'''XPath Expression''' ||'''Style''' || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ')]) = 1]}}} ||Title || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ') or contains(@class, ' topic/section ')]) = 2]}}} ||Heading 1 || ||{{{*[contains(@class, ' topic/p ')]}}} ||Body || Wow! That's a pretty long-winded way of saying that! But, hey, now we get to use DITA, DITA Specialization, and ePublisher! == Configuring ePublisher == Great, now we know how to translate structures to styles. And we even know a technology, XPath, that can help us do that. What else does ePublisher need? It needs the ePublisher DITA configuration file {{{default.wwconfig}}} of course! {{{ }}} === ePublisher DITA Configuration File Structure === The ePublisher DITA configuration file allows ePublisher to answer the following questions: 1. What style based objects does this structure represent? A paragraph? A character? A container? A table? 1. What style name should be used for this structure? ==== Types ==== First, the {{{}}} section identifies what the structure represents. From our example, we would define the following types: ||'''XPath Expression''' ||'''Type''' || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ')]) = 1]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ') or contains(@class, ' topic/section ')]) = 2]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || ||{{{*}}} ||Structure || Since all of the {{{}}} elements are really just paragraphs, we can simplify this to: ||'''XPath Expression''' ||'''Type''' || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || ||{{{*}}} ||Structure || Okay, so everything that is either a {{{}}} element or a {{{}}} element becomes a "Paragraph" and the rest become "Structure". What if we had listed the "Structure" one first? ||'''XPath Expression''' ||'''Type''' || ||{{{*}}} ||Structure || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || That would be bad, because everything in the document would be treated as "Structure"! So why allow people to do this kind of thing? Well, perhaps we'd like to get crazy and convert DITA titles {{{}}} elements to character styles: ||'''XPath Expression''' ||'''Type''' || ||{{{*[contains(@class, ' topic/title ')][count(contains(@class, ' topic/section ')]) > 0]}}} ||Character || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || ||{{{*}}} ||Structure || We can be as specific as required and ePublisher will pick the first, best match. Now, we'll return to our earlier (read simplier) example and translate it into ePublisher's required configuration file language: ||'''XPath Expression''' ||'''Type''' || ||{{{*}}} ||Structure || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || {{{ }}} ==== Styles ==== We've already covered how to map structure to styles, so now we just need to show how this information is represented in the ePublisher configuration file: ||'''XPath Expression''' ||'''Style''' || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ')]) = 1]}}} ||Title || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ') or contains(@class, ' topic/section ')]) = 2]}}} ||Heading 1 || ||{{{*[contains(@class, ' topic/p ')]}}} ||Body || {{{ }}} ==== Types and Styles Together ==== Perhaps now our little configuration file example will make a bit more sense: {{{ }}} === Overriding DITA Configurations === DITA configuration files can be overriding in four locations: 1. Per source DITA map. 1. Per project. 1. Per format. 1. Per target. ==== Per source DITA Map ==== If you have a DITA map file named {{{mymap.ditamap}}}, you can create a ePublisher configuration file with the base name of the original and use the {{{.wwconfig}}} extension. You directory goes from: {{{ mymap.ditamap }}} to: {{{ mymap.ditamap mymap.wwconfig }}} ||<#ee9999>NOTE: ||<#ee9999>This particular configuration file need only contain overrides or changes from the base {{{default.wwconfig}}} file. || ==== Per project ==== Users can change the configuration of all DITA files in a project, across formats and targets, by creating a new {{{default.wwconfig}}} file in this location: {{{ Formats Adapters xml scripts dita default.wwconfig }}} ==== Per format ==== Users can change the configuration of all DITA files in a project for a particular format by creating a new {{{default.wwconfig}}} file in this location: {{{ Formats Adapters xml scripts dita default.wwconfig }}} ==== Per target ==== Users can change the configuration of all DITA files in a project for a single target by creating a new {{{default.wwconfig}}} file in this location: {{{ Targets Adapters xml scripts dita default.wwconfig }}} == Crazy Configurations == === Some tips from experience === By Zoë Lawson Occasionally, a
}}} In style based output formats (such as HTML and RTF), we might choose to treat certain elements with the same style. Here is one possible mapping: ||'''Structure''' ||'''Style''' || ||{{{ }}} ||Title || ||{{{ }}} ||Heading 1, Section 1 || ||{{{ }}} ||Heading 1 || ||{{{ }}} ||Section Body || ||{{{ }}} ||Topic Body || This mapping preserves all structure information one-for-one. Now try "down mapping", converting multiple structures to a single style: ||'''Structure''' ||'''Style''' || ||{{{ }}} ||Title || ||{{{ }}} ||Heading 1 || ||{{{ }}} ||Heading 1 || ||{{{ }}} ||Body || ||{{{ }}} ||Body || Written another way: ||'''Structure''' ||'''Style''' || ||{{{ }}} ||Title || ||{{{[count(ancestor:: or ancestor:) > 1]}}} ||Heading 1 || ||{{{}}} ||Body || Still further rewrites: ||'''Structure''' ||'''Style''' || ||{{{[count(ancestor::) = 1]}}} ||Title || ||{{{[count(ancestor:: or ancestor:) = 2]}}} ||Heading 1 || ||{{{}}} ||Body || == Mapping with XPath == This style mapping we have created seems nice, but ePublisher can't use it yet. Unless we convert it something ePublisher understands. In this case, we will convert the mapping to XPath expressions. ||'''XPath Expression''' ||'''Style''' || ||{{{title[count(ancestor::topic) = 1]}}} ||Title || ||{{{title[count(ancestor::topic or ancestor:section) = 2]}}} ||Heading 1 || ||{{{p}}} ||Body || That looks pretty good. Except DITA supports a little thing call "specialization". It means that I can give elements different names, yet process them the same way. For example, the DITA element {{{}}} is a specialization of the {{{}}} element. This is represented in DITA through DTDs in a class element. So when you see: {{{ ... ... }}} DITA sees: {{{ ... ... }}} If you want to process a {{{}}} element the same way as a {{{}}} element, you simply check for {{{" topic/topic "}}} in the {{{@class}}} attribute. And XPath expression to perform this test is: {{{ *[contains(@class, ' topic/topic ')] }}} Different behaviors for {{{}}} elements can be introduced by checking for the {{{" task/task "}}} class substring: {{{ *[contains(@class, ' task/task ')] }}} Now let's rewrite our mapping to support DITA specialization: ||'''XPath Expression''' ||'''Style''' || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ')]) = 1]}}} ||Title || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ') or contains(@class, ' topic/section ')]) = 2]}}} ||Heading 1 || ||{{{*[contains(@class, ' topic/p ')]}}} ||Body || Wow! That's a pretty long-winded way of saying that! But, hey, now we get to use DITA, DITA Specialization, and ePublisher! == Configuring ePublisher == Great, now we know how to translate structures to styles. And we even know a technology, XPath, that can help us do that. What else does ePublisher need? It needs the ePublisher DITA configuration file {{{default.wwconfig}}} of course! {{{ }}} === ePublisher DITA Configuration File Structure === The ePublisher DITA configuration file allows ePublisher to answer the following questions: 1. What style based objects does this structure represent? A paragraph? A character? A container? A table? 1. What style name should be used for this structure? ==== Types ==== First, the {{{}}} section identifies what the structure represents. From our example, we would define the following types: ||'''XPath Expression''' ||'''Type''' || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ')]) = 1]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ') or contains(@class, ' topic/section ')]) = 2]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || ||{{{*}}} ||Structure || Since all of the {{{}}} elements are really just paragraphs, we can simplify this to: ||'''XPath Expression''' ||'''Type''' || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || ||{{{*}}} ||Structure || Okay, so everything that is either a {{{}}} element or a {{{}}} element becomes a "Paragraph" and the rest become "Structure". What if we had listed the "Structure" one first? ||'''XPath Expression''' ||'''Type''' || ||{{{*}}} ||Structure || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || That would be bad, because everything in the document would be treated as "Structure"! So why allow people to do this kind of thing? Well, perhaps we'd like to get crazy and convert DITA titles {{{}}} elements to character styles: ||'''XPath Expression''' ||'''Type''' || ||{{{*[contains(@class, ' topic/title ')][count(contains(@class, ' topic/section ')]) > 0]}}} ||Character || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || ||{{{*}}} ||Structure || We can be as specific as required and ePublisher will pick the first, best match. Now, we'll return to our earlier (read simplier) example and translate it into ePublisher's required configuration file language: ||'''XPath Expression''' ||'''Type''' || ||{{{*}}} ||Structure || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || {{{ }}} ==== Styles ==== We've already covered how to map structure to styles, so now we just need to show how this information is represented in the ePublisher configuration file: ||'''XPath Expression''' ||'''Style''' || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ')]) = 1]}}} ||Title || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ') or contains(@class, ' topic/section ')]) = 2]}}} ||Heading 1 || ||{{{*[contains(@class, ' topic/p ')]}}} ||Body || {{{ }}} ==== Types and Styles Together ==== Perhaps now our little configuration file example will make a bit more sense: {{{ }}} === Overriding DITA Configurations === DITA configuration files can be overriding in four locations: 1. Per source DITA map. 1. Per project. 1. Per format. 1. Per target. ==== Per source DITA Map ==== If you have a DITA map file named {{{mymap.ditamap}}}, you can create a ePublisher configuration file with the base name of the original and use the {{{.wwconfig}}} extension. You directory goes from: {{{ mymap.ditamap }}} to: {{{ mymap.ditamap mymap.wwconfig }}} ||<#ee9999>NOTE: ||<#ee9999>This particular configuration file need only contain overrides or changes from the base {{{default.wwconfig}}} file. || ==== Per project ==== Users can change the configuration of all DITA files in a project, across formats and targets, by creating a new {{{default.wwconfig}}} file in this location: {{{ Formats Adapters xml scripts dita default.wwconfig }}} ==== Per format ==== Users can change the configuration of all DITA files in a project for a particular format by creating a new {{{default.wwconfig}}} file in this location: {{{ Formats Adapters xml scripts dita default.wwconfig }}} ==== Per target ==== Users can change the configuration of all DITA files in a project for a single target by creating a new {{{default.wwconfig}}} file in this location: {{{ Targets Adapters xml scripts dita default.wwconfig }}} == Crazy Configurations == === Some tips from experience === By Zoë Lawson Occasionally, a
}}} ||Section Body || ||{{{ }}} ||Topic Body || This mapping preserves all structure information one-for-one. Now try "down mapping", converting multiple structures to a single style: ||'''Structure''' ||'''Style''' || ||{{{ }}} ||Title || ||{{{ }}} ||Heading 1 || ||{{{ }}} ||Heading 1 || ||{{{ }}} ||Body || ||{{{ }}} ||Body || Written another way: ||'''Structure''' ||'''Style''' || ||{{{ }}} ||Title || ||{{{[count(ancestor:: or ancestor:) > 1]}}} ||Heading 1 || ||{{{}}} ||Body || Still further rewrites: ||'''Structure''' ||'''Style''' || ||{{{[count(ancestor::) = 1]}}} ||Title || ||{{{[count(ancestor:: or ancestor:) = 2]}}} ||Heading 1 || ||{{{}}} ||Body || == Mapping with XPath == This style mapping we have created seems nice, but ePublisher can't use it yet. Unless we convert it something ePublisher understands. In this case, we will convert the mapping to XPath expressions. ||'''XPath Expression''' ||'''Style''' || ||{{{title[count(ancestor::topic) = 1]}}} ||Title || ||{{{title[count(ancestor::topic or ancestor:section) = 2]}}} ||Heading 1 || ||{{{p}}} ||Body || That looks pretty good. Except DITA supports a little thing call "specialization". It means that I can give elements different names, yet process them the same way. For example, the DITA element {{{}}} is a specialization of the {{{}}} element. This is represented in DITA through DTDs in a class element. So when you see: {{{ ... ... }}} DITA sees: {{{ ... ... }}} If you want to process a {{{}}} element the same way as a {{{}}} element, you simply check for {{{" topic/topic "}}} in the {{{@class}}} attribute. And XPath expression to perform this test is: {{{ *[contains(@class, ' topic/topic ')] }}} Different behaviors for {{{}}} elements can be introduced by checking for the {{{" task/task "}}} class substring: {{{ *[contains(@class, ' task/task ')] }}} Now let's rewrite our mapping to support DITA specialization: ||'''XPath Expression''' ||'''Style''' || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ')]) = 1]}}} ||Title || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ') or contains(@class, ' topic/section ')]) = 2]}}} ||Heading 1 || ||{{{*[contains(@class, ' topic/p ')]}}} ||Body || Wow! That's a pretty long-winded way of saying that! But, hey, now we get to use DITA, DITA Specialization, and ePublisher! == Configuring ePublisher == Great, now we know how to translate structures to styles. And we even know a technology, XPath, that can help us do that. What else does ePublisher need? It needs the ePublisher DITA configuration file {{{default.wwconfig}}} of course! {{{ }}} === ePublisher DITA Configuration File Structure === The ePublisher DITA configuration file allows ePublisher to answer the following questions: 1. What style based objects does this structure represent? A paragraph? A character? A container? A table? 1. What style name should be used for this structure? ==== Types ==== First, the {{{}}} section identifies what the structure represents. From our example, we would define the following types: ||'''XPath Expression''' ||'''Type''' || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ')]) = 1]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ') or contains(@class, ' topic/section ')]) = 2]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || ||{{{*}}} ||Structure || Since all of the {{{}}} elements are really just paragraphs, we can simplify this to: ||'''XPath Expression''' ||'''Type''' || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || ||{{{*}}} ||Structure || Okay, so everything that is either a {{{}}} element or a {{{}}} element becomes a "Paragraph" and the rest become "Structure". What if we had listed the "Structure" one first? ||'''XPath Expression''' ||'''Type''' || ||{{{*}}} ||Structure || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || That would be bad, because everything in the document would be treated as "Structure"! So why allow people to do this kind of thing? Well, perhaps we'd like to get crazy and convert DITA titles {{{}}} elements to character styles: ||'''XPath Expression''' ||'''Type''' || ||{{{*[contains(@class, ' topic/title ')][count(contains(@class, ' topic/section ')]) > 0]}}} ||Character || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || ||{{{*}}} ||Structure || We can be as specific as required and ePublisher will pick the first, best match. Now, we'll return to our earlier (read simplier) example and translate it into ePublisher's required configuration file language: ||'''XPath Expression''' ||'''Type''' || ||{{{*}}} ||Structure || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || {{{ }}} ==== Styles ==== We've already covered how to map structure to styles, so now we just need to show how this information is represented in the ePublisher configuration file: ||'''XPath Expression''' ||'''Style''' || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ')]) = 1]}}} ||Title || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ') or contains(@class, ' topic/section ')]) = 2]}}} ||Heading 1 || ||{{{*[contains(@class, ' topic/p ')]}}} ||Body || {{{ }}} ==== Types and Styles Together ==== Perhaps now our little configuration file example will make a bit more sense: {{{ }}} === Overriding DITA Configurations === DITA configuration files can be overriding in four locations: 1. Per source DITA map. 1. Per project. 1. Per format. 1. Per target. ==== Per source DITA Map ==== If you have a DITA map file named {{{mymap.ditamap}}}, you can create a ePublisher configuration file with the base name of the original and use the {{{.wwconfig}}} extension. You directory goes from: {{{ mymap.ditamap }}} to: {{{ mymap.ditamap mymap.wwconfig }}} ||<#ee9999>NOTE: ||<#ee9999>This particular configuration file need only contain overrides or changes from the base {{{default.wwconfig}}} file. || ==== Per project ==== Users can change the configuration of all DITA files in a project, across formats and targets, by creating a new {{{default.wwconfig}}} file in this location: {{{ Formats Adapters xml scripts dita default.wwconfig }}} ==== Per format ==== Users can change the configuration of all DITA files in a project for a particular format by creating a new {{{default.wwconfig}}} file in this location: {{{ Formats Adapters xml scripts dita default.wwconfig }}} ==== Per target ==== Users can change the configuration of all DITA files in a project for a single target by creating a new {{{default.wwconfig}}} file in this location: {{{ Targets Adapters xml scripts dita default.wwconfig }}} == Crazy Configurations == === Some tips from experience === By Zoë Lawson Occasionally, a
}}} ||Topic Body || This mapping preserves all structure information one-for-one. Now try "down mapping", converting multiple structures to a single style: ||'''Structure''' ||'''Style''' || ||{{{ }}} ||Title || ||{{{ }}} ||Heading 1 || ||{{{ }}} ||Heading 1 || ||{{{ }}} ||Body || ||{{{ }}} ||Body || Written another way: ||'''Structure''' ||'''Style''' || ||{{{ }}} ||Title || ||{{{[count(ancestor:: or ancestor:) > 1]}}} ||Heading 1 || ||{{{}}} ||Body || Still further rewrites: ||'''Structure''' ||'''Style''' || ||{{{[count(ancestor::) = 1]}}} ||Title || ||{{{[count(ancestor:: or ancestor:) = 2]}}} ||Heading 1 || ||{{{}}} ||Body || == Mapping with XPath == This style mapping we have created seems nice, but ePublisher can't use it yet. Unless we convert it something ePublisher understands. In this case, we will convert the mapping to XPath expressions. ||'''XPath Expression''' ||'''Style''' || ||{{{title[count(ancestor::topic) = 1]}}} ||Title || ||{{{title[count(ancestor::topic or ancestor:section) = 2]}}} ||Heading 1 || ||{{{p}}} ||Body || That looks pretty good. Except DITA supports a little thing call "specialization". It means that I can give elements different names, yet process them the same way. For example, the DITA element {{{}}} is a specialization of the {{{}}} element. This is represented in DITA through DTDs in a class element. So when you see: {{{ ... ... }}} DITA sees: {{{ ... ... }}} If you want to process a {{{}}} element the same way as a {{{}}} element, you simply check for {{{" topic/topic "}}} in the {{{@class}}} attribute. And XPath expression to perform this test is: {{{ *[contains(@class, ' topic/topic ')] }}} Different behaviors for {{{}}} elements can be introduced by checking for the {{{" task/task "}}} class substring: {{{ *[contains(@class, ' task/task ')] }}} Now let's rewrite our mapping to support DITA specialization: ||'''XPath Expression''' ||'''Style''' || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ')]) = 1]}}} ||Title || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ') or contains(@class, ' topic/section ')]) = 2]}}} ||Heading 1 || ||{{{*[contains(@class, ' topic/p ')]}}} ||Body || Wow! That's a pretty long-winded way of saying that! But, hey, now we get to use DITA, DITA Specialization, and ePublisher! == Configuring ePublisher == Great, now we know how to translate structures to styles. And we even know a technology, XPath, that can help us do that. What else does ePublisher need? It needs the ePublisher DITA configuration file {{{default.wwconfig}}} of course! {{{ }}} === ePublisher DITA Configuration File Structure === The ePublisher DITA configuration file allows ePublisher to answer the following questions: 1. What style based objects does this structure represent? A paragraph? A character? A container? A table? 1. What style name should be used for this structure? ==== Types ==== First, the {{{}}} section identifies what the structure represents. From our example, we would define the following types: ||'''XPath Expression''' ||'''Type''' || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ')]) = 1]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ') or contains(@class, ' topic/section ')]) = 2]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || ||{{{*}}} ||Structure || Since all of the {{{}}} elements are really just paragraphs, we can simplify this to: ||'''XPath Expression''' ||'''Type''' || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || ||{{{*}}} ||Structure || Okay, so everything that is either a {{{}}} element or a {{{}}} element becomes a "Paragraph" and the rest become "Structure". What if we had listed the "Structure" one first? ||'''XPath Expression''' ||'''Type''' || ||{{{*}}} ||Structure || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || That would be bad, because everything in the document would be treated as "Structure"! So why allow people to do this kind of thing? Well, perhaps we'd like to get crazy and convert DITA titles {{{}}} elements to character styles: ||'''XPath Expression''' ||'''Type''' || ||{{{*[contains(@class, ' topic/title ')][count(contains(@class, ' topic/section ')]) > 0]}}} ||Character || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || ||{{{*}}} ||Structure || We can be as specific as required and ePublisher will pick the first, best match. Now, we'll return to our earlier (read simplier) example and translate it into ePublisher's required configuration file language: ||'''XPath Expression''' ||'''Type''' || ||{{{*}}} ||Structure || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || {{{ }}} ==== Styles ==== We've already covered how to map structure to styles, so now we just need to show how this information is represented in the ePublisher configuration file: ||'''XPath Expression''' ||'''Style''' || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ')]) = 1]}}} ||Title || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ') or contains(@class, ' topic/section ')]) = 2]}}} ||Heading 1 || ||{{{*[contains(@class, ' topic/p ')]}}} ||Body || {{{ }}} ==== Types and Styles Together ==== Perhaps now our little configuration file example will make a bit more sense: {{{ }}} === Overriding DITA Configurations === DITA configuration files can be overriding in four locations: 1. Per source DITA map. 1. Per project. 1. Per format. 1. Per target. ==== Per source DITA Map ==== If you have a DITA map file named {{{mymap.ditamap}}}, you can create a ePublisher configuration file with the base name of the original and use the {{{.wwconfig}}} extension. You directory goes from: {{{ mymap.ditamap }}} to: {{{ mymap.ditamap mymap.wwconfig }}} ||<#ee9999>NOTE: ||<#ee9999>This particular configuration file need only contain overrides or changes from the base {{{default.wwconfig}}} file. || ==== Per project ==== Users can change the configuration of all DITA files in a project, across formats and targets, by creating a new {{{default.wwconfig}}} file in this location: {{{ Formats Adapters xml scripts dita default.wwconfig }}} ==== Per format ==== Users can change the configuration of all DITA files in a project for a particular format by creating a new {{{default.wwconfig}}} file in this location: {{{ Formats Adapters xml scripts dita default.wwconfig }}} ==== Per target ==== Users can change the configuration of all DITA files in a project for a single target by creating a new {{{default.wwconfig}}} file in this location: {{{ Targets Adapters xml scripts dita default.wwconfig }}} == Crazy Configurations == === Some tips from experience === By Zoë Lawson Occasionally, a
}}} ||Body || ||{{{ }}} ||Body || Written another way: ||'''Structure''' ||'''Style''' || ||{{{ }}} ||Title || ||{{{[count(ancestor:: or ancestor:) > 1]}}} ||Heading 1 || ||{{{}}} ||Body || Still further rewrites: ||'''Structure''' ||'''Style''' || ||{{{[count(ancestor::) = 1]}}} ||Title || ||{{{[count(ancestor:: or ancestor:) = 2]}}} ||Heading 1 || ||{{{}}} ||Body || == Mapping with XPath == This style mapping we have created seems nice, but ePublisher can't use it yet. Unless we convert it something ePublisher understands. In this case, we will convert the mapping to XPath expressions. ||'''XPath Expression''' ||'''Style''' || ||{{{title[count(ancestor::topic) = 1]}}} ||Title || ||{{{title[count(ancestor::topic or ancestor:section) = 2]}}} ||Heading 1 || ||{{{p}}} ||Body || That looks pretty good. Except DITA supports a little thing call "specialization". It means that I can give elements different names, yet process them the same way. For example, the DITA element {{{}}} is a specialization of the {{{}}} element. This is represented in DITA through DTDs in a class element. So when you see: {{{ ... ... }}} DITA sees: {{{ ... ... }}} If you want to process a {{{}}} element the same way as a {{{}}} element, you simply check for {{{" topic/topic "}}} in the {{{@class}}} attribute. And XPath expression to perform this test is: {{{ *[contains(@class, ' topic/topic ')] }}} Different behaviors for {{{}}} elements can be introduced by checking for the {{{" task/task "}}} class substring: {{{ *[contains(@class, ' task/task ')] }}} Now let's rewrite our mapping to support DITA specialization: ||'''XPath Expression''' ||'''Style''' || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ')]) = 1]}}} ||Title || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ') or contains(@class, ' topic/section ')]) = 2]}}} ||Heading 1 || ||{{{*[contains(@class, ' topic/p ')]}}} ||Body || Wow! That's a pretty long-winded way of saying that! But, hey, now we get to use DITA, DITA Specialization, and ePublisher! == Configuring ePublisher == Great, now we know how to translate structures to styles. And we even know a technology, XPath, that can help us do that. What else does ePublisher need? It needs the ePublisher DITA configuration file {{{default.wwconfig}}} of course! {{{ }}} === ePublisher DITA Configuration File Structure === The ePublisher DITA configuration file allows ePublisher to answer the following questions: 1. What style based objects does this structure represent? A paragraph? A character? A container? A table? 1. What style name should be used for this structure? ==== Types ==== First, the {{{}}} section identifies what the structure represents. From our example, we would define the following types: ||'''XPath Expression''' ||'''Type''' || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ')]) = 1]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ') or contains(@class, ' topic/section ')]) = 2]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || ||{{{*}}} ||Structure || Since all of the {{{}}} elements are really just paragraphs, we can simplify this to: ||'''XPath Expression''' ||'''Type''' || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || ||{{{*}}} ||Structure || Okay, so everything that is either a {{{}}} element or a {{{}}} element becomes a "Paragraph" and the rest become "Structure". What if we had listed the "Structure" one first? ||'''XPath Expression''' ||'''Type''' || ||{{{*}}} ||Structure || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || That would be bad, because everything in the document would be treated as "Structure"! So why allow people to do this kind of thing? Well, perhaps we'd like to get crazy and convert DITA titles {{{}}} elements to character styles: ||'''XPath Expression''' ||'''Type''' || ||{{{*[contains(@class, ' topic/title ')][count(contains(@class, ' topic/section ')]) > 0]}}} ||Character || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || ||{{{*}}} ||Structure || We can be as specific as required and ePublisher will pick the first, best match. Now, we'll return to our earlier (read simplier) example and translate it into ePublisher's required configuration file language: ||'''XPath Expression''' ||'''Type''' || ||{{{*}}} ||Structure || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || {{{ }}} ==== Styles ==== We've already covered how to map structure to styles, so now we just need to show how this information is represented in the ePublisher configuration file: ||'''XPath Expression''' ||'''Style''' || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ')]) = 1]}}} ||Title || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ') or contains(@class, ' topic/section ')]) = 2]}}} ||Heading 1 || ||{{{*[contains(@class, ' topic/p ')]}}} ||Body || {{{ }}} ==== Types and Styles Together ==== Perhaps now our little configuration file example will make a bit more sense: {{{ }}} === Overriding DITA Configurations === DITA configuration files can be overriding in four locations: 1. Per source DITA map. 1. Per project. 1. Per format. 1. Per target. ==== Per source DITA Map ==== If you have a DITA map file named {{{mymap.ditamap}}}, you can create a ePublisher configuration file with the base name of the original and use the {{{.wwconfig}}} extension. You directory goes from: {{{ mymap.ditamap }}} to: {{{ mymap.ditamap mymap.wwconfig }}} ||<#ee9999>NOTE: ||<#ee9999>This particular configuration file need only contain overrides or changes from the base {{{default.wwconfig}}} file. || ==== Per project ==== Users can change the configuration of all DITA files in a project, across formats and targets, by creating a new {{{default.wwconfig}}} file in this location: {{{ Formats Adapters xml scripts dita default.wwconfig }}} ==== Per format ==== Users can change the configuration of all DITA files in a project for a particular format by creating a new {{{default.wwconfig}}} file in this location: {{{ Formats Adapters xml scripts dita default.wwconfig }}} ==== Per target ==== Users can change the configuration of all DITA files in a project for a single target by creating a new {{{default.wwconfig}}} file in this location: {{{ Targets Adapters xml scripts dita default.wwconfig }}} == Crazy Configurations == === Some tips from experience === By Zoë Lawson Occasionally, a
}}} ||Body || Written another way: ||'''Structure''' ||'''Style''' || ||{{{ }}} ||Title || ||{{{[count(ancestor:: or ancestor:) > 1]}}} ||Heading 1 || ||{{{}}} ||Body || Still further rewrites: ||'''Structure''' ||'''Style''' || ||{{{[count(ancestor::) = 1]}}} ||Title || ||{{{[count(ancestor:: or ancestor:) = 2]}}} ||Heading 1 || ||{{{}}} ||Body || == Mapping with XPath == This style mapping we have created seems nice, but ePublisher can't use it yet. Unless we convert it something ePublisher understands. In this case, we will convert the mapping to XPath expressions. ||'''XPath Expression''' ||'''Style''' || ||{{{title[count(ancestor::topic) = 1]}}} ||Title || ||{{{title[count(ancestor::topic or ancestor:section) = 2]}}} ||Heading 1 || ||{{{p}}} ||Body || That looks pretty good. Except DITA supports a little thing call "specialization". It means that I can give elements different names, yet process them the same way. For example, the DITA element {{{}}} is a specialization of the {{{}}} element. This is represented in DITA through DTDs in a class element. So when you see: {{{ ... ... }}} DITA sees: {{{ ... ... }}} If you want to process a {{{}}} element the same way as a {{{}}} element, you simply check for {{{" topic/topic "}}} in the {{{@class}}} attribute. And XPath expression to perform this test is: {{{ *[contains(@class, ' topic/topic ')] }}} Different behaviors for {{{}}} elements can be introduced by checking for the {{{" task/task "}}} class substring: {{{ *[contains(@class, ' task/task ')] }}} Now let's rewrite our mapping to support DITA specialization: ||'''XPath Expression''' ||'''Style''' || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ')]) = 1]}}} ||Title || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ') or contains(@class, ' topic/section ')]) = 2]}}} ||Heading 1 || ||{{{*[contains(@class, ' topic/p ')]}}} ||Body || Wow! That's a pretty long-winded way of saying that! But, hey, now we get to use DITA, DITA Specialization, and ePublisher! == Configuring ePublisher == Great, now we know how to translate structures to styles. And we even know a technology, XPath, that can help us do that. What else does ePublisher need? It needs the ePublisher DITA configuration file {{{default.wwconfig}}} of course! {{{ }}} === ePublisher DITA Configuration File Structure === The ePublisher DITA configuration file allows ePublisher to answer the following questions: 1. What style based objects does this structure represent? A paragraph? A character? A container? A table? 1. What style name should be used for this structure? ==== Types ==== First, the {{{}}} section identifies what the structure represents. From our example, we would define the following types: ||'''XPath Expression''' ||'''Type''' || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ')]) = 1]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ') or contains(@class, ' topic/section ')]) = 2]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || ||{{{*}}} ||Structure || Since all of the {{{}}} elements are really just paragraphs, we can simplify this to: ||'''XPath Expression''' ||'''Type''' || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || ||{{{*}}} ||Structure || Okay, so everything that is either a {{{}}} element or a {{{}}} element becomes a "Paragraph" and the rest become "Structure". What if we had listed the "Structure" one first? ||'''XPath Expression''' ||'''Type''' || ||{{{*}}} ||Structure || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || That would be bad, because everything in the document would be treated as "Structure"! So why allow people to do this kind of thing? Well, perhaps we'd like to get crazy and convert DITA titles {{{}}} elements to character styles: ||'''XPath Expression''' ||'''Type''' || ||{{{*[contains(@class, ' topic/title ')][count(contains(@class, ' topic/section ')]) > 0]}}} ||Character || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || ||{{{*}}} ||Structure || We can be as specific as required and ePublisher will pick the first, best match. Now, we'll return to our earlier (read simplier) example and translate it into ePublisher's required configuration file language: ||'''XPath Expression''' ||'''Type''' || ||{{{*}}} ||Structure || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || {{{ }}} ==== Styles ==== We've already covered how to map structure to styles, so now we just need to show how this information is represented in the ePublisher configuration file: ||'''XPath Expression''' ||'''Style''' || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ')]) = 1]}}} ||Title || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ') or contains(@class, ' topic/section ')]) = 2]}}} ||Heading 1 || ||{{{*[contains(@class, ' topic/p ')]}}} ||Body || {{{ }}} ==== Types and Styles Together ==== Perhaps now our little configuration file example will make a bit more sense: {{{ }}} === Overriding DITA Configurations === DITA configuration files can be overriding in four locations: 1. Per source DITA map. 1. Per project. 1. Per format. 1. Per target. ==== Per source DITA Map ==== If you have a DITA map file named {{{mymap.ditamap}}}, you can create a ePublisher configuration file with the base name of the original and use the {{{.wwconfig}}} extension. You directory goes from: {{{ mymap.ditamap }}} to: {{{ mymap.ditamap mymap.wwconfig }}} ||<#ee9999>NOTE: ||<#ee9999>This particular configuration file need only contain overrides or changes from the base {{{default.wwconfig}}} file. || ==== Per project ==== Users can change the configuration of all DITA files in a project, across formats and targets, by creating a new {{{default.wwconfig}}} file in this location: {{{ Formats Adapters xml scripts dita default.wwconfig }}} ==== Per format ==== Users can change the configuration of all DITA files in a project for a particular format by creating a new {{{default.wwconfig}}} file in this location: {{{ Formats Adapters xml scripts dita default.wwconfig }}} ==== Per target ==== Users can change the configuration of all DITA files in a project for a single target by creating a new {{{default.wwconfig}}} file in this location: {{{ Targets Adapters xml scripts dita default.wwconfig }}} == Crazy Configurations == === Some tips from experience === By Zoë Lawson Occasionally, a
}}} ||Body || Still further rewrites: ||'''Structure''' ||'''Style''' || ||{{{
}}} ||Body || == Mapping with XPath == This style mapping we have created seems nice, but ePublisher can't use it yet. Unless we convert it something ePublisher understands. In this case, we will convert the mapping to XPath expressions. ||'''XPath Expression''' ||'''Style''' || ||{{{title[count(ancestor::topic) = 1]}}} ||Title || ||{{{title[count(ancestor::topic or ancestor:section) = 2]}}} ||Heading 1 || ||{{{p}}} ||Body || That looks pretty good. Except DITA supports a little thing call "specialization". It means that I can give elements different names, yet process them the same way. For example, the DITA element {{{}}} is a specialization of the {{{}}} element. This is represented in DITA through DTDs in a class element. So when you see: {{{ ... ... }}} DITA sees: {{{ ... ... }}} If you want to process a {{{}}} element the same way as a {{{}}} element, you simply check for {{{" topic/topic "}}} in the {{{@class}}} attribute. And XPath expression to perform this test is: {{{ *[contains(@class, ' topic/topic ')] }}} Different behaviors for {{{}}} elements can be introduced by checking for the {{{" task/task "}}} class substring: {{{ *[contains(@class, ' task/task ')] }}} Now let's rewrite our mapping to support DITA specialization: ||'''XPath Expression''' ||'''Style''' || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ')]) = 1]}}} ||Title || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ') or contains(@class, ' topic/section ')]) = 2]}}} ||Heading 1 || ||{{{*[contains(@class, ' topic/p ')]}}} ||Body || Wow! That's a pretty long-winded way of saying that! But, hey, now we get to use DITA, DITA Specialization, and ePublisher! == Configuring ePublisher == Great, now we know how to translate structures to styles. And we even know a technology, XPath, that can help us do that. What else does ePublisher need? It needs the ePublisher DITA configuration file {{{default.wwconfig}}} of course! {{{ }}} === ePublisher DITA Configuration File Structure === The ePublisher DITA configuration file allows ePublisher to answer the following questions: 1. What style based objects does this structure represent? A paragraph? A character? A container? A table? 1. What style name should be used for this structure? ==== Types ==== First, the {{{}}} section identifies what the structure represents. From our example, we would define the following types: ||'''XPath Expression''' ||'''Type''' || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ')]) = 1]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ') or contains(@class, ' topic/section ')]) = 2]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || ||{{{*}}} ||Structure || Since all of the {{{}}} elements are really just paragraphs, we can simplify this to: ||'''XPath Expression''' ||'''Type''' || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || ||{{{*}}} ||Structure || Okay, so everything that is either a {{{}}} element or a {{{}}} element becomes a "Paragraph" and the rest become "Structure". What if we had listed the "Structure" one first? ||'''XPath Expression''' ||'''Type''' || ||{{{*}}} ||Structure || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || That would be bad, because everything in the document would be treated as "Structure"! So why allow people to do this kind of thing? Well, perhaps we'd like to get crazy and convert DITA titles {{{}}} elements to character styles: ||'''XPath Expression''' ||'''Type''' || ||{{{*[contains(@class, ' topic/title ')][count(contains(@class, ' topic/section ')]) > 0]}}} ||Character || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || ||{{{*}}} ||Structure || We can be as specific as required and ePublisher will pick the first, best match. Now, we'll return to our earlier (read simplier) example and translate it into ePublisher's required configuration file language: ||'''XPath Expression''' ||'''Type''' || ||{{{*}}} ||Structure || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || {{{ }}} ==== Styles ==== We've already covered how to map structure to styles, so now we just need to show how this information is represented in the ePublisher configuration file: ||'''XPath Expression''' ||'''Style''' || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ')]) = 1]}}} ||Title || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ') or contains(@class, ' topic/section ')]) = 2]}}} ||Heading 1 || ||{{{*[contains(@class, ' topic/p ')]}}} ||Body || {{{ }}} ==== Types and Styles Together ==== Perhaps now our little configuration file example will make a bit more sense: {{{ }}} === Overriding DITA Configurations === DITA configuration files can be overriding in four locations: 1. Per source DITA map. 1. Per project. 1. Per format. 1. Per target. ==== Per source DITA Map ==== If you have a DITA map file named {{{mymap.ditamap}}}, you can create a ePublisher configuration file with the base name of the original and use the {{{.wwconfig}}} extension. You directory goes from: {{{ mymap.ditamap }}} to: {{{ mymap.ditamap mymap.wwconfig }}} ||<#ee9999>NOTE: ||<#ee9999>This particular configuration file need only contain overrides or changes from the base {{{default.wwconfig}}} file. || ==== Per project ==== Users can change the configuration of all DITA files in a project, across formats and targets, by creating a new {{{default.wwconfig}}} file in this location: {{{ Formats Adapters xml scripts dita default.wwconfig }}} ==== Per format ==== Users can change the configuration of all DITA files in a project for a particular format by creating a new {{{default.wwconfig}}} file in this location: {{{ Formats Adapters xml scripts dita default.wwconfig }}} ==== Per target ==== Users can change the configuration of all DITA files in a project for a single target by creating a new {{{default.wwconfig}}} file in this location: {{{ Targets Adapters xml scripts dita default.wwconfig }}} == Crazy Configurations == === Some tips from experience === By Zoë Lawson Occasionally, a
}}} element becomes a "Paragraph" and the rest become "Structure". What if we had listed the "Structure" one first? ||'''XPath Expression''' ||'''Type''' || ||{{{*}}} ||Structure || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || That would be bad, because everything in the document would be treated as "Structure"! So why allow people to do this kind of thing? Well, perhaps we'd like to get crazy and convert DITA titles {{{}}} elements to character styles: ||'''XPath Expression''' ||'''Type''' || ||{{{*[contains(@class, ' topic/title ')][count(contains(@class, ' topic/section ')]) > 0]}}} ||Character || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || ||{{{*}}} ||Structure || We can be as specific as required and ePublisher will pick the first, best match. Now, we'll return to our earlier (read simplier) example and translate it into ePublisher's required configuration file language: ||'''XPath Expression''' ||'''Type''' || ||{{{*}}} ||Structure || ||{{{*[contains(@class, ' topic/title ')]}}} ||Paragraph || ||{{{*[contains(@class, ' topic/p ')]}}} ||Paragraph || {{{ }}} ==== Styles ==== We've already covered how to map structure to styles, so now we just need to show how this information is represented in the ePublisher configuration file: ||'''XPath Expression''' ||'''Style''' || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ')]) = 1]}}} ||Title || ||{{{*[contains(@class, ' topic/title ')][count(ancestor::*[contains(@class, ' topic/topic ') or contains(@class, ' topic/section ')]) = 2]}}} ||Heading 1 || ||{{{*[contains(@class, ' topic/p ')]}}} ||Body || {{{ }}} ==== Types and Styles Together ==== Perhaps now our little configuration file example will make a bit more sense: {{{ }}} === Overriding DITA Configurations === DITA configuration files can be overriding in four locations: 1. Per source DITA map. 1. Per project. 1. Per format. 1. Per target. ==== Per source DITA Map ==== If you have a DITA map file named {{{mymap.ditamap}}}, you can create a ePublisher configuration file with the base name of the original and use the {{{.wwconfig}}} extension. You directory goes from: {{{ mymap.ditamap }}} to: {{{ mymap.ditamap mymap.wwconfig }}} ||<#ee9999>NOTE: ||<#ee9999>This particular configuration file need only contain overrides or changes from the base {{{default.wwconfig}}} file. || ==== Per project ==== Users can change the configuration of all DITA files in a project, across formats and targets, by creating a new {{{default.wwconfig}}} file in this location: {{{ Formats Adapters xml scripts dita default.wwconfig }}} ==== Per format ==== Users can change the configuration of all DITA files in a project for a particular format by creating a new {{{default.wwconfig}}} file in this location: {{{ Formats Adapters xml scripts dita default.wwconfig }}} ==== Per target ==== Users can change the configuration of all DITA files in a project for a single target by creating a new {{{default.wwconfig}}} file in this location: {{{ Targets Adapters xml scripts dita default.wwconfig }}} == Crazy Configurations == === Some tips from experience === By Zoë Lawson Occasionally, a