Wednesday 15 April 2015

xslt - XSL 2.0 Transform XML files while preserving folder structure -


I have a XSL Transformation functioning to change a bunch of XML files from one format to another, though I now have two unresolved problems:

1) First, when I change the files, I need to adjust my parameters in style sheets to target only files with more than 7 characters for;

2) Secondly, I should be able to change all the files while preserving the folder structure of source files. I was thinking that there is no way to preserve the same folder structure from the source folder. All files are located in named folder based on the alphabet, such as A, B, C, D, F .... so I have to convert all the files in folder A and put them in the new folder named A. The files are also named after alphabetical order.

Here is my style sheet:

   & Lt; Xsl: Ultimate name = "files" select = "archive ('../dit./b.??list==.data; rears = yes')" /> & Lt ;! - & lt; Xsl: variable name = "filename" select = "concat ($ files, status (), 'subject')" /> - & gt; & Lt; Xsl: template match = "node ()" & gt; & Lt; Xsl: copy copy-namespaces = "no" & gt; & Lt; Xsl: apply-select template = "node ()" /> & Lt; / XSL: Copy & gt; & Lt; / XSL: Templates & gt; & Lt; Xsl: template match = "/" & gt; & Lt; Xsl: each selection = "$ files // theme" & gt; & Lt; Xsl: if test = "string-length length (files) & amp; 10;" Gt; & Lt ;! - Not working, its purpose is to drop all the files whose length is less than two letters - & gt; & Lt; Xsl: select value = "text ()" disable-output-escaping = "yes" /> & Lt; / XSL: If & gt; & Lt; Xsl: result-document href = "output DITNEU / B / {title / text} | title / b / text ()} .diet" & gt; & Lt; Glossentry id = "{concat ('test', generate-id ())" & gt; & Lt; Glossstorm id = "{conat ('test_title', generated-id ())}" & gt; & Lt; Xsl: Select Value = "Title" /> & Lt; / Glossterm & gt; & Lt; Glossdef> & Lt; Xsl: each-select = "body" & gt; & Lt; XSL: implemented-templates / & gt; & Lt; / XSL: for-each & gt; & Lt; / Glossdef> & Lt; / Glossentry & gt; & Lt; / XSL: Results-Documents & gt; & Lt; / XSL: for-each & gt; & Lt; / XSL: Templates & gt; & Lt; / XSL: stylesheet & gt;   

Thanks.

(A) Choose = *. Dita is actually a regular expression that has a mask in the form of a globe, and you select = [A-Za-z0- 9] {7,}. Dita should be able to use something like . / P>

(B) function Documents-Yuri () The input file applied to a file returns the URI if known, and requires you to require the output file name.

No comments:

Post a Comment