Changes between Version 23 and Version 24 of XsltMacro
- Timestamp:
- Nov 8, 2015, 3:44:13 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
XsltMacro
v23 v24 1 1 [[PageOutline(2-5,Contents,pullout)]] 2 = XSL-Transformation Macro = 2 3 = XSL-Transformation Macro 3 4 4 5 == Description == 5 6 6 The XsltMacro allows you to embed the result of an XSL-transformation 7 in a page. It takes two parameters, a stylesheet and a document to 8 transform. These can be an attachment on any wiki-page or ticket, any 9 page from the htdocs area, any file in the repository, or any url 10 (these options are similar to those for Trac's native 11 [http://projects.edgewall.com/trac/wiki/WikiMacros#AvailableMacros ImageMacro]). 7 The XsltMacro allows you to embed the result of an XSL-transformation in a page. It takes two parameters, a stylesheet and a document to transform. These can be an attachment on any wiki-page or ticket, any page from the htdocs area, any file in the repository, or any url (these options are similar to those for Trac's native [http://projects.edgewall.com/trac/wiki/WikiMacros#AvailableMacros ImageMacro]). 12 8 For more details see the documentation in the macro. 13 9 14 The macro can either be installed as a simple macro or as a plugin; 15 the ''use_iframe'' and ''use_object'' options (see below) only work 16 when installed as a plugin. 10 The macro can either be installed as a simple macro or as a plugin; the ''use_iframe'' and ''use_object'' options (see below) only work when installed as a plugin. 17 11 18 This macro requires that [http://xmlsoft.org/ libxml2], 19 [http://xmlsoft.org/ libxslt], and their python bindings are 20 installed. 12 This macro requires that [http://xmlsoft.org/ libxml2], [http://xmlsoft.org/ libxslt], and their python bindings are installed. 21 13 14 === IFrames/Objects 22 15 23 == IFrames/Objects == 16 Because a macro's output is embedded in the html of the wiki page, the xsl-stylesheet must not produce a full html page. As an alternative, you can pass the ''use_iframe'' or ''use_object'' option to the macro; this will cause the macro put an <iframe> or <object> tag (respectively) into the page instead of the results from the stylesheet. The stylesheet can (and must) then generate a complete html page. 24 17 25 Because a macro's output is embedded in the html of the wiki page, the 26 xsl-stylesheet must not produce a full html page. As an alternative, 27 you can pass the ''use_iframe'' or ''use_object'' option to the macro; 28 this will cause the macro put an <iframe> or <object> tag 29 (respectively) into the page instead of the results 30 from the stylesheet. The stylesheet can (and must) then generate a 31 complete html page. 18 The downside of iframes/objects is that you need to know the height of the result in order to set the height of the iframe/object; otherwise you will either get extra space at the bottom or you'll have to scroll through the frame. The macro generates some javascript to automatically set this height, but that only works if the user has javascript enabled of course. 32 19 33 The downside of iframes/objects is that you need to know the height of 34 the result in order to set the height of the iframe/object; otherwise 35 you'll either get extra space at the bottom or you'll have to scroll 36 through the frame. The macro generates some javascript to 37 automatically set this height, but that only works if the user has 38 javascript enabled of course. 39 40 == Bugs/Feature Requests == 20 == Bugs/Feature Requests 41 21 42 22 Existing bugs and feature requests for XsltMacro are … … 44 24 45 25 If you have any issues, create a 46 [ http://trac-hacks.org/newticket?component=XsltMacro&owner=roadrunnernew ticket].26 [/newticket?component=XsltMacro new ticket]. 47 27 48 == Download == 28 [[TicketQuery(component=XsltMacro&group=type,format=progress)]] 49 29 50 If you're running trac 0.9 or 0.10 and want to install this as a 51 simple macro, then just download 52 [http://trac-hacks.org/svn/xsltmacro/0.9/xslt/Xslt.py this file] and 53 put it in your {{{wiki-macros}}} directory. 30 == Download 54 31 55 To install as a plugin, download the [download:xsltmacro zipped source], 56 unzip, change the directory to {{{xsltmacro/0.9}}} (for trac 0.9 or 0.10) 57 or {{{xsltmacro/0.11}}} (for trac 0.11 or 0.12), run[[BR]] 32 If you're running Trac 0.9 or 0.10 and want to install this as a simple macro, then just download [http://trac-hacks.org/svn/xsltmacro/0.9/xslt/Xslt.py this file] and put it in your {{{wiki-macros}}} directory. 33 34 To install as a plugin, download the [download:xsltmacro zipped source], unzip, change the directory to {{{xsltmacro/0.9}}} (for Trac 0.9 or 0.10) 35 or {{{xsltmacro/0.11}}} (for Trac 0.11 or 0.12), run: 36 58 37 {{{python setup.py bdist_egg}}}, and copy the resulting 59 38 {{{dist/xslt-0.X-pyY.Z.egg}}} to your plugins directory. 60 39 61 == Source ==40 == Source 62 41 63 You can check out XsltMacro from [http://trac-hacks.org/svn/xsltmacro here] 64 using Subversion, or [source:xsltmacro browse the source] with Trac. 42 You can check out XsltMacro from [/svn/xsltmacro here] using Subversion, or [source:xsltmacro browse the source] with Trac. 65 43 66 == Example ==44 == Example 67 45 68 46 The following table is produced with this macro call: … … 70 48 [[Xslt(format.xsl, info.xml)]] 71 49 }}} 72 {{{ 73 #!html50 51 {{{#!html 74 52 <table border="1"> 75 53 <tr> … … 98 76 For the full docs see the WikiMacros page after installing this macro. 99 77 100 == Recent Changes ==78 == Recent Changes 101 79 102 80 [[ChangeLog(xsltmacro, 3)]] 103 81 104 == Author/Contributors ==82 == Author/Contributors 105 83 106 84 '''Author:''' [wiki:roadrunner] [[BR]] 107 '''Maintainer:''' [ wiki:roadrunner] [[BR]]85 '''Maintainer:''' [[Maintainer]] [[BR]] 108 86 '''Contributors:''' wuxxin at gmail.com 109 87 110 == User Comments ==88 == User Comments 111 89 112 ==== Comment by anonymous on Ma 06 iun 2006 06:46:14 EST ==== 90 ==== Comment by anonymous on Ma 06 iun 2006 06:46:14 EST 91 113 92 ''A hacked version of Xslt.py able to use external url's as doc or style.'' 114 93 … … 126 105 wuxxin at gmail.com 127 106 107 ==== Comment by roadrunner on Du 18 iun 2006 22:37:02 EST 128 108 129 ==== Comment by roadrunner on Du 18 iun 2006 22:37:02 EST ====130 109 Excellent idea! Thank you. Committed (with some fixes and cleanups) as rev [906]. 131 110 132 ==== Comment by Andrei on Du 17 sep 2006 18:36:25 EST ==== 111 ==== Comment by Andrei on Du 17 sep 2006 18:36:25 EST 112 133 113 I would like to transform RSS output from WordPress and use Trac as my homepage and include a side blog section that links to the real blog. 134 114 135 ==== Comment by roadrunner on Sat Sep 30 19:10:49 2006 ==== 136 You could probably (mis)use the wiki-toc css class for this (or 137 better: provide some css of your own) and use a stylesheet along 138 the lines of (untested): 115 ==== Comment by roadrunner on Sat Sep 30 19:10:49 2006 116 117 You could probably (mis)use the wiki-toc css class for this (or better: provide some css of your own) and use a stylesheet along the lines of (untested): 139 118 {{{ 140 119 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> … … 157 136 </xsl:stylesheet> 158 137 }}} 159 160 161 ==== Comment by anonymous on Tue Dec 26 02:07:17 2006 ====162 iframe is non-standard nowadays, is it possible to produce "object" tags instead too?163 164 165 ==== Comment by anonymous on Tue Dec 26 02:07:20 2006 ====166 iframe is non-standard nowadays, is it possible to produce "object" tags instead too?167 168 169 ==== Comment by roadrunner on Wed Jan 3 18:56:25 2007 ====170 Done. Available in the new 0.5 release.