428 Topics
Hi Folks, I have two questions: 1). How to escape CDATA in your xslt script? [code] <xsl:template match="/"> <![CDATA[ <xsl:apply-templates select="node()"/> ]]> </xsl:template> [/code] In the above code, the template inside CDATA does not get executed. What I actually want is the result from this template (<xsl:apply-templates select="node()"/>) to be …
Hi Folks, I'm new to xslt transofrmation so need a little help in transforming the following example. Input: [CODE]<Persons>12</Persons>[/CODE] Output: [CODE]<PassengerRPHs ListOfPassengerRPH="1 2"/>[/CODE] The main thing above is to put a space between digits, 123 -> 1 2 3. It would be perfect if the transformation also handles 9101112 -> …
Hello, I have a xml file below from which I want to extract the data using xslt. I trying to create the xslt but no results , I have some hard coated values in the xslt which I want in the output xml. I also need the other values from …
Hi all, I have a piece of xml+html which I'm trying to cleanup using xslt. Here's a sample; [CODE]<body> <TEXT>A few bright spots are emerging in the small to medium-size enterprises landscape, but funding issues remain as much a problem for those who want to expand overseas as for those …
Hi Folks, I have an xml response, which I want to store into the database (mysql) through XSLT script. For basic data types, I can just prepare a simple insert statement through xslt script which further passed to java for further execution. <xsl:template match="ota:OTA_TT_HotelResRS">insert into booking (createdBy, bookingNumber, created, modified, …
I use an old program favoritesync.exe to manage Windows Favorites across multiple PCs. It creates an xml with the Favorites data and an xsl file to render it. It has been working successfully through IE7. Now I've begun using Firefox (3.5 beta 4) and I get the message "Error loading …
I have a questions table and it has a couple of columns startTag and closeTag which contain html which tells the page how I want to render the question [code] <xsl:value-of select='Questions/startTag' /><xsl:attribute name="name"><xsl:value-of select='practiceResponseId' /></xsl:attribute><xsl:attribute name="Value"> <xsl:value-of select='response' /></xsl:attribute><xsl:value-of select='Questions/closeTag' /></td> [/code] this way I can render the question …
Hi All I'm a newbie at XSLT and I need help to do the following. I am trying to transform the attached XML so it inserts a blank row whenever the current account number(curACCTNO) does not equal the previous account (preACCTNO) number i.e. group similar rows with the same accno …
Hi everyone, I've been combing the message boards for the last few days trying to find something that will work for me, but to no success. I had 0 experience with XSLT before this which definitely doesn't help out in the search but I am determined to learn. What I've …
Hi All, I heartly appreciate I have 3 question: 1. following-sibling function not working in the “si – docid” attribute 2. starts-with function not working in “laid” element 3. choose method want correct (I need single dates element) in my xsl repeated the <dates> This is my XSL: <xsl:template match="div[@class='DocContainer']"> …
Hi All, Many thanks for your response, Actually you were given the coding looking good, what I gave the input, but I want to change the input structure the xslt not working properly. Here I place one more sample input and output (please read command instruction in output file) for …
Hi, I'm trying to delelop a stylesheet to add some tags to the top and bottom of HTML head and body nodes. So, I've started off with a stylesheet that looks like [code] <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/"> <xsl:apply-templates select="html"/> </xsl:template> <xsl:template match="html"> <xsl:comment> <xsl:value-of select="' Entered …
Hi I would like to know how in XSLT to select the QTY into a variable and the use that to repeat the GIR, that number of times? e.g. if QTY 12 need to repeat GIR 12 times <QTY> <QTY01-QuantityDetails> <QTY0101-QuantityQualifier>1</QTY0101-QuantityQualifier> <QTY0102-Quantity> <xsl:value-of select="QTY"/> </QTY0102-Quantity> </QTY01-QuantityDetails> </QTY> <GIR> <GIR01-SetIdentificationQualifier/> <GIR02-IdentificationNumber>xxxx …
Hi all, Just a noob with an easy question :). Given this DTD [code]<!ELEMENT multimedia_format (description, examples, references)> <!ATTLIST multimedia_format name CDATA #REQUIRED> <!ELEMENT description (p+)> <!ELEMENT p ((text|em|strong|abbr|quoted_text|citation)*)> <!ELEMENT text (#PCDATA)> <!ELEMENT em (#PCDATA)> <!ELEMENT strong (#PCDATA)> <!ELEMENT abbr (#PCDATA)> <!ATTLIST abbr fulltext CDATA #REQUIRED> <!ELEMENT quoted_text (#PCDATA)> <!ATTLIST …
I'm having trouble calling this template. I want to find the median "price" for all "widgets" This is as far as I've gotten: [code] <xsl:call-template name="median"> <xsl:with-param name="nodes" select="*what goes here?*"/> </xsl:call-template> [/code] My XML: [code] <widgets> <widget price="10" category="1" /> <widget price="5" category="1" /> <widget price="20" category="2" /> </widgets> …
Cannot figure out what is wrong with this stylesheet - attach it to any xml, it doesn't actually use the xml in this stripped down example: [code=xsl] <?xml version='1.0' encoding='ISO-8859-1'?> <xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'> <xsl:output method='html' indent='yes' media-type='text/html' /> <xsl:variable name='columns' select='10' /> <xsl:template match='/'> <table> <tr> <td> <xsl:attribute name='colspan'><xsl:value-of select='floor( …
Having an issue where both my xml and xsl are parsing fine (when viewed in firefox) but when combined together, throw an error: Error loading stylesheet: Parsing an XSLT stylesheet failed. (I noticed a suimilar post but was reccommended by the system to start a new thread, as it was …
I need some help with avg... I am attached files for xml --- I am struggling.... the question i have is : 1. What is the average speed of all the dinosaurs? A. <xsl:value-of select="format-number((sum(dinosaurs/*/speed[@units='mph'])div count(dinosaurs/*/speed[@units='mph']))"/>ft it does not work... or B. <xsl:value-of select="sum(//speed) div count(//speed)" /> or C.9. <xsl:value-of …
Hello all. I am new to XSLT and I cant figure out how to solve this problem: I have a XML source document looking like this: <file> <object> <name>A</name> <type>1</type> </object> <object> <name>B</name> <type>1</type> </object> <object> <name>C</name> <type>2</type> </object> ... </file> where I only have the <type> 1 and 2 …
Hi! I'm new to the forum and to xslt. My problem is that I have to transform a cloud-like data hierarchy xml into a tree-like data hierarchy xml. Let me give you some example: input xml: [CODE] <DATA> <OBJECT id="1" class="CAR"> <ATTRIBUTE name="name" value="CITROEN CX" /> <ATTRIBUTE name="content" value="photo_link" /> …
I am trying to output a table which lists a customer's payments whilst keeping a running total. A section of my XML is as follows: [CODE]<Accounts> <Payment> <CustomerID>1</CustomerID> <Date>2009-03-16</Date> <Amount>22</Amount> </Payment> <Payment> <CustomerID>4</CustomerID> <Date>2009-02-12</Date> <Amount>35</Amount> </Payment> <Payment> <CustomerID>2</CustomerID> <Date>2009-05-17</Date> <Amount>41</Amount> </Payment>[/CODE] I have included the following code to sort the …
What are some of the advantages of using XSLT and XPATH version 2.0 over their 1.0 predecessors? Any disadvantages?
My input xml/xmi file contains special characters like <>,space and " .When i am applying XSLT transform on it these as coming as it is or in some different format like <-><,>->> and "e ->".I nees those to come as coresponding symbols like <,> or ". For space i used …
Hey all, I have requirement, on the basis of indicator = 'TL' I have to pick CoverageName and Limit and add the amounts of similiar coverages. Is there any way I could do that. Here's xml: <Policy> <Vehicle id="v1"> <Coverage> <CoverageName>ABC</CoverageName> <CoverageLimit>Upto 50,000</CoverageLimit> <CoverageAmount>100</CoverageAmount> <Indicator>TL</Indicator> </Coverage> <Coverage> <CoverageName>EFG</CoverageName> <CoverageLimit>Upto 50,000</CoverageLimit> …
Hello, I am trying to get my xml to format just the way I need it. A little background. I am using a flash piece which has 'site news' displaying with an xml document. I then have another button below the flash piece that says "view all news items", which …
Hi, I'm new to XSLT and i was hoping someone could point me in the right direction with the problem below... I have the following XML: [code] <list level="1"> <item>1</item> <list level="2"> <item>1</item> <item>2</item> <item>3</item> </list> <item>2</item> </list> [/code] I would like to extract the nested list and insert it …
Hello all, I am quite new with XML and XSLT, have been making good progress with tutorials and forums. I am transforming a XML file into HTML but I cannot figure out how to transform the pieces that make up my mixed complexType. I have searched and searched and come …
Requirement-"The stylesheet should be modified not to add DUCK(product type) if there exists one with the same action(product action)". ie how can i write validation in XSLT to add a DUCK if and only if the product action is different. In the xml given below the action of two products …
i start to w3shools xsl tutorial and created one xml and xsl file and linked them together, after running the xml file i got the following error: The XML page cannot be displayed Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh …
I really need help in copying the root node. I have been spending far too much time on this, and I can't beleive that it should be that difficult. I can't use 'copy-of', as that will copy all the children as well. I need to copy the root node, and …
Hi, I want to replace the C# code into XSLT.In that list object is there,how can I create it into XSLT. C# code: public void listAdd(string param0, string param1) { System.Collections.ArrayList listValues = new System.Collections.ArrayList(); listValues.Add(param0); listValues.Add(param1); } The above code should be replaced in XSLT using XPath functions.Please help …
I have the following xml file and wanted to generate another xml file. While using the xml:element to create elements on the fly, the xslt debugger is throwing an error saying expected Qname. How can I get away with this. xsl code: [code] <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output …
Hi Friends, i m using this format to convert amount to currency <xsl:value-of select='format-number(current(), "#,##0.00")' /> 100,000.00 -i m getting the out put like this but i need to get1,00,000.00 can any one help me out on this issue please .... Thanks in Advance pavan
Hi All, I have a stylesheet with a identity transformation template and an element specific template. However, when I ran the below stlyesheet over a xml file, only identity transformation is invoked. My element specific template isn't. There is a target namespace for the schema that defines the elements. I …
Hi All, I have a set of elements to be added to an existing XML document. I would like to write a XSLT tranformation for this. My requirement is that I need to check whether the element is already there in the XML file. Only if its non existent, I …
Hi, I am making some loops using xsl:for-each. Now I want to concatenate strings of each iteration to the previous iteration results. And want to keep it in some variable for later use. e.g.: for each iteration suppose i get a,b,c. Now I want to put them in a variable …
Hi everyone! First post here. I've been programming for years but this xslt confuses the heck out of me. Can someone please tell me how to get this piece of code to work? It's a fragment reading in an rss feed and I'm trying to get it to only show …
If i use the SUM function to sum those node with d.p. value....the output in sometimes are look strange...... [U]XML File[/U] <allgroup> <group_1 id="1"> <salary>100000.01</salary> </group_1> <group_1 id="2"> <salary>89000.02</salary> </group_1> <group_1 id="3"> <salary>89000.03</salary> </group_1> <group_1 id="4"> <salary>89000.04</salary> </group_1> <group_1 id="5"> <salary>89000.05</salary> </group_1> </allgroup> [U]XSL File[/U] <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output encoding='utf-8'/> …
Hi, I have some data in a sharepoint List in the attached format and I would like to get an XSLT to be applied to get an xml output of the data in the following format: Type and ElementID are attributes of the Element. <Element Type= "Toplevel" ElementID="A" column8value="boolean" > …
Hi, I have been trying to get resorts from an XML tree but I have found that it seems to be very flat and not helpful at all in terms of targeting information. Attribute names are all the same whether it is the world element, region of world element, country …
hello, I am having trouble dsipalying more than one value on the same line, I am not sure the exact way to go about this, <xsl:if test="/item/survey/pastCitations/citation[@REGVERS !='FV10']"> <xsl:attribute name="value-of">fixQuote(top[survey][pastCitations][ <xsl:value-of select="/item/survey/pastCitations/citation[@VTAG = $vtag] /@_name" /> [text]]) </xsl:attribute> </xsl:if> for this line I would like to dispaly the Text and …
Hi, I would like to count all nodes "source" of "word" that start with the string "ABC". I can have multiple "word" inside a the element "wordGrp", as in entry/section/following-sibling::wordGrp/word/following-sibling::source For-each-group and a following count(current-group()) did not work for me, the XSLT processor returned "A sequence of more than one …
Hi, Here is my use case - I have a Java app from which I'm calling an XSLT to transform XML into HTML - The XSLT is a file in JAR - The XML is passed as a stream from another application Now, the problem is: - I need to …
Who do know a solution for the following issue: I need to program in XSL a check for double element is a part of the tree. xpath preceding-sibling does not check enough element of the tree and preceding to much. my tree like as: root | ---------------------------------------------------------------------------- | | | …
Hi, I need to do some sorting of the XML file. First, group the group_1 first and then sort those group_1 block by SORT_ID and Salary. Second, group the group_2 and then sort those group_2 block by SORT_ID. I just try the below and it works if the XML only …
Hello forum! I'm new to this forum, but I hope someone will take the time to help me, I have been grappling with this for days. I would very much appreciate it if you could help me understand what I'm doing wrong/where my thinking is off target. I find this …
Hi guys, Im brand new to doing tansformations and cannot seem to wrap my head around it. I have a Xml File which looks something like [code] <parentNode> <childnode1 att1="1" att2="2"/> <childnode2></childnode2> <childnode1 att1="1" att2="2"/> <childnode21></childnode21> <childnode1 att1="1" att2="2"/> <childnode22></childnode22> <childnode1 att1="1" att2="2"/> <childnode23></childnode23> <childnode1 att1="1" att2="2"/> <childnode24></childnode24> <optionalNode></optionalNode> </parentNode> …
Ok so here is my situation. I am generating a wordpress (blog) import file from an xml file using xslt. I am trying to add an hour to each publish date node. So for example.... <title> Post 1 </title> <pubdate>8-10-2008 5:00</pubdate> ( I realize the format may not be right) …
How can I Introduce Javascript(?) while running xslt on xml file? I am trying to process 1 single xml file; Inside that xml file there is a <image> tag; tag not contains any information about width; I am aplying xslt on this xml. how can i calculate the width.. My …
[B]I want to show the thumbnails of all images whis is also available in XML file. Please help me how to do this[/B] I have this type of XML (test.xml) : [CODE=xml] <?xml version="1.0" encoding="UTF-16"?> <?xml-stylesheet type="text/xsl" href="test.xsl"?> <My_Collection_DB Name="New Database.bxd"> <CD_DVD Name="200810151145" Size="175701901" Date="10/15/2008 11:51 AM" Disk_ID="4" Volume_Serial_Number="-1533743809" Volume="200810151145"> …
The End.