Search Results

Search found 1542 results on 62 pages for 'xsl xpath'.

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

  • XSL unique values per node

    - by Nathan
    ok i have this xml <roots> <root> <name>first</name> <item type='test'><something>A</something></item> <item type='test'><something>B</something></item> <item type='test'><something>C</something></item> <item type='test'><something>A</something></item> <item type='other'><something>A</something></item> <item type='test'><something>B</something></item> <item type='other'><something>D</something></item> </root> <root> <name>second</name> <item type='test'><something>E</something></item> <item type='test'><something>B</something></item> <item type='test'><something>F</something></item> <item type='test'><something>A</something></item> <item type='other'><something>A</something></item> <item type='test'><something>B</something></item> <item type='other'><something>D</something></item> </root> </roots> now i need to get the unique values of each root node so far i have <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes" method="text"/> <xsl:key name="item-by-value" match="something" use="."/> <xsl:key name="rootkey" match="root" use="name"/> <xsl:template match="/"> <xsl:for-each select="key('rootkey','second')"> <xsl:for-each select="item/something"> <xsl:if test="generate-id() = generate-id(key('item-by-value', normalize-space(.)))"> <xsl:value-of select="."/> </xsl:if> </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> if i use "First" as the key to get only the first root i get a good result ABCD how ever if i use "second" i only get EF but i need the result to be ABDFE

    Read the article

  • XSL Reuse? YES! But: Element must not contain an xsl:import element! :-(

    - by Fedor Steeman
    I am using a heavy stylesheet with a lot of recurring transformations, so I thought it would be smart to reuse the same chunks of code, so I would not need to make the same changes at a bunch of different places. So I discovered , but -alas- it won't allow me to do it. When trying to run it in Sonic Workbench I get the following error: An xsl:for-each element must not contain an xsl:import element This is my stylesheet code: <xsl:template match="/"> <InboundFargoMessage> <EdiSender> <xsl:value-of select="TransportInformationMessage/SenderId"/> </EdiSender> <EdiReceiver> <xsl:value-of select="TransportInformationMessage/RecipientId"/> </EdiReceiver> <EdiSource>PORLOGIS</EdiSource> <EdiDestination>FARGO</EdiDestination> <Transportations> <xsl:for-each select="TransportInformationMessage/TransportUnits/TransportUnit"> <xsl:import href="TransportCDMtoFDM_V0.6.xsl"/> </xsl:for-each> <xsl:for-each select="TransportInformationMessage/Waybill/TransportUnits/TransportUnit"> <xsl:import href="TransportCDMtoFDM_V0.6.xsl"/> </xsl:for-each> </Transportations> </InboundFargoMessage> </xsl:template> </xsl:stylesheet> I will leave out the child xsl-sheets for now, as the problem appears to be happening at the base. If I cannot use xsl:import, is there any option of reuse?

    Read the article

  • Problem with using the XPATH functions

    - by Alex
    I've got a problem with using the XPATH functions. When I try to call some functions like lower-case or upper-case etc,they are not executed and I can't figure the problem out. I included the namespace xmlns:fn="http://www.w3.org/2005/xpath-functions" at the top of my XSL stylesheet and use fn namespace to call these functions but anyway nothing is working. Can anyone explain the reason and what I should do in order to be able to use the following functions? Cheers

    Read the article

  • XML and XSL connection

    - by Irgat
    I have a problem between XML and XSL files. In XML file, there are some elements such as *<school><student studentID="12345"><nameStud I</name<takesCMPE471</takes<takesCMPE412</takes<takesCMPE100</takes</student<student studentID="67890"><nameStud II</name<takesCMPE471</takes<takesCMPE412</takes</student<course courseCode="CMPE471"<courseName>NAME I </courseName> <description>DESC I </description> </course><course courseCode="CMPE412"<courseName>NAME II </courseName> <description>DESC II </description> </course><course courseCode="CMPE100"<courseName>NAME III </courseName> <description>DESC III </description> </course>In XSL file,I want to reach "description" element which I specified "courseCode".Output should be like this, 1. Stud I      a. CMPE471 Desc I      b. CMPE412 Desc II     c. CMPE100 Desc III2. Stud II      a. CMPE471 Desc I     b. CMPE412 Desc II In XSL file, I tried to write something : <ol <xsl:for-each select="/school/student" <xsl:sort data-type="text" order="ascending" select="name"/ <li<xsl:value-of select="name"/ <ol type="a" <xsl:for-each select="takes" <xsl:sort data-type="text" select="text()" order="ascending"/ <li <xsl:for-each select="/school/course"//PROBLEM <xsl:value-of select="description [@courseCode = text()]"///PROBLEM </xsl:for-each//PROBLEM </li </xsl:for-each </ol </xsl:for-each </ol Thanks.

    Read the article

  • Sorting a nodeset before passing to xsl:for-each

    - by Zack Mulgrew
    I have a situation where loop through a sorted nodeset and apply a template on each of the nodes: <div id="contractscontainer"> <xsl:for-each select="document"> <xsl:sort select="content[@name='ClientName']/text()" /> <xsl:apply-templates select="." mode="client-contract" /> </xsl:for-each> </div> I want to do something special with the "first" 5 nodes in the node set and render them nested element. The problem is that they need to be in the same order as if they were sorted (as they are in the loop). I had planned on doing this by using two xsl:for-each elements, each with the correct nodes selected from the set. I can't do this, however, because they need to be sorted before I can select the "first" 5. Example: <div id="contractscontainer"> <div class="first-five"> <xsl:for-each select="document[position() < 6]"> <xsl:sort select="content[@name='ClientName']/text()" /> <xsl:apply-templates select="." mode="client-contract" /> </xsl:for-each> </div> <div class="rest-of-them"> <xsl:for-each select="document[position() > 5]"> <xsl:sort select="content[@name='ClientName']/text()" /> <xsl:apply-templates select="." mode="client-contract" /> </xsl:for-each> </div> </div> I don't think this will work because I'm selecting the nodes by position before sorting them, but I can't use xsl:sort outside of the xsl:for-each. Am I approaching this incorrectly?

    Read the article

  • How can I combine xsl:attribute and xsl:use-attribute-sets to conditionally use an attribute set?

    - by Peter
    We have an xml node "item" with an attribute "style", which is "Header1". This style can change however. We have an attribute set named Header1 which defines how this should look in a PDF, generated through xsl:fo. This works (the use-attribute-sets is mentioned inline, in the fo:table-cell node): <xsl:template match="item[@type='label']"> <fo:table-row> <fo:table-cell xsl:use-attribute-sets="Header1"> <fo:block> <fo:inline font-size="8pt" > <xsl:value-of select="." /> </fo:inline> </fo:block> </fo:table-cell> </fo:table-row> </xsl:template> But this doesn't (using xsl:attribute, because the attribute @style can also be Header2 for example). It doesn't generate an error, the PDF is created, but the attributes aren't applied. <xsl:template match="item[@type='label']"> <fo:table-row> <fo:table-cell> <xsl:attribute name="xsl:use-attribute-sets"> <xsl:value-of select="@style" /> </xsl:attribute> <fo:block> <fo:inline font-size="8pt" > <xsl:value-of select="." /> </fo:inline> </fo:block> </fo:table-cell> </fo:table-row> </xsl:template> Does anyone know why? And how we could achieve this, preferably without long xsl:if or xsl:when stuff?

    Read the article

  • How to pass parameter value to XSL?

    - by Manish
    Suppose I have a XSL as follows: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" indent="yes"/> <xsl:param name="sortKey" select="'firstname'"/> </xsl:stylesheet> Then a XML as follows <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml-stylesheet type="text/xsl" href="XYZ.xsl"?> <ABC> </ABC> I want to pass a value to the XSL parameter firstname from XML. Can I do that? If yes, How? I'm not sure if I'm correct and this can be done.

    Read the article

  • Why doesn't libxml2 support XPath 2.0?

    - by Peter Krauss
    Libxml2 is the faster, stable and most popular "open DOM engine"... And the "XML C parser and toolkit of Gnome". The initial release of Libxml2 was September 1999, 13 years ago. XPath v1.0 was also released at 1999. XPath v2.0 became a recommendation on January 2007, 6 years ago. We can suppose that the Libxml2 community have time and people to develop a XPath2... So, what is the problem? Why doesn't libxml2 (or a "libxml2 fork" or an "experimental lib"!) support XPath 2.0? Some raised hypotheses to discussion at answers, Because Libxml2 community (and Gnome community) dislikes and have no motivation to develop something to XPath2 or xQuery. 1.1. XPath2 needs (by mathematical proof) a very heavy parser, much slower, etc. that is not suitable to real-world Libxml2 applications. 1.2. Other "ideologic" dislikes/motivations. Because it is written with C, and for XPath2 is better to develop with C++. Because the above hypothesis of "Libxml2 community have time and people" is false. Because XPath2 became stable in 2010 with its "Second Edition" release, and ~2.5 years is not (?) enough time.

    Read the article

  • XSL-FO: is XSL-FO dead technology and only used by niche companies?

    - by MMAmail.com
    I wanted to convert some xml to a magazine like pdf document. A lot like what Latext allows you to do however i was not able to find any new books or online tutorials on the subject. Is it worth investing in using this technology or not? Also, I looked at the Apache XSL-FO project and their last release was in august 2008. p.s. commercial packages are not an option :(

    Read the article

  • Xpath question Xml Xpath

    - by Ibrar Afzal
    I need an xpath expression that would return the value of I need to get the value of this node. the value to extract is my xpath expression is //rates/rate[loantype='30-Year Fixed Rate'] The issue hre is that there are three value each node has a subtype element. Beside fileter for loantype I also need to filter for subtype. I am not sure how to do it in xpath. I have the following xml 40-Year Fixed Rate A 3 5.375 1.000 5.491 0 1 40-Year Fixed Rate B 5.500 0.500 5.579 0 1 40-Year Fixed Rate C 5.625 0.000 5.667 0 1 30-Year Fixed Rate A 3 5.000 1.000 5.134 0 1 30-Year Fixed Rate B 5.125 0.500 5.215 0 1 30-Year Fixed Rate C 5.250 0.000 5.297 0 1 20-Year Fixed Rate A 3 4.875 1.000 5.055 0 1 20-Year Fixed Rate B 5.000 0.500 5.121 0 1 20-Year Fixed Rate C 5.125 0.000 5.187 0 1 15-Year Fixed Rate A 3 4.250 1.000 4.467 0 1 15-Year Fixed Rate B 4.375 0.500 4.512 0 1 15-Year Fixed Rate C 4.500 0.000 4.570 0 1 10-Year Fixed Rate A 3 4.125 1.000 4.435 0 1 10-Year Fixed Rate B 4.250 0.500 4.454 0 1 10-Year Fixed Rate C 4.375 0.000 4.473 0 1 High-Balance 15-Year Fixed Rate D 3 4.250 1.000 4.461 0 1 High-Balance 15-Year Fixed Rate B 4.375 0.500 4.512 0 1 High-Balance 15-Year Fixed Rate C 4.500 0.000 4.563 0 1 High-Balance 30-Year Fixed Rate D 3 5.000 1.000 5.130 0 1 High-Balance 30-Year Fixed Rate B 5.125 0.500 5.211 0 1 High-Balance 30-Year Fixed Rate C 5.250 0.000 5.293 0 1 30-Year Fixed Rate Jumbo A 2 5.125 1.000 5.254 1 1 30-Year Fixed Rate Jumbo B 5.250 0.500 5.336 1 1 30-Year Fixed Rate Jumbo C 5.375 0.000 5.417 1 1 -- 15-Year Fixed Rate Jumbo A 2 5.000 1.000 5.220 1 1 15-Year Fixed Rate Jumbo B 5.125 0.500 5.270 1 1 15-Year Fixed Rate Jumbo C 5.250 0.000 5.320 1 1 -- 3/1 30-Year Adjustable Rate A 3 3.625 1.000 3.431 0 0 3/1 30-Year Adjustable Rate B 3.875 0.500 3.448 0 0 3/1 30-Year Adjustable Rate C 4.125 0.000 3.465 0 0 3/1 40-Year Adjustable Rate A 3 3.875 1.000 3.438 0 0 3/1 40-Year Adjustable Rate B 4.125 0.500 3.453 0 0 3/1 40-Year Adjustable Rate C 4.375 0.000 3.467 0 0 5/1 30-Year Adjustable Rate A 3 3.375 1.000 3.401 0 0 5/1 30-Year Adjustable Rate B 3.625 0.500 3.457 0 0 5/1 30-Year Adjustable Rate C 3.875 0.000 3.514 0 0 5/1 40-Year Adjustable Rate A 3 3.625 1.000 3.441 0 0 5/1 40-Year Adjustable Rate B 3.875 0.500 3.481 0 0 5/1 40-Year Adjustable Rate C 4.125 0.000 3.531 0 0 7/1 30-Year Adjustable Rate A 3 3.875 1.000 3.670 0 0 7/1 30-Year Adjustable Rate B 4.125 0.500 3.755 0 0 7/1 30-Year Adjustable Rate C 4.375 0.000 3.841 0 0 10/1 30-Year Adjustable Rate A 3 4.375 1.000 4.092 0 0 10/1 30-Year Adjustable Rate B 4.625 0.500 4.217 0 0 10/1 30-Year Adjustable Rate C 4.875 0.000 4.342 0 0 -- 2/2 ARM 30-Year (Purchase only) DH 5.250 0.000 3.709 0 0 -- High-Balance 5/1 30-Year Adjustable Rate D 3 3.375 1.000 3.366 0 0 High-Balance 5/1 30-Year Adjustable Rate B 3.625 0.500 3.404 0 0 High-Balance 5/1 30-Year Adjustable Rate C 3.875 0.000 3.454 0 0 High-Balance 7/1 30-Year Adjustable Rate D 3 3.875 1.000 3.670 0 0 High-Balance 7/1 30-Year Adjustable Rate B 4.125 0.500 3.755 0 0 High-Balance 7/1 30-Year Adjustable Rate C 4.375 0.000 3.841 0 0 3/1 30-Year Jumbo Adjustable Rate A 2 4.875 1.000 3.719 1 0 3/1 30-Year Jumbo Adjustable Rate B 5.000 0.500 3.708 1 0 3/1 30-Year Jumbo Adjustable Rate C 5.125 0.000 3.704 1 0 -- 3/1 40-Year Jumbo Adjustable Rate A 2 5.250 1.000 3.733 1 0 3/1 40-Year Jumbo Adjustable Rate B 5.375 0.500 3.727 1 0 3/1 40-Year Jumbo Adjustable Rate C 5.500 0.000 3.725 1 0 -- 5/1 30-Year Jumbo Adjustable Rate A 3 4.375 1.000 3.791 1 0 5/1 30-Year Jumbo Adjustable Rate B 4.500 0.500 3.803 1 0 5/1 30-Year Jumbo Adjustable Rate C 4.625 0.000 3.814 1 0 5/1 40-Year Jumbo Adjustable Rate A 2 5.000 1.000 3.922 1 0 5/1 40-Year Jumbo Adjustable Rate B 5.125 0.500 3.925 1 0 5/1 40-Year Jumbo Adjustable Rate C 5.250 0.000 3.936 1 0 -- 7/1 30-Year Jumbo Adjustable Rate A 3 4.950 1.000 4.261 1 0 7/1 30-Year Jumbo Adjustable Rate B 5.075 0.500 4.286 1 0 7/1 30-Year Jumbo Adjustable Rate C 5.200 0.000 4.311 1 0 2/2 ARM 30-Year Jumbo (Purchase only) DH 6.500 0.000 4.260 1 0 -- 30 Due in 7 Fixed Rate JUMBO Balloon A 6.375 1.000 6.613 1 0 30 Due in 7 Fixed Rate JUMBO Balloon B 6.500 0.500 6.625 1 0 40 due in 7 Fixed Rate offer1 5.250 0.000 5.374 0 0 1 40 Due in 7 Fixed Rate JUMBO Balloon offer2 6.500 0.000 6.625 1 0 1 Interest Only HELOC A To 80% LTV 3.250 0 1 Home Equity Loan - 7Yrs A Up to $100,000.00 Up to 75% LTV 6.000 6.000 0 2 Home Equity Loan - 7Yrs A $100,000.01 - $250,000.00 Up to 75% LTV 6.00 6.153 0 2 Home Equity Loan - 7Yrs A Up to $100,000.00 Up to 80% LTV 6.250 6.250 0 2 Home Equity Loan - 7Yrs A $100,000.01 - $250,000.00 Up to 80% LTV 6.25 6.403 0 2 Home Equity Loan - 7Yrs B $100,000.01 - $250,000.00 Up to 90% LTV 6.99 7.145 0 2 Home Equity Loan - 10,15Yrs C $5,000-$250,000.00 To 75% LTV 6.50 6.612 0 2 Home Equity Loan - 10,15Yrs C $5,000-$250,000.00 To 80% LTV 6.75 6.863 0 2 Home Equity Loan - 10,15Yrs D $5,000-$250,000.00 Up to 90% LTV 7.50 7.614 0 2 Home Equity Loan - 20Yrs E $5,000-$250,000.00 To 75% LTV 7.50 7.566 0 2 Home Equity Loan - 20Yrs E $5,000-$250,000.00 To 80% LTV 7.75 7.817 0 2 Home Equity Loan - 20Yrs F $5,000-$250,000.00 Up to 90% LTV 8.50 8.569 0 2 Equity Edge $5,000-$25,000.00 Up to 125% LTV 12.00 12.188 Current Index 0.350 Prime Index 3.250 03/26/2010

    Read the article

  • forward slash problem in xsl ams xsql

    - by Peter Kaleta
    Hi I have simple xsql <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xsl" href="zad1.xsl" ?> <page xmlns:xsql="urn:oracle-xsql" connection="java:comp/env/jdbc/mondialDS"> <xsql:query max-rows="-1" null-indicator="no" tag-case="lower" rowset-element="continents"> select name as continent from mondial_user.Continent order by 1 </xsql:query> </page> which gives me a list of continents with "australia/oceania" among them i use XSL on above xsql : <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <!-- Root template --> <res> <xsl:template match="/continents"> <xsl:for-each select="row"> <re> <xsl:value-of select="continent"/> </re> </xsl:for-each> </xsl:template> </res> </xsl:stylesheet> ANd firefox throws error : on wrong formated xml document with : AfricaAmericaAsiaAustralia/OceaniaEurope -----------------------------------^ Help apreciated

    Read the article

  • Forward slash problem in xsl and xsql

    - by Peter Kaleta
    Hi I have simple xsql <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xsl" href="zad1.xsl" ?> <page xmlns:xsql="urn:oracle-xsql" connection="java:comp/env/jdbc/mondialDS"> <xsql:query max-rows="-1" null-indicator="no" tag-case="lower" rowset-element="continents"> select name as continent from mondial_user.Continent order by 1 </xsql:query> </page> which gives me a list of continents with "australia/oceania" among them i use XSL on above xsql : <?xml version="1.0" encoding="UTF-8" ?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <!-- Root template --> <res> <xsl:template match="/continents"> <xsl:for-each select="row"> <re> <xsl:value-of select="continent"/> </re> </xsl:for-each> </xsl:template> </res> </xsl:stylesheet> Firefox throws an error on "wrong formated xml document" with: AfricaAmericaAsiaAustralia/OceaniaEurope -----------------------------------^ Help appreciated.

    Read the article

  • Filemaker XSL Select Column By Name

    - by Kevin Sylvestre
    I am looking to export from Filemaker using column names (instead of positions). Currently I export the following XSL stylesheet that exports by position with: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fm="http://www.filemaker.com/fmpxmlresult" exclude-result-prefixes="fm" > <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/> <xsl:template match="/"> <people> <xsl:for-each select="fm:FMPXMLRESULT/fm:RESULTSET/fm:ROW"> <person> <name> <xsl:value-of select="fm:COL[01]/fm:DATA"/> </name> <location> <xsl:value-of select="fm:COL[02]/fm:DATA"/> </location> </person> </xsl:for-each> </people> </xsl:template> </xsl:stylesheet> Any ideas? Thanks.

    Read the article

  • The XPath @root-node-position attribute info

    - by Igor Savinkin
    I couldn't find the @root-node-position XPath attribute info. Would you give me a link of where i can read about it? Is it XPath 2.0? The code (not mine) is ../preceding-sibling::div[1]/div[@root-node-position]/div applied to this HTML: <div class="left"> <div class='prod2'> <div class='name'>Dell Latitude D610-1.73 Laptop Wireless Computer </div>2 GHz Intel Pentium M, 1 GB DDR2 SDRAM, 40 GB </div> <div class='prod1'> <div class='name'>Samsung Chromebook (Wi-Fi, 11.6-Inch) </div>1.7 GHz, 2 GB DDR3 SDRAM, 16 GB </div> </div> <div class="right"> <div class='price2'>$239.95</div> <div class='price1 best'>$249.00</div> </div> Firstly i fetch a price text under class='right' with this query : //DIV[contains(@class,'best')] and then i apply the above mentioned XPath with @root-node-attribute under class='left' to retrieve the rest of the record info.

    Read the article

  • XPath to find element based on another XPath element

    - by martymcfly
    Hi, I have an Java AST and I try to find a variable inside it via XPath. Lets say the variable is called 'foobar' I could use //VariableDeclarator/VariableDeclaratorId[@Image='foobar'] but what if I dont know the text 'foobar', but want to read it from another element //VariableDeclarator/VariableDeclaratorId[@Image=//SynchronizedStatement/Expression/PrimaryExpression/PrimaryPrefix/Name] the 'Name' node has the information 'foobar' in @Image, but PrimaryPrefix/Name[@Image] does not work. How must I rewrite the condition //SynchronizedStatement/Expression/PrimaryExpression/PrimaryPrefix/Name that it is the same as @Image='foobar' ? Thanks

    Read the article

  • Using XSL-FO and HTML?

    - by buggy1985
    Hi, I'm trying to transform some XML-data to HTML with XSLT for my bachelor thesis. My professor wants me to consider XSL-FO too, or at least to write some word about it. But I'm very noob to this. So my questions are: Can I combine FO with HTML? Can I use FO istead of HTML and CSS? If yes, how will my browser render this? Are there any examples/tutorials on how to transform xml into web pages with FO? Thank you very much.

    Read the article

  • How do I fix the issue with tables in xsl-fo, please help...

    - by atrueguy
    <?xml version="1.0" encoding="ISO-8859-1"?> <?xml:stylesheet type="text/xsl" href="currency.xslt"?> <currencylist> <title>Currencies By Country</title> <countries> <country>Australia</country> <currency>Australian Dollar</currency> </countries> <countries> <country>Austria</country> <currency>Schilling</currency> </countries> <countries> <country>Belgium</country> <currency>Belgium Franc</currency> </countries> <countries> <country>Canada</country> <currency>Canadian Dollar</currency> </countries> <countries> <country>England</country> <currency>Pound</currency> </countries> <countries> <country>Fiji</country> <currency>Fijian Dollar</currency> </countries> <countries> <country>France</country> <currency>Franc</currency> </countries> <countries> <country>Germany</country> <currency>DMark</currency> </countries> <countries> <country>Hong Kong</country> <currency>Hong Kong Dollar</currency> </countries> <countries> <country>Italy</country> <currency>Lira</currency> </countries> <countries> <country>Japan</country> <currency>Yen</currency> </countries> <countries> <country>Netherlands</country> <currency>Guilder</currency> </countries> <countries> <country>Switzerland</country> <currency>SFranc</currency> </countries> <countries> <country>USA</country> <currency>Dollar</currency> </countries> </currencylist> This is my exact xml code. I have written a xsl-fo for this xml file and I am failing to produce the output in a table. please check and help me in this. ASAP. <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> <fo:simple-page-master master-name="Letter" page-height="11in" page-width="8.5in"> <fo:region-body region-name="only_region" margin="1in" background-color="#CCCCCC"/> </fo:simple-page-master> </fo:layout-master-set> <fo:page-sequence master-reference="Letter"> <fo:flow flow-name="only_region"> <fo:block text-align="left"><xsl:call-template name="show_title"/></fo:block> <fo:table-and-caption> <fo:table> <fo:table-column column-width="25mm"/> <fo:table-column column-width="25mm"/> <fo:table-column column-width="25mm"/> <fo:table-header> <fo:table-row> <fo:table-cell> <fo:block font-weight="bold">SI No</fo:block> </fo:table-cell> <fo:table-cell> <fo:block font-weight="bold">Country</fo:block> </fo:table-cell> <fo:table-cell> <fo:block font-weight="bold">Currency</fo:block> </fo:table-cell> </fo:table-row> </fo:table-header> <fo:table-body> <fo:table-row> <fo:table-cell> <fo:block><xsl:call-template name="select_position"/></fo:block> </fo:table-cell> <fo:table-cell> <fo:block><xsl:call-template name="select_country"/></fo:block> </fo:table-cell> <fo:table-cell> <fo:block><xsl:call-template name="select_currency"/></fo:block> </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> </fo:table-and-caption> </fo:flow> </fo:page-sequence> </fo:root> </xsl:template> <xsl:template name="show_title" match="currencylist"> <h2><xsl:value-of select="currencylist/title"/></h2> </xsl:template> <xsl:template name="select_position" match="currencylist"> <xsl:for-each select="currencylist/countries"> <xsl:value-of select="position()"/> </xsl:for-each> </xsl:template> <xsl:template name="select_country" match="currencylist"> <xsl:for-each select="currencylist/countries"> <xsl:value-of select="country"/> </xsl:for-each> </xsl:template> <xsl:template name="select_currency" match="currencylist"> <xsl:for-each select="currencylist/countries"> <xsl:value-of select="currency"/> </xsl:for-each> </xsl:template> </xsl:stylesheet> Kindly help me out in this to produce a output in the table.

    Read the article

  • Problem in using xpath with xslt having distinct values

    - by AB
    I have XML like, <items> <item> <products> <product>laptop</product> <product>charger</product> <product>Cam</product> </products> </item> <item> <products> <product>laptop</product> <product>headphones</product> <product>Photoframe</product> </products> </item> <item> <products> <product>laptop</product> <product>charger</product> <product>Battery</product> </products> </item> </items> and I am using xslt on it //can't change xpath as getting it from somewhere else <xsl:param name="xparameter" select="items/item[products/product='laptop' and products/product='charger']"></xsl:param> <xsl:template match="/"> <xsl:for-each select="$xparameter"> <xsl:for-each select="products/product[not(.=preceding::product)]"> <xsl:sort select="."></xsl:sort> <xsl:value-of select="." ></xsl:value-of>, </xsl:for-each> </xsl:for-each> </xsl:template> I want the output to be laptop charger cam Battery But I m not getting the result as I m expecting...distinct values is working fine ..something is getting wrong when I am adding that and claus

    Read the article

  • JSTL XML Transforms not working with nested XSL includes

    - by timxyz
    I have a bit of JSP that does this: <c:import url="/xsl/Transformer.xsl" var="xslt" /> <x:transform doc="${actionBean.dom}" xslt="${xslt}" xsltSystemId="/xsl/"> This transforms the XML exactly as expected so long as Transformer.xsl contains no <xsl:include> tags or so long as any documents it does include do not include anything. However, if I use an XSL which includes a document which in turn includes another document, I get the following error: ERROR: 'Invalid URI 'NestedInclude.xsl Could not resolve entity reference: "NestedInclude.xsl"'.' Note that the JSP is contained in the directory below the xsl documents. If all my XSLs and JSPs are in the same directory (and I remove the xsltSystemId attribute) then everything would work fine, but I don't really want to do this. Can anyone see anything I'm doing wrong, as it's a bit of a killer at the moment and the JSTL documentation is next to useless.

    Read the article

  • Using ms: xpath functions inside XPathExpression

    - by Filini
    I am trying to use Microsoft XPath Extension Functions (such as ms:string-compare http://msdn.microsoft.com/en-us/library/ms256114.aspx) inside an XPathExpression object. These functions are extensions inside the MSXML library, and if I use them in an XslCompiledTransform (simply adding the "ms" namespace) they work like a charm: var xsl = @" <?xml version=""1.0"" encoding=""UTF-8""?> <xsl:stylesheet version=""2.0"" xmlns:xsl=""http://www.w3.org/1999/XSL/Transform"" xmlns:xs=""http://www.w3.org/2001/XMLSchema"" xmlns:fn=""http://www.w3.org/2005/xpath-functions"" xmlns:ms=""urn:schemas-microsoft-com:xslt""> <xsl:output method=""xml"" version=""1.0"" encoding=""UTF-8"" indent=""yes""/> <xsl:template match=""/Data""> <xsl:element name=""Result""> <xsl:value-of select=""ms:string-compare(@timeout1, @timeout2)""/> </xsl:element> </xsl:template> </xsl:stylesheet>"; var xslDocument = new XmlDocument(); xslDocument.LoadXml(xsl); var transform = new XslCompiledTransform(); transform.Load(xslDocument); Then I tried using them in an XPathExpression: XPathNavigator nav = document.DocumentElement.CreateNavigator(); XPathExpression expr = nav.Compile("ms:string-compare(/Data/@timeout1, /Data/@timeout2)"); XmlNamespaceManager manager = new XmlNamespaceManager(document.NameTable); manager.AddNamespace("ms", "urn:schemas-microsoft-com:xslt"); expr.SetContext(manager); nav.Evaluate(expr); But I get an exception "XsltContext is needed for this query because of an unknown function". XsltContext is a specific XmlNamespaceManager, but I don't know if it's possible to instantiate it without an actual XslCompiledTransform (it's abstract) and use it as my expression context. Is there any way to do this (or any other way to use ms: extensions inside an XPathExpression)?

    Read the article

  • Display different xsl:attribute depending on the code

    - by Johann
    Dear All, I have the following xsl code in an xsl document <A target="_blank" style="text-decoration=none"> <xsl:attribute name="href">viewdoc.aspx?doc=<xsl:value-of select="URLFilePath"/>&amp;mode=inline</xsl:attribute> <xsl:attribute name="prefix"><xsl:value-of select="FileName"/>: </xsl:attribute> <IMG src="images/word_small.gif" border="0"/> </A> and in the code-behind I am doing this newItemNode = xmlDocument.CreateElement("URLFilePath") newItemNode.InnerText = correctedPath xmlItemNode.ParentNode.AppendChild(newItemNode) Now that works fine for word documents. However I need a way in code to check the extension of the file, and display the correct Image and xsl:attribute depending on the If statement. So the If statement will be like this:- If correctedPath.ToLower.Contains(".doc") Then //display the word icon and attributes Else //display the excel icon and attributes End If Can you please give me some tips and help on how I can achieve this? Thanks

    Read the article

  • Problem in using xpath with xslt having distint values

    - by AB
    I have XML like, <items> <item> <products> <product>laptop</product> <product>charger</product> <product>Cam</product> </products> </item> <item> <products> <product>laptop</product> <product>headphones</product> <product>Photoframe</product> </products> </item> <item> <products> <product>laptop</product> <product>charger</product> <product>Battery</product> </products> </item> </items> and I am using xslt on it //can't change xpath as getting it from somewhere else <xsl:param name="xparameter" select="items/item[products/product='laptop' and products/product='charger']"></xsl:param> <xsl:template match="/"> <xsl:for-each select="$xparameter"> <xsl:for-each select="products/product[not(.=preceding::product)]"> <xsl:sort select="."></xsl:sort> <xsl:value-of select="." ></xsl:value-of>, </xsl:for-each> </xsl:for-each> </xsl:template> I want the output to be laptop charger cam Battery But I m not getting the result as I m expecting...distinct values is working fine ..something is getting wrong when I am adding that and claus

    Read the article

  • NSXMLDocument objectByApplyingXSLT with XSL Include

    - by Kristof
    I'm having some trouble with XSL-processing when there are stylesheets that include other stylesheets relatively. (the XML-files may be irrelevant but are included for completeness - code is at the bottom). Given the XML-file: <?xml version="1.0" ?> <famous-persons> <persons category="medicine"> <person> <firstname> Edward </firstname> <name> Jenner </name> </person> <person> <firstname> Gertrude </firstname> <name> Elion </name> </person> </persons> </famous-persons> and the XSL-file: <?xml version="1.0" ?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xi="http://www.w3.org/2001/XInclude" version="1.0"> <xsl:template match="/"> <html><head><title>Sorting example</title></head><body> <xsl:apply-templates select="famous-persons/persons"> <xsl:sort select="@category" /> </xsl:apply-templates> </body></html> </xsl:template> <xsl:include href="included.xsl" /> </xsl:stylesheet> referencing this stylesheet in included.xsl: <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xi="http://www.w3.org/2001/XInclude" version="1.0"> <xsl:template match="persons"> <h2><xsl:value-of select="@category" /></h2> <ul>Irrelevant</ul> </xsl:template> </xsl:stylesheet> how can I make it that the following code fragment: NSError *lError = nil; NSXMLDocument *lDocument = [ [ NSXMLDocument alloc ] initWithContentsOfURL: [ NSURL URLWithString: @"file:///pathto/data.xml" ] options: 0 error: &lError ]; NSXMLDocument *lResult = [ lDocument objectByApplyingXSLTAtURL: [ NSURL URLWithString: @"file:///pathto/style.xsl" ] arguments: nil error: nil ]; does not give me the error: I/O warning : failed to load external entity "included.xsl" compilation error: element include xsl:include : unable to load included.xsl I have been trying all sorts of options. Also loading XML documents with NSXMLDocumentXInclude beforehand does not seem to help. Is there any way to make the XSL processing so that a stylesheet can include another stylesheet in its local path?

    Read the article

  • Dynamic Grouping and Columns

    - by Tim Dexter
    Some good collaboration between myself and Kan Nishida (Oracle BIP Consulting) over at bipconsulting on a question that came in yesterday to an internal mailing list. Is there a way to allow columns to be place into a template dynamically? This would be similar to the Answers Column selector. A customer has said Crystal can do this and I am trying to see how BI Pub can do the same. Example: Report has Regions as a dimension in a table, they want the user to select a parameter that will insert either Units or Dollars without having to create multiple templates. Now whether Crystal can actually do it or not is another question, can Publisher? Yes we can! Kan took the first stab. His approach, was to allow to swap out columns in a table in the report. Some quick steps: 1. Create a parameter from BIP server UI 2. Declare the parameter in RTF template You can check this post to see how you can declare the parameter from the server. http://bipconsulting.blogspot.com/2010/02/how-to-pass-user-input-values-to-report.html 3. Use the parameter value to condition if a particular column needs to be displayed or not. You can use <?if@column:.....?> syntax for Column level IF condition. The if@column is covered in user documentation. This would allow a developer to create a report with the parameter or multiple parameters to allow the user to pick a column to be included in the report. I took a slightly different tack, with the mention of the column selector in the Answers report I took that to mean that the user wanted to select more of a dimensional column and then have the report recalculate all its totals and subtotals based on that selected column. This is a little bit more involved and involves some smart XSL and XPATH expressions, but still very doable. The user can select a column as a parameter, that is passed to the template rather than the query. The parameter value that is actually passed is the element name that you want to regroup the data by. Inside the template we then reference that parameter value in our for-each-group loop. That's where we need the trixy XSL/XPATH code to get the regrouping to happen. At this juncture, I need to hat tip to Klaus, for his article on dynamic sorting that he wrote back in 2006. I basically took his sorting code and applied it to the for-each loop. You can follow both of Kan's first two steps above i.e. Create a parameter from BIP server UI - this just needs to be based on a 'list' type list of value with name/value pairs e.g. Department/DEPARTMENT_NAME, Job/JOB_TITLE, etc. The user picks the 'friendly' value and the server passes the element name to the template. Declare the parameter in RTF template - been here before lots of times right? <?param@begin:group1;'"DEPARTMENT_NAME"'?> I have used a default value so that I can test the funtionality inside the template builder (notice the single and double quotes.) Next step is to use the template builder to build a re-grouped report layout. It does not matter if its hard coded right now; we will add in the dynamic piece next. Once you have a functioning template that is re-grouping correctly. Open up the for-each-group field and modify it to use the parameter: <?for-each-group:ROW;./*[name(.) = $group1]?> 'group1' is my grouping parameter, declared above. We need the XPATH expression to find the column in the XML structure we want to group that matches the one passed by the parameter. Its essentially looking through the data tree for a match. We can show the actual grouping value in the report output with a similar XPATH expression <?./*[name(.) = $group1]?> In my example, I took things a little further so that I could have a dynamic label for the parameter value. For instance if I am using MANAGER as the parameter I want to show: Manager: Tim Dexter My XML elements are readable e.g. DEPARTMENT_NAME. Its a simple case of replacing the underscore with a space and then 'initcapping' the result: <?xdoxslt:init_cap(translate($group1,'_',' '))?> With this in place, the user can now select a grouping column in the BIP report viewer and the layout will re-group the data and any calculations based on that column. I built a group above report but you could equally build the group left version to truly mimic the Answers column selector. If you are interested you can get an example report, sample data and layout template here. Of course, you can combine Klaus' dynamic sorting, Kan's conditional column approach and this dynamic grouping to build a real kick ass report for users that will keep them happy for hours..

    Read the article

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