Search Results

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

Page 5/34 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How to convert XML to a HTML table using XSL for-each

    - by Meeeee
    I am trying to convert some XML with XSL, to make the output look better and more readable for other users. I have some XML along the lines of: <G> <OE> <example1>Sample 1</example1> <example2>Sample 2</example2> <var name="name1"> <integer>1</integer> </var> </OE> </G> I want to get all the details from it and display it in a table so I use the following XSL code: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:template match="/"> <html> <body> <h2>Heading</h2> <table border="1"> <tr bgcolor="#3399FF"> <th>Example 1</th> <th>Example 2</th> <th>Var name</th> <th>Int</th> </tr> <xsl:for-each select="G/OE"> <xsl:for-each select="var"> <tr> <td> <xsl:value-of select="Example 1" /> </td> <td> <xsl:value-of select="Example 2" /> </td> <td> <xsl:value-of select="@name" /> </td> <td> <xsl:value-of select="integer" /> </td> </tr> </xsl:for-each> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet> I know that the following XSL won't work properly. I want the output to be: Sample 1, Sample 2, name1, 1 - in a table format. My problem is I don't know how to do this. In the above XSL code it will only retrieve var and integer. If I only use the top <xsl:for-each>, then only the first two are retrieved. I have tried moving the 2nd <xsl:for-each> after the first to have been selected, so between: <td><xsl:value-of select="Example 2"/></td> and <td><xsl:value-of select="@name"/></td> I get an error. Is there any way to solve this problem? Thanks for the help.

    Read the article

  • Issue with XSL for website sitemap XML

    - by Lucifer
    Hi The XSL for a website sitemap is not working as expected. The URL elements are not being looped through? Please can you take a look: XML: http://www.telephonesystems.co.uk/sitemap.xml XSL: http://www.telephonesystems.co.uk/css/sitemap.xsl Thanks

    Read the article

  • Link XSL Style Sheet to XForms generated XML document

    - by iHeartGreek
    Hi! Through XForms, I generate an XML document. I need this XML document to be transformed by a specific XSL. How do I link the XSL to the XML through XForms? Example of link: <?xml-stylesheet type="text/xsl" href="test.xsl"?> (The XML doc gets regenerated every time the XForms submits to it.. so I cannot hardcode the link in the XML doc, in needs to be done through the XForms) Thanks!

    Read the article

  • Get subdomain of XML page from XSL

    - by fudgey
    I am working with a guild hosting site that provides an XML/XSL transformation widget where all I need to do is enter the URL for the XML and XSL and it does the rest. I have written an XSL transform to display a World of Warcraft armory page: Here is an example XML page (view source to see it) of the group I'm trying to help now. So, the user is entering their own XML page url (which has an eu subdomain in this case, but it is not within the XML itself). So when I make links to the character url, I need to add the entire url <a target="_blank" href="http://eu.wowarmory.com/character-sheet.xml?{@url}"> <xsl:value-of select="@name"/> </a> But I can't just set the domain to eu since there are multiple regions. Here are the possibilities: us = www, europe = eu, korea = kr, china = cn and taiwan = tw. Here is a snippet of the XML which shows the url parameters: <character achPoints="4275" classId="3" genderId="0" level="80" name="Virtex" raceId="4" rank="2" url="r=Drek%27Thar&amp;cn=Virtex"/> I guess I could just have the user add a small bit of HTML with their region in another part of their page, something like <div id="region">eu</div>, but I'm trying to make this work without any extra coding on their part. Edit: Ok, my question explicitly stated: How do I get the URL subdomain using XSL?

    Read the article

  • How to use an expression in xsl:include elment in an XSLT processing

    - by addinquy
    I need to include an XSLT that exists in 2 variants, depending on a param value. However, it's seems to be not possible to write an expression in the href attribute of the xsl:include element. My last trial looks like that: < xsl:param name="ml-fmt" select="mono"/ ... < xsl:include href="{$ml-fmt}/format.xsl"/ The XSLT engine used is Saxon 9.2.0.6 Have anybody an idea about how I could do something close to that ?

    Read the article

  • XSL - How to tell if element is last in series

    - by Chris
    I have an XSL template that is called (below). What I would like to do is be able to tell if I am the last Unit being called. <xsl:template match="Unit[@DeviceType = 'Node']"> <!-- Am I the last Unit in this section of xml? --> <div class="unitchild"> Node: #<xsl:value-of select="@id"/> </div> </xsl:template> Example XML <Unit DeviceType="QueueMonitor" Master="1" Status="alive" id="7"> <arbitarytags /> <Unit DeviceType="Node" Master="0" Status="alive" id="8"/> <Unit DeviceType="Node" Master="0" Status="alive" id="88"/> </Unit>

    Read the article

  • XML to CSV using XSLT help.

    - by Adam Kahtava
    I'd like to convert XML into CSV using an XSLT, but when applying the XSL from the SO thread titled XML To CSV XSLT against my input: <WhoisRecord> <DomainName>127.0.0.1</DomainName> <RegistryData> <AbuseContact> <Email>[email protected]</Email> <Name>Internet Corporation for Assigned Names and Number</Name> <Phone>+1-310-301-5820</Phone> </AbuseContact> <AdministrativeContact i:nil="true"/> <BillingContact i:nil="true"/> <CreatedDate/> <RawText>...</RawText> <Registrant> <Address>4676 Admiralty Way, Suite 330</Address> <City>Marina del Rey</City> <Country>US</Country> <Name>Internet Assigned Numbers Authority</Name> <PostalCode>90292-6695</PostalCode> <StateProv>CA</StateProv> </Registrant> <TechnicalContact> <Email>[email protected]</Email> <Name>Internet Corporation for Assigned Names and Number</Name> <Phone>+1-310-301-5820</Phone> </TechnicalContact> <UpdatedDate>2010-04-14</UpdatedDate> <ZoneContact i:nil="true"/> </RegistryData> </WhoisRecord> I end up with: [email protected] Corporation for Assigned Names and Number+1-310-301-5820, , , , ..., 4676 Admiralty Way, Suite 330Marina del ReyUSInternet Assigned Numbers Authority90292-6695CA, [email protected] Corporation for Assigned Names and Number+1-310-301-5820, 2010-04-14, My problem is that, the resulting transformation is missing nodes (like the DomainName element containing the IP address) and some child nodes are concatenated without commas (like the children of AbuseContact). I'd like to see all the XML output in CVS form, and strings like: "[email protected] Corporation for Assigned Names and Number+1-310-301-5820," delimited by commas. My XSL is pretty rusty. Your help is appreciated. :) Here's the XSL I'm using: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text" encoding="iso-8859-1"/> <xsl:strip-space elements="*" /> <xsl:template match="/*/child::*"> <xsl:for-each select="child::*"> <xsl:if test="position() != last()"><xsl:value-of select="normalize-space(.)"/>, </xsl:if> <xsl:if test="position() = last()"><xsl:value-of select="normalize-space(.)"/><xsl:text> </xsl:text> </xsl:if> </xsl:for-each> </xsl:template> </xsl:stylesheet>

    Read the article

  • Sort by date in XSL

    - by bethhilson
    I am trying to sort by date for XML output. Here is my XSL: http://www.dnncreative.com -- <!-- Test to limit number of items displayed. Here only 5 items will be transformed --> <br></br> <!-- to open links in a new window, change target="_main" to target="_blank" --> <strong><a href="{link}" target="_blank"><xsl:value-of select="title"/></a></strong> <br> <!-- <xsl:value-of select="pubDate"/> --> </br> <!-- only display 100 characters of the description, and allow html --> <xsl:value-of disable-output-escaping="yes" select="description"/> I am trying to sort descending using the entereddate in my XML: Media Director 4/2/2009 01646359 Cleveland OH United States of America $0.00 - $0.00 / $0.00/hr - $0.00/hr http://employment.topechelon.com/web77391/jobseeker/sSetup.asp?runsearch=1&spJobAdId=01646359 http://employment.topechelon.com/web77391/jobseeker/sSetup.asp?runsearch=1&spJobAdId=01646359 Any help would be appreciated! Thanks Beth Hilson

    Read the article

  • XSL transformation generating output from other nodes

    - by Abel Morelos
    I have the following XSL template: <xsl:template match="SOAP-ENV:Body/*[local-name()='Publisher']"> <html> <xsl:call-template name="body" /> </html> </xsl:template> The previous template generates the output I want, it's generating the tags containing the output generated by the "body" template. The issue I'm having is that before the opening tag I'm getting text output from a previous node. Not sure why this is happening since I'm not selecting these other nodes. For example: <SOAP-ENV:Header> <!-- Many child nodes here--> </SOAP-ENV:Header> <SOAP-ENV:Body> <publishParty:Publisher> <!-- Many child nodes here--> </publishParty:Publisher> </SOAP-ENV:Body> Given the previous sample XML fragment, my output would contain what I would expect of formatting the Publisher element, but I'm also getting the text nodes of the children of the SOAP-ENV:Header node. Any ideas? Thanks!

    Read the article

  • BizTalk 2009 XSLT and Attribute Value Templates

    - by amok
    I'm trying to make use of attribute value type in a BizTalk XSL transformation to dynamically setting attribute or other element names. Read more here: http://www.w3.org/TR/xslt#dt-attribute-value-template The following code is an example of an XSL template to add an attribute optionally. <xsl:template name="AttributeOptional"> <xsl:param name="value"/> <xsl:param name="attr"/> <xsl:if test="$value != ''"> <xsl:attribute name="{$attr}"> <xsl:value-of select="$value"/> </xsl:attribute> </xsl:if> </xsl:template> Running this script in BizTalk results in "Exception from HRESULT: 0x80070002)" An alternative I was thinking of was to call a msxsl:script function to do the same but i cannot get a handle on the XSL output context from within the function. An ideas?

    Read the article

  • XSL to show highest number of copies in catalog.xml file

    - by SANJAY RAO
    In this the catalog.xml file. I have two books who have the same inventory (i.e. 20). I want to write an XSL file that will display the highest number of copies of a book in a catalog. If there are two or more books of the same inventory then they have to be displayed. <catalog> <Book> <sku>12345</sku> <title>Beauty Secrets</title> <condition>New</condition> <current_inventory>20</current_inventory> <price>99.99</price> </Book> <Book> <sku>54321</sku> <title>Picturescapes</title> <current_inventory>20</current_inventory> <condition>New</condition> <price>50.00</price> </Book> <Book> <sku>33333</sku> <title>Tourist Perspectives</title> <condition>New</condition> <current_inventory>0</current_inventory> <price>75.00</price> </Book> <Book> <sku>10001</sku> <title>Fire in the Sky</title> <condition>Used</condition> <current_inventory>0</current_inventory> <price>10.00</price> </Book> </catalog> Below is my catalog3.xsl file which is able to display only one out of the two books: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:variable name="max"/> <xsl:template match="/"> <html> <body> <h2>Titles of Books for which Most Copies are Available</h2> <table border="2"> <tr bgcolor="#9acd32"> <th>Title</th> <th>No of Copies</th> </tr> <xsl:apply-templates/> </table> </body> </html> </xsl:template> <xsl:template match="catalog"> <xsl:for-each select="Book"> <xsl:sort select="current_inventory" data-type="number" order="descending"/> <tr> <xsl:if test="position()= 1"> <p><xsl:value-of select="$max = "/></p> <td><xsl:value-of select="title"/></td> <td><xsl:value-of select="current_inventory"/></td> </xsl:if> </tr> </xsl:for-each> </xsl:template> </xsl:stylesheet> Could anybody correct me to achieve my goal of displaying all the copies having the same maximum inventory in the catalog. Thanks.

    Read the article

  • Walk/loop through an XSL key: how?

    - by krisvandenbergh
    Is there a way to walk-through a key and output all the values it contains? I though of it this way: <xsl:for-each select="key('kElement', '.')"> <li><xsl:value-of select="." /></li> </xsl:for-each> However, this does not work. I simply want to list all the values in a key for testing purposes. The question is simply: how can this be done?

    Read the article

  • button in XSL for AJAX usage

    - by phingko
    Hi guys, I wonder if its is possible to do AJAX when I put a button inside the xsl file; <input type = "button" id="laptop" value = "Add to Cart" onclick="sendCartRequest('Add');" /> That's what I do in my xsl file then in my js file I pass the id to the DOM and try to alert it make sure it is passed. And the alert appear to be empty. Is it a mistake to put the button in the xsl? or that's something else that cause it's empty? May be my DOMpath? Please point me a right direction. Thanks in advanced.

    Read the article

  • Libraries/Solutions for using XSL to create interactive web forms from XML

    - by Brabster
    This seems like a pretty straightforward thing to do, but I can't find anything off the open-source shelf. Is there a solution already out there that does the following: can be configured with an arbitrary XSL stylesheet generates a web form based on an arbitrary XML document and the XSL creates edit functionality in appropriate places in the rendered form updates the local representation of the XML document provides capabilities to view, save the new XML document Ideally, one that plugs into a Java web application. Even better if it can generate the XSL based on schema documents - but that might not be feasible, not really thought it through. For context, I'm thinking things like pleasant-for-humans editing of Maven POMs, ANT build.xml, etc. Cheers,

    Read the article

  • Processing an Integer Retrieved from a String in XSL

    - by justkt
    I have a stored time value which is of the format H:mm:ss. The hours may be any value from 0 up through several days. This data is sent in an XML tag and processed by XSL to be displayed. The display that I want is of the format: D days, HH:mm:ss (hours/minutes) Where the last tag shows hours if HH is greater than 0, minutes if it is 0. Given the original HH, which may be more than 24, I know I need the floor of HH / 24 to get the days value. Then the original HH % 24 gives me the leftover hours. I have also handled the minutes and hours question using xsl:when and xsl:if. It's getting days and hours from the hours value that has me stumped.

    Read the article

  • is there such a thing as xsl:fo reporting or xsl:fo simulation?

    - by topmulch
    Hi, I am trying to determine if MY xsl:fo generated PDF file will exceed one page or not, without actually generating the output. We use Apache-FOP 0.95 on our server, and the XML data is being generated using a PHP DOMDocument class before being passed onto an XSL-FO template. My question: Are there PHP libraries out there that can simulate xsl:fo output and send me reports that I can use in my application? Alternatively, is there a way for the Apache FOP itself (or sibling Java app) that sends reports without actually generating a file? I have been reading the FOP documentation, and aside from some things I can not fully understand, I have not been able to find a way to do that from within FOP. Any advice is much appreciated.

    Read the article

  • Evaluate a string-expression in XSL

    - by Jerzakie
    Is there any way to evaluate a string expression in XSL? example: <myItem id="1"> <validator expression="$someVariable = '3'" /> </myItem> ... <xsl:variable name="someVariable" select="3" /> <xsl:if test="@expression"> ... I realize this syntax does not work the way I want it to, but is there any way to store the test expression in a variable and then evaluate the expression?

    Read the article

  • Updating variables in XSL

    - by Stroboskop
    Is there any way in XSL to update a global variable? I want to check what elements i already transformed and act accordingly. That would require me to somehow add the names of the elements to some sort of list and update it each time a new element is transformed. But since xsl:variable isn't "variable" in the sense one would expect, i have no way of adding anything to it once it has been defined. I have multiple included data files, so using xsl functions that only know the current set of nodes will not help.

    Read the article

  • Finding Specific Descendant Nodes With XSL:Key

    - by DBA_Alex
    Given the following code: <database> <table name="table1"> <column name="id"/> <column name="created_at"/> </table> <table name="table2"> <column name="id"/> <column name="updated_at"/> </table> </database> I want to be able to test using an xsl:key if specific table has a specific column by name. For instance, I want to know if a table has a 'created_at' column so I can write specific code within the transformation. I've gotten a general key that will test if any table has a given column by name, but have not figured out how to make it specific to the table the transformation is currently working with. <xsl:key name="columnTest" match="column" use="@name"/> <xsl:for-each select="database/table"> <xsl:choose> <xsl:when test="key('columnTest', 'created_at')"> <xsl:text>true</xsl:text> </xsl:when> <xsl:otherwise> <xsl:text>false</xsl:text> </xsl:otherwise> </xsl:choose> </xsl:for-each> So I end up with 'true' for all the tables. Any guidance would be appreciated.

    Read the article

  • xsl:template match doesn't find matches

    - by dmo
    I'm trying to convert some Xaml to HTML using the .NET XslCompiledTransform and am running into difficulties getting the xslt to match Xaml tags. For instance with this Xaml input: <FlowDocument PagePadding="5,0,5,0" AllowDrop="True" NumberSubstitution.CultureSource="User" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> <Paragraph>a</Paragraph> </FlowDocument> And this xslt: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" > <xsl:output method="html" indent="yes"/> <xsl:template match="/"> <html> <body> <xsl:apply-templates /> </body> </html> </xsl:template> <xsl:template match="FlowDocument"> <xsl:apply-templates /> </xsl:template> <xsl:template match="Paragraph" > <p> <xsl:apply-templates /> </p> </xsl:template> I get this output: <html> <body> a </body> </html> Rather than the expected: <html> <body> <p>a</p> </body> </html> Could this be a problem with the namespace? This is my first attempt at an xsl transform, so I'm at a loss.

    Read the article

  • Javascript in XSL that is loaded by Javascript

    - by James Armstead
    Is there anyway to have javascript run when a XSL sheet has been applied to an XML file by Javascript? I am using a JQuery plugin to apply the sheet to the xml but the javascript that is located inside of the XSL file will not run. I put the Javascript at the bottom of the file and it still does not run.. I can't seem to get an alert to even run?

    Read the article

  • transformation of UML Diagrams to specification Z using xsl transformation

    - by Mona
    hi. I'm trying to transform some uml diagrams (of singleton , AbstractFactory ...) to Z specification , first i transformed my uml diagram to an xml file using starUML then i used an xsl program and saxon to transform my xml file to .tex( for Z ) , but it didnt work . if someone has an idea about how the xsl program should be written (just maybe the steps) that will be great. thanks

    Read the article

  • MOSS ItemStyle.xsl parameter

    - by nav
    Hi, I am trying feed the site URL as a path into HTML rendered by the ItemStyle.xsl. Could anyone please give me some pointers? I need to know how I can extract the site URL from ItemStyle.xsl. Many Thanks, Nav

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >