428 Topics
I am using VS 2010 and am debugging my XSLT on one of my XML files. This works fine. It splits so I can see 2 files at once - but that will only show me 2 files at once. 1) XSLT file as I walk through it 2) Either …
I need to find a way to carry a value I get from a template to another template. Both templates are on the same level. I thought I could use variable or param to do this but I cannot make it work. I tried finding a way using Google but …
Can anyone provide me with an example working xsl contact form, nothing fancy just an example form that I can test and learn from. Thanks GW
Hi All, I have a xml something like this [CODE]<addres> <country>xxxx</country> <city>xxxx</city> <name>xxxxxxxx</name> <street>xxxxxxx</street> <!-- like this n number of element can come --> </addres>[/CODE] Out of those all tag any of tag e.g. <name> I don't want to produce in out put xml for exp. output should be like …
I am having a bit of trouble fighting through a namespace issue. I have the follow input document [CODE]<?xml version="1.0" ?> <ns:CustomObject3WS_CustomObject3QueryPage_Output xmlns:ns="urn:crmondemand/ws/customobject3/10/2004"> <ns:LastPage>true</ns:LastPage> <ListOfCustomObject3 xmlns="urn:/crmondemand/xml/customObject3"> <CustomObject3> <AccountExternalSystemId /> <AccountId>ADOA-3CN5XR</AccountId> <AccountName /> <CreatedBy>Olga CLEMENDOT, 09/08/2009 13:59:17</CreatedBy> <CreatedDate>09/08/2009 13:59:17</CreatedDate> <CustomObject3Id>ADOA-3I66LA</CustomObject3Id> <ExternalSystemId>ADOA-3CN5XR</ExternalSystemId> <ModifiedBy>VĂ©ronique CHINA, 06/22/2010 14:34:53</ModifiedBy> <Name>ADOA-3CN5XR</Name> <Type /> <ModifiedDate>06/22/2010 14:34:53</ModifiedDate> <stZ_DS1_ACCOUNT_CUSTMO>SIM35200031</stZ_DS1_ACCOUNT_CUSTMO> …
HEllo, I try to follow this tutorial : [url]http://edutechwiki.unige.ch/en/XSLT_Tutorial_-_Basics[/url] Im using xmlcopyeditor as IDE. So I typed the first example. Do a xml transform and I see these message : Cannot transform: Error at line 7, column 12: Failed to parse QName 'xsl:' Anyone a idea how to solve this …
I am new to XSLT and am trying to solve the following transformation. I have an XML that looks like this... [CODE]<Groups> <Group> <GroupSelector>52</GroupSelector> <GroupDescription>Group 52</GroupDescription> <GroupValue>ABCD</GroupValue> </Group> <Group> <GroupSelector>27</GroupSelector> <GroupDescription>Group 27</GroupDescription> <GroupValue>PQRS</GroupValue> </Group> <Group> <GroupSelector>20</GroupSelector> <GroupDescription>Group 20</GroupDescription> <GroupValue>XYZA</GroupValue> </Group> <Group> <GroupSelector>15</GroupSelector> <GroupDescription>Group 15</GroupDescription> <GroupValue>MNOP</GroupValue> </Group> </Groups> [/CODE]There may be …
Hi i need to convert the xml to xml inut xml is [CODE]<associds> <associd> <associdentifierValue>12345</associdentifierValue> <associdtype>AAA</associdtype> </associd> <associd> <associdentifierValue>24688</associdentifierValue> <associdtype>BBB</associdtype> </associd> </associds>[/CODE] expected out is if child element value is BBB - i need to remove the whole element in associd. [CODE]<associds> <associd> <associdentifierValue>12345</associdentifierValue> <associdtype>AAA</associdtype> </associd> </associds>[/CODE] XSLT is given …
I am trying to run this XPath expression (that is, trying to count how many element content strings in my XML file end with letter-one-f ('a') or letter-two-f ('A'): [code=xslt]<xsl:value-of select="count( substring(.,string-length(.) -1,string-length(.) -1)=$letter-one-f or substring(., string-length(.) -1,string-length(.) -1)=$letter-two-f )"/>[/code] but I don't know how to refer to the 'current …
I have this problem with xsl if I entered the state and the city is working fine ,but if I miss one or the other doesnt work Thanks [CODE]<?php $city=$_GET['city']; $state=$_GET['state']; $dom = new DOMDocument; $dom->load('Sample.xml'); $xsl = new DOMDocument; $xsl->load('asn6.xsl'); $xslt = new XSLTProcessor(); $xslt->importStylesheet($xsl); if(isset($city)) $xslt->setParameter(NULL, 'city', $city); …
help needed to output a comma separated ASCII file from an incoming xml file using xslt. Below Listed are the input and output. I am struck on defining the template to read each character from the input xml file. Any help is highly appreciated... [B]INPUT:[/B] <DST xml:lang="en-US"> <jobName version="1.0">SRVAuthenticate</jobName> <trace>0</trace> …
A simple thing to do but I have a brain blockage this morning and would like some help. I have the following XML... <IntegrationMessage> <RoutingSlip> <NewMessageType> <Market> </Market> </NewMessageType> </RoutingSlip> <XML> <NewFile> ----- ----- I want to extract off using XSLT everything under the XML node so I am left …
Hey there, seems like this part of DaniWeb is not as active as other parts, but in hope I get an answer, I'm asking. I have this xml file: [CODE] <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href="site.xsl"?> <navigation> <link> <name>About</name> <content></content> <target>www.google.com</target> </link> <link> <name>Friends</name> <content></content> <target>www.google.com</target> </link> <link> <name>Archive</name> <content></content> …
Hi, I am new to XSL. I don't know how to loop through XML and filter duplicates using XSL. I tried several ways but i could hot get it done. Here is my requirement. My XML --------- [code] <?xml version="1.0" ?> <X12Summary> <Unit volume="10" Amount="100"> <Identifier Name="Customer ID" Value="12345" /> …
Hi All, Can anyone please let us know whether this can be done using apply templates or for each. The below xml, MuliResponse, can contain, multiple, even number, of soap Body parts. The funda is, if we have one card in the input, multiResponse will have 2 soap Body parts.4 …
Hi, I am just a beginner to XSLT. My Input XMLs is like - <?xml version="1.0" encoding="UTF-8"?> <ABC> <filter> <name>Key Value</name> <value><![CDATA[A=344#B=123445#C=432#D=1432#E=16485]]></value> </filter> </ABC> I have made a XSLT which will fetch the value of above Key_Value <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <xsl:output method="xml" omit-xml-declaration="yes"/> <xsl:template match="/"> <xsl:apply-templates/> …
Hi, need help in xslt usage in VERSION 1.0 ... i have requirement to convert a xml to anaother xml using xslt: For each property != empty condition exists for property==empty take the previous condition and update the value section only please help... input xml is :- <data jsxid="jsxroot"> <record …
I am trying to use <xsl:if test= "node/text() = '.' to copy a node from a destination xml document to the source xml document, but only if there is a match between the text() nodes being checked from each document. My if test= "node/text() statement is always returning a match …
Hi everyone, May I ask how to solve Index out of bound exceptions in xslt ? thank you :)
Hi All, I am new to XML,XSLT. I have been assigned to task of Generating HTML pages based on the XML file & the condition is No Hardcoding of Nodes and other details. My XML file is of the below struct: Node inside Nodes , and those nodes would contain …
Hey guys, I have a problem extracting some data out of this XML file: [CODE]<?xml version="1.0" encoding="UTF-8"?> <ph:Graphs xmlns:ph="http://www.merge.something.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <ph:Graph name="mass_spring_mo"> <ph:Element id="0" type="Fixed"> <ph:Port id="1" type="port"> <ph:Attribute> <ph:AttributeField name="type" value="string"/> <ph:AttributeField name="name" value="type"/> <ph:AttributeField name="value" value="flange"/> </ph:Attribute> </ph:Port> </ph:Element> <ph:Element id="2" type="Spring"> <ph:Attribute> <ph:AttributeField name="type" value="int"/> <ph:AttributeField name="name" …
I am struggling with how to parse the following XML document. I need to "walk" through the nodes via the Rank attribute (asc) with 2 rules: 1. Keep a running copy of what the Channel is so I can compare it to the next node in the list 2. In …
Hi, How can i convert this xml file into target xml using xslt. I tried everything, but i am not able to put the subquestions inside the corresponding questions. Please help even the logic. INPUT XML: [CODE]<?xml version="1.0" encoding="UTF-8"?> <tables> <table> <tr> <tc> <data> This is the title of the …
I'm having a XSLT problem. I am reading from one xml sheet and creating another using XSLT. The final transformed XML has an element <Recreations> that contains <Recreation> elements. I am using <xsl:for-each> to create the <Recreation> elements. So my xslt looks something like this: <Recreations> <xsl:for-each select="MyItems"> <xsl:if select="cust:isThisARecreation(@Description)> …
I have spent quite a long time attempting to determine how to display various "elements" and "attributes" in HTML, but I have been having some issues. From what I have gathered I need to create an XSLT file that I can then reference in HTML, correct? When I try to …
I have the following xml source file : [code=xml]<root> <child1></child1> <child2></child2> </root>[/code] I would like to convert it to [code=xml]<MYOWNTAG1> <CURRENTDATE>CurrentDate</CURRENTDATE> <CURRENTTIME>CurrentTime</CURRENTTIME> </MYOWNTAG1> <MYOWNTAG2> <XML> <root> <child1></child1> <child2></child2> </root> <XML> </MYOWNTAG2>[/code] Any help would is appreciated.
Any look up function can we use, to make this simple, so that we can write in 5 or 6 lines. We have similar lines repeating for around 300 lines. All we need is to map 'currcode' with the corresponding alphabets. <xsl:if test="$currCode='784'"> <xsl:value-of select="'AED'" /> </xsl:if> <xsl:if test="$currCode='971'"> <xsl:value-of …
Hi All, I have an xml [CODE] <?xml version="1.0" encoding="UTF-8"?> <columns> <column> <name></name> <displayname></displayname> <attributes> <attribute> <name>width</name> <value>100</value> </attribute> <attribute> <name>text-align</name> <value>left</value> </attribute> </attributes> </column> <column> <name>VersionCode</name> <displayname>Version Code</displayname> <attributes> <attribute> <name>width</name> <value>200</value> </attribute> <attribute> <name>text-align</name> <value>right</value> </attribute> </attributes> </column> <column> <name>MaterialType</name> <displayname>Material Type</displayname> <attributes> <attribute> <name>width</name> <value>100</value> </attribute> <attribute> …
Hi All, I have one scenario, In xslt i have used a input tag of type="button" with id="button1", Now in xslt if a condtion is met, suppose <xsl:if test="price > 10"> i need to disable the button1 Can any one please suggest me how to achieve this using xslt. Thanks …
Hello experts, I am new to XSL and would like to transform a NewML G2 format XML into another XML. For example I have: [CODE] <?xml version="1.0" encoding="UTF-8" standalone="no"?><!-- SUMMARY: - Structure: NML2 SNI Text - Based On: NAR v1.2_1, NML2 v2.1_1 AUTHOR: --><!-- ========================================================= --> <newsMessage xmlns="http://iptc.org/std/nar/2006-10-01/" xmlns:rtr="http://www.reuters.com/ns/2003/08/content" xmlns:x="http://www.w3.org/1999/xhtml" …
Hi ALL, As i am new to XSLT i am not able to implement the logic, Please share your views if any know's how do this. i have an xml [CODE]<?xml version="1.0" encoding="UTF-8" ?> <?xml-stylesheet type="text/xsl" href="Temp.xsl"?> <Rowsets DateCreated="2011-02-14T12:24:00" EndDate="2011-02-14T12:24:00" StartDate="2011-02-14T11:24:00" Version="12.0.2 Build(88)"> <Rowset> <Columns> <Column Description="BatchNumber" MaxRange="1" MinRange="0" Name="BatchNumber" …
I have a big problem and i'm not even sure if solution exists for my problem... So the problem is: I have a xsd file, and I need to create xslt which will create html table with 2 columns: the first column is <xs:documentation> for all elements names (4 example …
Hi All, i have an XML [CODE]<?xml version="1.0" encoding="UTF-8" ?> <Rowsets DateCreated="2011-02-14T12:24:00" EndDate="2011-02-14T12:24:00" StartDate="2011-02-14T11:24:00" Version="12.0.2 Build(88)"> <Rowset> <Columns> <Column Description="BatchNumber" MaxRange="1" MinRange="0" Name="BatchNumber" SQLDataType="12" SourceColumn="BatchNumber" /> <Column Description="VersionCode" MaxRange="1" MinRange="0" Name="VersionCode" SQLDataType="3" SourceColumn="VersionCode" /> <Column Description="MaterialType" MaxRange="1" MinRange="0" Name="MaterialType" SQLDataType="12" SourceColumn="MaterialType" /> <Column Description="LotNumber" MaxRange="1" MinRange="0" Name="LotNumber" SQLDataType="4" SourceColumn="LotNumber" /> …
<?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" indent="no" encoding="ISO-8859-1"/> <xsl:param name="context"/> <xsl:param name="renderId"/> <xsl:param name="token"/> <xsl:include href="../../wcf/controls.xsl"/> <!-- buttons with spaces inbetween --> <xsl:template match="button[@hidden='true']"/> <xsl:template match="button"> <xsl:text> </xsl:text> <input type="submit" name="{@id}" id="{@id}" value="{@label}" onclick="iceSubmitPartial(form, this, event);return false;"/> <xsl:text> </xsl:text> </xsl:template> <xsl:template match="tree-extras-top | tree-extras-bottom"> <tr> <td class="navText"> <xsl:apply-templates/> </td> …
Hello out there! Can anyone help me with a hint of how to solve this problem: I have a text file and I want to count the frequency of each stopword in the file. I have an XML file stopwords.xml against which I check for stopwords. My code is working …
I am writing an XSL document, using which I need to print a report. The report will have two tables and the table values and lables/header column should be displayed only if there is data in my JAVA object of class "Transfers". I thought of using <xsl:if> condition to check …
Hi, I am trying to convert a word xml into another xml file format using XSLT. Here I need to check the all the following siblings with some condition. If that condition is satisfied, the control should exit from that loop. How can i achieve this, I am desperately need …
i need help with xslt .. i need to figure out start and end date by looking at a specific post date if DAY of the post date is between [1 - 15] then go back one month and for day use 15 - 31 if DAY of the post …
Hi All, Recently i have developed a new XSL file in altova XMLSpy , and the XSL version is 2.0. When i tried the Transformation , in different environemt(without using XMLSpy), i am thrown with below error. ERROR: 'Syntax error in 'descendant::element()'.' FATAL ERROR: 'Could not compile stylesheet' javax.xml.transform.TransformerConfigurationException: Could …
Hi All Ive got an XSL for some XML data. The XML data contains a date field called OrderNum_OrderDate. How can I filter the data so it only displays data from the XML that has a date of TODAY + 7 days. I only want to see information for the …
Hi, I'm trying to extract an inner node and place it at the level as the element <para>. However I'm unable to figure it out. Source XML: [CODE] <para> Lorem ipsum dolor sit amet, <i>consectetur</i> adipiscing elit. Aenean vestibulum pharetra metus. <formula altimg="fig1">E = mc^2</formula> Curabitur ac nibh purus, eget …
I am doing a school assignment. One of the problems I have is to add a duration on to an existing date. I can't find any support for this problem with standard XSLT. So, I had a stab at using EXSLT which has an add method to do exactly what …
Hey guys, I'm tying to merge two XML file for days but it doesn't work. Here is the problem: I want to merge these XML files: graphs.xml [CODE] <?xml version='1.0' encoding='utf-8'?> <ph:Graphs xmlns:ph="http://www.merge.something.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > <ph:Graph name="mass_spring_mo"> <ph:Element id="0" type="Mass"> <ph:Attribute> <ph:AttributeField name="type" value="float" /> </ph:Attribute> <ph:Port id="1" type="port"> <ph:Attribute> …
Hi All, The below is the value of the variable when used with apply templates [CODE]<results multiple-outputs="true" transactional="true" xmlns:v12="http://www.americanexpress.com/informationservice/schema/ICS/CustomerService/v1/" xmlns:v1="http://www.americanexpress.com/informationservice/service/ICS/CustomerService/v1/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" > <url input="multi-request-A">http://127.0.0.1:2022/ICS/CustomerProvider/v1</url> <url input="multi-request-A">http://127.0.0.1:2023/ICS/CustomerProvider/v1</url> <url input="multi-request-A">http://127.0.0.1:2024/ICS/CustomerProvider/v1</url> </results> [/CODE] The below is the value of a variable without apply templates and using for each [CODE] <results multiple-outputs="true" transactional="true"> <url …
Hi All, I have the attached xml and xsl, xml being the input to the xsl. The xml contains two account numbers and the xsl will print the account numbers. Now what we need is, number of variables equal to no: of account numbers in the xml, to be declared …
Hi every one, I have a question for xslt and xml output I need to extract the text from creator or p with attribute class tags but if the creator and p with attribute class tags are the same I will not output the p tags. and each enclosed it …
I have an XML page with the XSLT embedded in the file. I cannot have an external file for the XSLT in this application. Additionally I must reference the stylesheet in a way that the XML file's name can change. I can do this with... [CODE]<?xml-stylesheet type="text/xsl" href="#mySheet"?>[/CODE] ...where... [CODE]<xsl:template …
I have the following XMl file: Code: <Vehicles> <Company name="Ford"> <Vehicletype Vtype="Suv"> <Price>12000</Price> </Vehicletype> </Company> <Company name="Ford"> <Vehicletype Vtype="Truck"> <Price>20000</Price> </Vehicletype> </Company> </Vehicles> And I am trying to transform it to: Code: <Vehicles> <Company name="Ford"> <Vehicletype Vtype="Suv"> <Price>12000</Price> </Vehicletype> <Vehicletype Vtype="Truck"> <Price>20000</Price> </Vehicletype> </Company> </Vehicles> Any help would be appreciated …
I'm really stuck attempting to pull bulleted text from a rather unwieldy source. Ideally, I'd like to be able maintain the structure of bulleted items as they appeared in an odp slide. I'm using an <xsl:for-each> to loop through the text items. Essentially, I need to figure out how to …
Hi All, I am not sure where am i going wrong but this is something which made me realise that my understanding about the for-each and apply-templates was wrong. :( I have 2 XMLs, I want to display the 'value' present in one XML after comparing the 'name' present in …
The End.