Search Results

Search found 837 results on 34 pages for 'xsl'.

Page 14/34 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • XML cross-browser support

    - by 1anthony1
    I need help getting the file to run in Firefox: I have tried adapting scripts so that my file runs in both IE and Firefox but so far it still only works in IE. (The file can be tested at http://www.eyle.org/crosstest.html - simply type the word Mike in the text box using IE (doesn't work in Firefox).The HTML document is: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script type="text/javascript"> var xmlDoc; //loads xml using either IE or firefox function loadXmlDoc() { //test for IE if(window.ActiveXObject) { xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); xmlDoc.async = false; xmlDoc.load("books2.xml"); } //test for Firefox else if(document.implementation && document.implementation.createDocument) { xmlDoc = document.implementation.createDocument("","",null); xmlDoc.load("books2.xml"); } //if neither else {document.write("xml file did not load");} } //window.onload = loadXmlDoc(); var subject; //getDetails adds value of txtField to var subject in outputgroup(subject) function getDetails() { //either this or window.onload = loadXmlDoc is needed loadXmlDoc(); var subject = document.getElementById("txtField1").value; function outputgroup(subject) { var xslt = new ActiveXObject("Msxml2.XSLTemplate"); var xslDoc = new ActiveXObject("Msxml2.FreeThreadedDOMDocument"); var xslProc; xslDoc.async = false; xslDoc.resolveExternals = false; xslDoc.load("contains3books.xsl"); xslt.stylesheet = xslDoc; xslProc = xslt.createProcessor(); xslProc.input = xmlDoc; xslProc.addParameter("subj", subject); xslProc.transform(); document.write(xslProc.output); } outputgroup(subject); } </script> </head> <body> <input type="text" id="txtField1"> <input type="submit" onClick="getDetails(); return false"> </body> </html> The file includes books2.xml and contains3books.xsl (I have put the code for these files at ...ww.eyle.org/books2.xml ...ww.eyle.org/contains3books.xsl) (NB: replace ...ww. with http: // www)

    Read the article

  • Trying to use an Xslt for an xml in asp.net

    - by Josemalive
    Hello, i have the following xslt sheet: <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:variable name="nhits" select="Answer[@nhits]"></xsl:variable> <xsl:output method="html" indent="yes"/> <xsl:template match="/"> <div> <xsl:call-template name="resultsnumbertemplate"/> </div> </xsl:template> <xsl:template name="resultsnumbertemplate"> <xsl:value-of select="$nhits"/> matches found </xsl:template> </xsl:stylesheet> And this is the xml that im trying to mix with the previous xslt: <Answer xmlns="exa:com.exalead.search.v10" context="n%3Dsl-ocu%26q%3Dlavadoras" last="9" estimated="false" nmatches="219" nslices="0" nhits="219" start="0"> <time> <Time interrupted="false" overall="32348" parse="0" spell="0" exec="1241" synthesis="15302" cats="14061" kwds="14061"> <sliceTimes>15272 </sliceTimes> </Time> </time> </Answer> Im using a xslcompiledtransform and that's working fine: XslCompiledTransform transformer = new XslCompiledTransform(); transformer.Load(HttpContext.Current.Server.MapPath("xslt\\" + requestvariables["xslsheet"].ToString())); transformer.Transform(xmlreader, null, writer); My problems comes when im trying to put into a variable the "nhits" attribute value placed on the Answer element, but i'm not rendering anything using my xslt sheet. Do you know what could be the cause? Could be the xmlns attribute in my xml file? Thanks in advance. Best Regards. Jose

    Read the article

  • Actually XSLT Lookup (Store variables during loop and use in it another template)

    - by krisvandenbergh
    Is there a way to store a variable/param during a for-each loop in a sort of array, and use it in another template, namely <xsl:template match="Foundation.Core.Classifier.feature">. All the classname values that appear during the for-each should be stored. How would you implement that in XSLT? Here's my current code. <xsl:for-each select="Foundation.Core.Class"> <xsl:for-each select="Foundation.Core.ModelElement.name"> <xsl:param name="classname"> <xsl:value-of select="Foundation.Core.ModelElement.name"/> </xsl:param> </xsl:for-each> <xsl:apply-templates select="Foundation.Core.Classifier.feature" /> </xsl:for-each> Here's the template in which the classname parameters should be used. <xsl:template match="Foundation.Core.Classifier.feature"> <xsl:for-each select="Foundation.Core.Attribute"> <owl:DatatypeProperty rdf:ID="{Foundation.Core.ModelElement.name}"> <rdfs:domain rdf:resource="$classname" /> </owl:DatatypeProperty> </xsl:for-each> </xsl:template> The input file can be found at http://krisvandenbergh.be/uml_pricing.xml

    Read the article

  • Access data of a XSL file from a JSF...

    - by Asela
    Hi all, I'm having 2 simple XML & XSL files as follows. form_1.xml <?xml version="1.0" encoding="windows-1252"?> <?xml-stylesheet type="text/xsl" href="form_1.xsl"?> <myform> </myform> form_1.xsl <?xml version="1.0" encoding="windows-1252"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="myform"> <html> <body> <form> <div align="center"> <h2>My first form in XSL</h2> <table cellspacing="1" cellpadding="1"> <tr> <td>First name : </td> <td> <input type="text"></input> </td> </tr> <tr> <td>Last name : </td> <td> <input type="text"></input> </td> </tr> <tr> <td>Address : </td> <td> <input type="text"></input> </td> </tr> </table> </div> </form> </body> </html> </xsl:template> </xsl:stylesheet> Now I have a JSF file where I have embeded the form_1.xml file inside an iFrame. Inside my JSF, I have submit & reset buttons as follows. myJsf.xhtml <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:utils="http://java.sun.com/jsf/composite/utils"> <h:head> <title>::: The form filler application :::</title> <link href="./css/styles.css" rel="stylesheet" type="text/css" /> </h:head> <h:body> <div align="center"> <table cellspacing="2" cellpadding="2"> <tr> <th class="title">&nbsp; My form filler &nbsp;</th> </tr> </table> <br /> <fieldset><legend>Fill appropriate data in the following form</legend> <h:form> <div align="center"> <table> <tr> <td colspan="2"><iframe src="form_1.xml" frameborder="0" width="500px" height="500px"></iframe></td> </tr> <tr></tr> <tr> <td align="right"><h:commandButton value="Save data" action="#{myManagedBean.printValuesEnteredInTheForm}" /></td> <td align="left"><h:commandButton type="reset" value="Clear" /></td> </tr> </table> </div> </h:form></fieldset> </div> </h:body> </html> Now my question is that upon clicking the Submit button in my JSF, how do I access the values which I have entered in the XSL file? Any help is greatly appreciated. Thanks in advance. Reagrds, Asela.

    Read the article

  • Is it possible to navigate to the parent node of a matched node during XSLT processing?

    - by Darin
    I'm working with an OpenXML document, processing the main document part with some XSLT. I've selected a set of nodes via <xsl:template match="w:sdt"> </xsl:template> In most cases, I simply need to replace that matched node with something else, and that works fine. BUT, in some cases, I need to replace not the w:sdt node that matched, but the closest w:p ancestor node (ie the first paragraph node that contains the sdt node). The trick is that the condition used to decide one or the other is based on data derived from the attributes of the sdt node, so I can't use a typical xslt xpath filter. I'm trying to do something like this <xsl:template match="w:sdt"> <xsl:choose> <xsl:when test={first condition}> {apply whatever templating is necessary} </xsl:when> <xsl:when test={exception condition}> <!-- select the parent of the ancestor w:p nodes and apply the appropriate templates --> <xsl:apply-templates select="(ancestor::w:p)/.." mode="backout" /> </xsl:when> </xsl:choose> </xsl:template> <!-- by using "mode", only this template will be applied to those matching nodes from the apply-templates above --> <xsl:template match="node()" mode="backout"> {CUSTOM FORMAT the node appropriately} </xsl:template> This whole concept works, BUT no matter what I've tried, It always applies the formatting from the CUSTOM FORMAT template to the w:p node, NOT it's parent node. It's almost as if you can't reference a parent from a matching node. And maybe you can't, but I haven't found any docs that say you can't Any ideas?

    Read the article

  • How to fetch particular element from string after splitting it, using XSLT split() ?

    - by Vijay
    Hi All, I have one query regarding XSLT functions. I am using split function to fetch values from a string. I am using separator as "*". e.g. String : {"item1*item2*item3*item4"} split function I am using is as; <xsl:template name="SplitItemsCollection"> <xsl:param name="list" select="''"/> <xsl:param name="separator" select="'*'"/> <xsl:if test="not($list = '' or $separator = '')"> <xsl:variable name="head" select="substring-before(concat($list, $separator), $separator)"/> <xsl:variable name="tail" select="substring-after($list, $separator)"/> <xsl:value-of select="$head"/> <xsl:call-template name="split"> <xsl:with-param name="list" select="$tail"/> <xsl:with-param name="separator" select="$separator"/> </xsl:call-template> </xsl:if> </xsl:template> This function returns me all the items. Is there any way to fetch particular item from these separated items ? Say I want to fetch item3. Can we do it directly ? Thanks in advance.

    Read the article

  • Calling a .NET C# class from XSLT

    - by HanSolo
    If you've ever worked with XSLT, you'd know that it's pretty limited when it comes to its programming capabilities. Try writing a for loop in XSLT and you'd know what I mean. XSLT is not designed to be a programming language so you should never put too much programming logic in your XSLT. That code can be a pain to write and maintain and so it should be avoided at all costs. Keep your xslt simple and put any complex logic that your xslt transformation requires in a class. Here is how you can create a helper class and call that from your xslt. For example, this is my helper class:  public class XsltHelper     {         public string GetStringHash(string originalString)         {             return originalString.GetHashCode().ToString();         }     }   And this is my xslt file(notice the namespace declaration that references the helper class): <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:ext="http://MyNamespace">     <xsl:output method="text" indent="yes" omit-xml-declaration="yes"/>     <xsl:template  match="/">The hash code of "<xsl:value-of select="stringList/string1" />" is "<xsl:value-of select="ext:GetStringHash(stringList/string1)" />".     </xsl:template> </xsl:stylesheet>   Here is how you can include the helper class as part of the transformation: string xml = "<stringList><string1>test</string1></stringList>";             XmlDocument xmlDocument = new XmlDocument();             xmlDocument.LoadXml(xml);               XslCompiledTransform xslCompiledTransform = new XslCompiledTransform();             xslCompiledTransform.Load("XSLTFile1.xslt");               XsltArgumentList xsltArgs = new XsltArgumentList();                        xsltArgs.AddExtensionObject("http://MyNamespace", Activator.CreateInstance(typeof(XsltHelper)));               using (FileStream fileStream = new FileStream("TransformResults.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.ReadWrite))             {                 // transform the xml and output to the output file ...                 xslCompiledTransform.Transform(xmlDocument, xsltArgs, fileStream);                            }

    Read the article

  • How to create a HTML5 + SVG document using the PHP XSLTProcessor

    - by Kau-Boy
    For a little project about XML I try to use HTML5 as it has SVG and WAI-ARIA Support. I also want to use a XSL stylesheet for my document. But I can't get a valid HTML5 document with a nested SVG. Here are some version I tested so far: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes" method="xml"/> <xsl:template match="/"> <html xmlns="http://www.w3.org/1999/xhtml"> // content with the svg tag in the body </html> </xsl:template> </xsl:stylesheet> In combination with header('Content-Type: application/xml'); it works and produces this HTML output: <?xml version="1.0"?> <html xmlns="http://www.w3.org/1999/xhtml"> // content with the svg tag in the body </html> But it is not HTML5 and without a DOCTYPE I get a lot of errors on the W3 validator. So trying to get a HTML5 document I used the following XSL: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes" method="html"/> <xsl:template match="/"> <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE HTML></xsl:text> <html> // content with the svg tag in the body </html> </xsl:template> </xsl:stylesheet> But unfortunately that will produce thze following HTML output: <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> .... </head> // content with the svg tag in the body </html> As you can see it's regular HTML5 but using it in combination with header('Content-Type: application/xml'); it fails because of the missing slash at the end of the meta tag (which was automatically created). Using header('Content-Type: image/xhtml+svg'); or header('Content-Type: text/html'); there is no XML parsing error, but the page will not show the SVG as a graph but as text (without the tags). Can anyone tell me how to avoid the meta tag to be inserted or how to set a propper Content-Type that will make the browser rendern the SVG. Or even any other hint to get this working. I would really like to keep HTML5 to be able to keep the WAI-ARIA Landmark Roles an the HTML5 tags like NAV and FOOTER.

    Read the article

  • nested for-each loops in xml

    - by user1748443
    I'm new to XML. I'm trying to create table containing item details and another table to contain customer details for each order on a picklist. It seems like it should be straightforward but I just get a list of all items on all orders repeated by the number of orders. What am I doing wrong? (XSL code below...) <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl = "http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" doctype-system="about:legacy-compat"/> <xsl:template match="/"> <html xmlns = "http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"/> <link rel="stylesheet" type="css/text" href="style.css"/> <title>Orders</title> </head> <body> <xsl:for-each select="//order"> <table> <caption><h3>Order Information</h3></caption> <thead> <th align="left">Item Id</th> <th align="left">Item Description</th> <th align="left">Quantity</th> <th align="left">Price</th> </thead> <xsl:for-each select="//item"> <tr> <td align="left"><xsl:value-of select="itemId"/></td> <td align="left"><xsl:value-of select="itemName"/></td> <td align="left"><xsl:value-of select="quantity"/></td> <td align="left"><xsl:value-of select="price"/></td> </tr> </xsl:for-each> </table> <table> <caption><h3>Customer Information</h3></caption> <thead> <th align="left">Customer Name</th> <th align="left">Street</th> <th align="left">City</th> </thead> <xsl:for-each select="//item"> <tr> <td align="left"><xsl:value-of select="customerName"/></td> <td align="left"><xsl:value-of select="street"/></td> <td align="left"><xsl:value-of select="city"/></td> </tr> </xsl:for-each> </table> </xsl:for-each> </body> </html> </xsl:template> </xsl:stylesheet> This is the XML: <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xsl" href="Orders.xsl"?> <orders xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="Orders.xsd"> <order> <orderId>123</orderId> <items> <item> <itemId>001</itemId> <itemName>Nylon Rope</itemName> <quantity>1</quantity> <price>3.50</price> </item> <item> <itemId>002</itemId> <itemName>Shovel</itemName> <quantity>1</quantity> <price>24.95</price> </item> </items> <customerAddress> <customerName>Larry Murphy</customerName> <street>Shallowgrave Lane</street> <city>Ballymore Eustace, Co. Kildare</city> </customerAddress> </order> <order> <orderId>124</orderId> <items> <item> <itemId>001</itemId> <itemName>Whiskey</itemName> <quantity>1</quantity> <price>18.50</price> </item> <item> <itemId>002</itemId> <itemName>Shotgun</itemName> <quantity>1</quantity> <price>225</price> </item> <item> <itemId>003</itemId> <itemName>Cartridge</itemName> <quantity>1</quantity> <price>1.85</price> </item> </items> <customerAddress> <customerName>Enda Kenny</customerName> <street>A Avenue</street> <city>Castlebar, Co. Mayo</city> </customerAddress> </order> </orders>

    Read the article

  • label in xsl - change the text

    - by naz
    hi, if i want that some value from the xml insert into the text area in the label in the xsl. how can i do that? for example if i want that the ID attribute inser into the label foreach ID.

    Read the article

  • How to assign XML attribute values to drop down list using XSL

    - by Vijay
    Hi, I have a sample xml as; <?xml version="1.0" encoding="iso-8859-9"?> <DropDownControl id="dd1" name="ShowValues" choices="choice1,choice2,choice3,choice4"> </DropDownControl > I need to create a UI representation of this XML using XSL. I want to fill the drop down list with values specified in choices attribute. Does anyone have any idea about this ? Thanks in advance :)

    Read the article

  • Regular expression in Umbraco for number validation.

    - by Vizioz Limited
    This evening I was looking for a way to validate an Umbraco node that could be either text or a numeric value, in my case a salary that could be either an hourly amount, an annual figure or a comment. In the case where the node contained a value I wanted the XSLT to output a pound sign (£) and for any that contained text it would just output the text, as this could be something like "Contact Us" or "Negotiable"I thought someone else might find this useful so here is the XSLT and the regular expression.First if you are using Umbraco, don't forget to include the reference to the EXSLT Regular expression library at the top of your XSLT.<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxml="urn:schemas-microsoft-com:xslt" xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" exclude-result-prefixes="msxml umbraco.library Exslt.ExsltRegularExpressions">Then the code I used was:<xsl:if test="Exslt.ExsltRegularExpressions:match($currentPage/data [@alias='Salary'], '^[0-9]*\,?[0-9]*\.?[0-9]+$') != ''"> <xsl:text>£</xsl:text></xsl:if>This regular expression allows any number of digits, an optional comma, more digits, an optional decimal point and finally more digits, so all the following are valid:12,00014.43334,342.03

    Read the article

  • Can I build this XPath query dynamically in XSLT?

    - by Martin Doms
    I have a document that looks something like <root> <element> <subelement1 /> <subelement2 /> </element> <element> <subelement2 /> <subelement1 /> </element> </root> In my XSLT sheet in the context of /element[2]/[someNode] I want to get a number that represents the distance of /element[1]/[someNode] (ie, the number of preceding siblings of /element1/[someNode]). For example, in the context of /element[2]/subelement1 I'd like to have some way to get the number 2, the distance from /element[1] to /element[1]/subelement2. I only ever need the distance of the given node name from the first instance of . Intuitively I thought I could construct this like <xsl:variable name="nodename" select="name()" /> <xsl:value-of select="/element[1]/$nodename/preceding-sibling::*" /> but unfortunately this sheet doesn't compile. Is what I'm trying to achieve possible in XSLT?

    Read the article

  • PHP and XSLTProcessor Misbehavior

    - by Aiden Bell
    Hi all, Simple question: Why is a PHP function called from an XSL Stylesheet just returning the last argument passed: foo.xsl: <xsl:template match="/"> <xsl:value-of select="php:function('date','c')" /> </xsl:template> PHP: ... $xsl = new XSLTProcessor(); $xsl->registerPHPFunctions(); $xsl->importStylesheet($fooStylesheet); echo $xsl->transformToXML($myXML); I Get the output c and if I call <xsl:value-of select="php:function('date')" /> I just get date as my output. Seems strange to me. Version info: PHP 5.3.2 libxslt Version 1.1.26 libxslt compiled against libxml Version 2.7.6 EXSLT enabled libexslt Version 1.1.26

    Read the article

  • Grouping XSLT nodes via transformation

    - by scott
    I'm trying to create a page like this via XSLT transformation. Pages page1 page2 Links link1 link2 Here is the xml <siteMenu> <Pages> <title>page1</title> </Pages> <Pages> <title>page2</title> </Pages> <Links> <title>link1</title> </Links> <Links> <title>link2</title> </Links> </siteMenu> I tried using <xsl:for-each select="*"> and <xsl:for-each-group select="*" group-by="@v"> but that gives me every element, but how can i separate them out based on the parent node?

    Read the article

  • Grouping XSLT nodes via transformation dynamically

    - by scott
    I'm trying to create a page like this via XSLT transformation. Pages page1 page2 Links link1 link2 Here is the xml <siteMenu> <Pages> <title>page1</title> </Pages> <Pages> <title>page2</title> </Pages> <Links> <title>link1</title> </Links> <Links> <title>link2</title> </Links> </siteMenu> I tried using <xsl:for-each select="*"> and <xsl:for-each-group select="*" group-by="@v"> but that gives me every element, but how can i separate them out based on the parent node? I also want to make it dynamic so that if I add another item in siteMenu, it would update the xslt appropriately.

    Read the article

  • Alternative to Altova's MissionKit

    - by nomad311
    Anyone know of any good alternatives (other than those listed below which really are only good at specific XML development tasks)? The Why (if you're interested): I've been doing XML development on and off for years now, but someone brought XMLSpy to my attention recently, and it is awesome - the price isn't. Lately I've been using a combination of: Notepad++ (modifying XML) EditX (validating/debugging XML) Eclipse (designing schemas) and MS Visual Studio (validating schemas) ...based on which makes the task(s) easiest. But, I've just found out that we will be using XSL transformations to generate XML in the future. I've never used mission kit before, but I'm just short of positive XMLSpy replaces all the above mentioned tool for XML development. And if their XSL tools are anywhere near the caliber of XMLSpy ...simply put I need it. I don't believe that I can convince the budgeting types to buy licenses for MissionKit at $1000 each (won't stop me from trying). In the mean while some research on alternatives won't hurt, but a few Google queries has only revealed that not many people pay for Altova's (overpriced?) software as there are mostly links to P2P sites for downloading a more free-like version of MissionKit.

    Read the article

  • mySQL to .XSL help

    - by kielie
    hi guys, I have to create a script that takes a mySQL table, and exports it into .XSL format, and then saves that file into a specified folder on the web host. I got it working, but now I can't seem to get it to automatically save the file to the location without prompting the user. It needs to run every day at a specified time, so it can save the previous days leads into a .XSL file on the web host. Here is the code: <?php // DB TABLE Exporter // // How to use: // // Place this file in a safe place, edit the info just below here // browse to the file, enjoy! // CHANGE THIS STUFF FOR WHAT YOU NEED TO DO $dbhost = "-"; $dbuser = "-"; $dbpass = "-"; $dbname = "-"; $dbtable = "-"; // END CHANGING STUFF $cdate = date("Y-m-d"); // get current date // first thing that we are going to do is make some functions for writing out // and excel file. These functions do some hex writing and to be honest I got // them from some where else but hey it works so I am not going to question it // just reuse // This one makes the beginning of the xls file function xlsBOF() { echo pack("ssssss", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0); return; } // This one makes the end of the xls file function xlsEOF() { echo pack("ss", 0x0A, 0x00); return; } // this will write text in the cell you specify function xlsWriteLabel($Row, $Col, $Value ) { $L = strlen($Value); echo pack("ssssss", 0x204, 8 + $L, $Row, $Col, 0x0, $L); echo $Value; return; } // make the connection an DB query $dbc = mysql_connect( $dbhost , $dbuser , $dbpass ) or die( mysql_error() ); mysql_select_db( $dbname ); $q = "SELECT * FROM ".$dbtable." WHERE date ='$cdate'"; $qr = mysql_query( $q ) or die( mysql_error() ); // Ok now we are going to send some headers so that this // thing that we are going make comes out of browser // as an xls file. // header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Type: application/force-download"); header("Content-Type: application/octet-stream"); header("Content-Type: application/download"); //this line is important its makes the file name header("Content-Disposition: attachment;filename=export_".$dbtable.".xls "); header("Content-Transfer-Encoding: binary "); // start the file xlsBOF(); // these will be used for keeping things in order. $col = 0; $row = 0; // This tells us that we are on the first row $first = true; while( $qrow = mysql_fetch_assoc( $qr ) ) { // Ok we are on the first row // lets make some headers of sorts if( $first ) { foreach( $qrow as $k => $v ) { // take the key and make label // make it uppper case and replace _ with ' ' xlsWriteLabel( $row, $col, strtoupper( ereg_replace( "_" , " " , $k ) ) ); $col++; } // prepare for the first real data row $col = 0; $row++; $first = false; } // go through the data foreach( $qrow as $k => $v ) { // write it out xlsWriteLabel( $row, $col, $v ); $col++; } // reset col and goto next row $col = 0; $row++; } xlsEOF(); exit(); ?> I tried using, fwrite to accomplish this, but it didn't seem to go very well, I removed the header information too, but nothing worked. Here is the original code, as I found it, any help would be greatly appreciated. :-) Thanx in advance. :-)

    Read the article

  • How to call an xslt transform into an xsl stylesheet

    - by Mycol
    I have written an xslt that reads some xml file names and does some operations on them. I use a for-each to work them one-by-one. I have each path inside a parameter $path. But now I would like to output the result of applying an external stylesheet to those files. I would write something like <div> <something like xsl-transform($extern-xslt,$path)> </div> to have the result tree of the transformation inside the main html output. It is possible?

    Read the article

  • Using xsl:character-map on text nodes only

    - by jramos95
    I am trying to create a generic stylesheet that can convert all Latin characters in Unicode to uppercase ASCII characters. Using <xsl:character-map> works well except for one thing: namespaces. The character map converts all of my namespaces to upper case, which I do not want. Is there a way to utilize a character map to do what I want to all the other nodes while leaving the namespaces untouched? I see the disable-output-escaping attribute might be an option, but I haven't been able to make it work.

    Read the article

  • xslt (table) by matching the attribute value.

    - by Magesh
    i need to generate an xsl table for the xml below , for atrributes fname and lname.. i have done something worng in xpath i guess.could someone help me out writing an xsl table for the xml below.. <sparql> - <head> <variable name="s"/> <variable name="fname"/> <variable name="lname"/> </head> - <results> - <result> - <binding name="s"> <uri>http://tn.gov.in/Person/41</uri> </binding> - <binding name="fname"> <literal>Gayathri</literal> </binding> - <binding name="lname"> <literal>Vasudevan</literal> </binding> </result> - <result> - <binding name="s"> <uri>http://tn.gov.in/Person/43</uri> </binding> - <binding name="fname"> <literal>Vivek</literal> </binding> - <binding name="lname"> <literal>Vasudevan</literal> </binding> </result> - <result> - <binding name="s"> <uri>http://tn.gov.in/Person/37</uri> </binding> - <binding name="fname"> <literal>Magesh</literal> </binding> - <binding name="lname"> <literal>Vasudevan</literal> </binding> </result> - <result> - <binding name="s"> <uri>http://tn.gov.in/Person/39</uri> </binding> - <binding name="fname"> <literal>Vasudevan </literal> </binding> - <binding name="lname"> <literal>Srinivasan</literal> </binding> </result> </results>

    Read the article

  • Rendering XML document with multiple languages

    - by bdhar
    I have an XML page with some elements in various languages - Arabic, English, Chinese, Japanese.. Which encoding format should I have to choose for that? If I try to render the XML with an XSL (using utf-8 or ISO-8859-6 or ISO-2022-JP), I get this error: An invalid character was found in text content. How shall or solve this? Thanks.

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >