Docbook

From iDempiere en

<just note it. complete late>

https://idempiere.atlassian.net/browse/IDEMPIERE-2223

with saxon65.jar at "docbook-xsl-1.78.1/extensions" i encounter error class not found with class "com.icl.saxon.style.ExtensionElementFactory" so use new version saxon6-5-5 at http://sourceforge.net/projects/saxon/files/saxon6/6.5.5/saxon6-5-5.zip/download?use_mirror=jaist

saxon6-5-5 can transform po success, but when i run validate (before i run validate without saxon in classpath, it success) i encounter error com.icl.saxon.aelfred.SAXDriver don't support http://xml.org/sax/features/validation so i update saxon to Saxon-HE 9.6 and it's ok.

for xinclude, i use xsltool in eclipse. sure you install xsl core in http://download.eclipse.org/webtools/updates/ after that, go to "/eclipse/plugins" and copy file org.eclipse.wst.xsl.core_xxx.jar also copy file org.eclipse.osgi_xxx.jar because org.eclipse.wst.xsl.core_xxx.jar need it.

in ant build.xml add:

task define: <taskdef name="xsl.xinclude" classname="org.eclipse.wst.xsl.core.internal.ant.XIncludeTask" />

define a task for merged xml file

<target name = "xmltask">

   <xsl.xinclude in="${src}/book.xml"
                 out="${output.tmp}/book.xml"/>  	  	

</target>


add validate task to ensure all source file xml is correct. i check before and after merged, to build process is stop soonest. <target name = "pre-validate">

  <xmlvalidate failonerror="yes" lenient="no" warn="yes">
     <fileset dir="${src}">
        <include name="**/*.xml" />
     </fileset>	  	 
  </xmlvalidate>

</target>

<xmlvalidate failonerror="yes" lenient="no" warn="yes">

   <fileset dir="${output.tmp}">
       <include name="**/*.xml" />
   </fileset>	  	 

</xmlvalidate>

with <xi:include /> tag in xml file, validate will don't pass. to prevent this i do follow guideline at http://www.sagehill.net/docbookxsl/ValidXinclude.html#XincludeDTD

1. create file call xinclude.mod with content below <!ELEMENT xi:include (xi:fallback?) > <!ATTLIST xi:include

   xmlns:xi   CDATA       #FIXED    "http://www.w3.org/2001/XInclude"
   href       CDATA       #IMPLIED
   parse      (xml|text)  "xml"
   xpointer   CDATA       #IMPLIED
   encoding   CDATA       #IMPLIED 
   accept     CDATA       #IMPLIED
   accept-language CDATA  #IMPLIED >

<!ELEMENT xi:fallback ANY> <!ATTLIST xi:fallback

   xmlns:xi   CDATA   #FIXED   "http://www.w3.org/2001/XInclude" >

<!ENTITY % local.chapter.class "| xi:include"> <!ENTITY % local.divcomponent.mix "| xi:include"> <!ENTITY % local.para.char.mix "| xi:include"> <!ENTITY % local.info.class "| xi:include">

2. at xml file use tag <xi:include /> change doctype as below <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"

          [
              <!ENTITY % xinclude SYSTEM "../xinclude.mod">
              %xinclude;
          ]>

path to xinclude.mod depend position of xml file

Cookies help us deliver our services. By using our services, you agree to our use of cookies.