## page was renamed from HelpCenter/Howtos/XMLTransformChanges ## page was renamed from HelpCenter/Tips/XMLTransformChanges #format rst ===================== XML Transform Changes ===================== .. contents:: Table of Contents .. section-numbering:: Migration Issues ================ For the 9.2 release of ePublisher Pro, AutoMap, and Express, we have moved from version 1.1 of Microsoft's .NET platform to version 2.0. .NET 2.0 includes many improvements related to execution speed and overall application memory usage. Unfortunately, certain XSL transform behaviors have changed from .NET 1.1 to .NET 2.0. As a result, existing ePublisher 9.0 and 9.1 formats may not behave as expected. Formats and Override Resolution =============================== ePublisher 9.2 introduces new ways to work with formats. * Project Target Overrides * Shared Transform Overrides * Project Formats * Standalone Stationery * User Format Limitations Project Target Overrides ------------------------ In versions 9.0 and 9.1, ePublisher allowed users to override files, images, and transforms on a per target basis. This was implemented with a "Formats" folder in the project directory. For 9.2, the current "Formats" folder has been renamed "Targets" to accurately reflect that these overrides are applied on a per target basis. The "Formats" folder still exists, but now applies to per format overrides. See `Project Formats`_ below. Shared Transform Overrides -------------------------- While users could override all format related files via project target overrides, there was no mechanism for users to override ePublisher's application transforms, stored in:: C:\Program Files\ePublisher Pro\Transforms Certain changes could only be made in this area and therefore complicated deployment issues for customers. ePublisher 9.2 has renamed and relocated the "Transforms" folder to enable full override control. Application Folder Transforms There are now "Shared" transform folders which can exist in various locations:: Project Folder Targets Shared Formats Shared Shared User Formats Folder Shared Shared Application Folder Formats Shared Shared Users may now override shared transforms with various levels of control. Project Formats --------------- As hinted above, projects may now contain a "Formats" folder. Any files in the project "Formats" folder override underlying User and Application format files. For products such as Express, this is important as Express does not support User and Application formats. Users can even override "format.wwfmt" files at this level to introduce new stages and pipelines or modify existing ones. Standalone Stationery --------------------- Stationery which includes a "Formats" folder becomes a self-contained snapshot of a given format and all dependant transforms, including those in the "Shared" directory. User Format Limitations ----------------------- To avoid issues with user formats overriding application formats, user formats must have unique names. If an application format is found with a certain name, say "WebWorks Help 5.0", then any user formats with that same name will not be available in ePublisher projects. XSL and .NET ============ As ePublisher relies on the .NET XSL transform engine, changes in .NET can alter the behavior and performance of ePublisher. XSL Behavior Changes -------------------- Node Fragments ############## .NET 1.1 ~~~~~~~~ In .NET 1.1, the XSL runtime often blurred the line between XML node fragements and XML node sets. So the following code worked in .NET 1.1 XSL transforms:: Wow! Wow! .NET 2.0 ~~~~~~~~ The XSL 1.1 specification states that node fragments are distinct from node sets and XSL processors should not allow them to be used interchangably. The .NET 2.0 XSL runtime strictly enforces this policy. Therefore, XSL developers must explicitly convert node fragments to node sets via the Microsoft msxsl:node-set() method. Empty Element Handling ###################### .NET 1.1 ~~~~~~~~ In .NET 1.1, XML elements were always written literally. So, XSL code to emit a non-empty element:: results in:: This meant that elements could be problematic because they must be empty elements:: results in:: This is not appropriate for HTML or XHTML output. Therefore, two work-arounds were used in ePublisher 9.0 and 9.1:: Value Attribute Templates:: wwexsldoc:MakeEmptyElement() extension method:: Either method produces the required empty element:: .NET 2.0 ~~~~~~~~ In .NET 2.0, XML elements are automatically optimized by the XSL/XML runtime. So there is no need to use work-arounds such as Value Attribute Templates and wwexsldoc:MakeEmptyElement():: results in:: Unfortunately, this is a problem for elements such as being emitted as:: Text: Unchanged from the standard .NET behavior. XHTML: Allow only the following elements to emit as empty elements::

XML: Unchanged from the standard .NET behavior. White Space Preservation ######################## To enable control over white space between XML elements, ePublisher 9.2 introduces a element:: which results in the expected:: First letter and word are different. URI Escaping ============ In .NET 1.1, it was possible to work with URIs without escaping encoding all characters. For example, a call to determine a relative URI such as:: results in:: With A Space.html In .NET 2.0, URIs are always escape encoded, so the same call above returns:: With%20A%20Space.html By and large, this is a good improvement. However, this causes issues with the current Java based formats, JavaHelp 1.1.3, JavaHelp 2.0, and Oracle Help. Quadralay will update the Java base formats to workaround this issue, but it might cause side-effects in your own projects. Utility methods to encode/decode URIs have been added to the "wwuri" extension name space:: EscapeUri(string unescapedUri) EscapeData(string unescapedString) Unescape(string escapedString)