Is there an application to generate XML Stylesheet from XML file? I have a very complicated XML file, which is a well-formed SVG file.
Is there a software application to convert XML into XSL?
On your basis, I believe that you want to create an XSL-FO file from the SVG image.
An option is just an inline image in SVG one by using a full example (using SVG image):
& lt; Fo: root xmlns: fo = "http://www.w3.org/1999/XSL/Format" & gt; & Lt; To: Layout-Guru-Set & gt; & Lt; Fo: ordinary page master master-name = "master" & gt; & Lt; Fo: area-body / & gt; & Lt; For /: Simple-Page Master & gt; & Lt; For /: Layout-Guru-Set & gt; & Lt; Fo: Page-Sequence Master-Reference = "Master" & gt; & Lt; Fo: flow flow -name = "xls-field-body" & gt; & Lt; To: Block & gt; & Lt; For: Section-Foreign Object & gt; & Lt; Svg xmlns = "http://www.w3.org/2000/svg" width = "200" height = "200" & gt; & Lt; Circle cx = "100" cy = "100" r = "50" stroke = "black" stroke-width = "5" fill = "red" /> & Lt; / Svg & gt; & Lt; For /: Section-External Object & gt; & Lt; For /: Block & gt; & Lt; For /: Flow & gt; & Lt; For /: Page-Sequence & gt; & Lt; For /: root & gt;
Another option would be to reference the SVG image one by one:
& lt; Fo: External-Graphic src = "Svg_example4.svg" />
If you want to automate it, then you can simply write an XSLT that converts SVG to SSL G embedded in XSL-FO document:
& lt; Xsl: stylesheet xmlns: xsl = "http://www.w3.org/1999/XSL/Transform" version = "1.0" & gt; & Lt; Xsl: template match = "/" & gt; & Lt; Fo: root xmlns: fo = "http://www.w3.org/1999/XSL/Format" & gt; & Lt; To: Layout-Guru-Set & gt; & Lt; Fo: ordinary page master master-name = "master" & gt; & Lt; Fo: area-body / & gt; & Lt; For /: Simple-Page Master & gt; & Lt; For /: Layout-Guru-Set & gt; & Lt; Fo: Page-Sequence Master-Reference = "Master" & gt; & Lt; Fo: flow flow -name = "xls-field-body" & gt; & Lt; To: Block & gt; & Lt; For: Section-Foreign Object & gt; & Lt; Xsl: copy-of select = "." / & Gt; & Lt; For /: Section-External Object & gt; & Lt; For /: Block & gt; & Lt; For /: Flow & gt; & Lt; For /: Page-Sequence & gt; & Lt; For /: root & gt; & Lt; / XSL: Templates & gt; & Lt; / XSL: stylesheet & gt;
Comments
Post a Comment