428 Topics
Hi there I am using XSLT to process an XML file.I want to copy all whole XML and want to modify some attribute node.I using follwing code [code] <?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" xmlns:db="http://tempuri.org/DatabaseXMLSchema.xsd"> <xsl:output method="xml" indent="yes"/> <xsl:template match="@* | node()"> <xsl:copy> <xsl:apply-templates select="@* | node()"/> </xsl:copy> …
Hi, Can we declare a variable at one place and assign it a value at another in XSLT? I know that we can assign a value to a variable only once (please correct me if I am wrong), however i am not sure whether we can do it in 2 …
Hi, I have an xml I want to make an exact copy of it. Here is my input/xsl but in the output I get all the elements but namespace prefix is not coming for all the elements. See the red highlighted section [code] <?xml version="1.0" encoding="UTF-8"?> <env:Envelope xmlns:env = "http://schemas.xmlsoap.org/soap/envelope/" …
Hi everyone- I really need help with an XML Stylesheet ASAP. I am stuck on this one part and I really need to finish it off. I have attached a ZIP folder of the files. The instructions for what I'm supposed to be doing are in the file titled 'assignment.doc' …
Hi guys, I am new to this list and really hope to gain a lot from all the experienced professionals out there. Here is what I need to do this time around: I have an input code which is a complete flat structure- grouping of elements is desired out of …
Hi, I have an xml input (wsse) and I want to change the value of one of the attribute "mustUnderstand" while copying. Input.xml [code] <?xml version="1.0" encoding="UTF-8"?> <env:Envelope xmlns:env = "http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd = "http://www.w3.org/2001/XMLSchema" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"> <env:Header> <wsse:Security env:mustUnderstand = "1" xmlns:wsse = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <wsse:UsernameToken xmlns:wsse = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <wsse:Username …
Hi, [B][U]Requirements:[/U] Need to find the DAY-NAME from the date.[/B] I used the XSL function in my XSL file. [CODE] <xsl:function name="functx:day-of-week-name-en" as="xs:string" xmlns:functx="http://www.functx.com"> <xsl:param name="date" as="xs:anyAtomicType?" /> <xsl:sequence select="('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday')[functx:day-of-week($date) + 1]" /> </xsl:function> [/CODE] and I use this piece of code to call the function: Declare a variable 'sDate' …
I am trying to transform 1 XML document to another using XSLT. I want to call the value from my source XML to the element in my result XML as the value of an attribute. Source code- <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href="test.xsl"?> <catalog> <cd> <title>Empire Burlesque</title> <artist>Bob Dylan</artist> <country>USA</country> …
Hello, I need to just replace the XML namespace using XSLT. My input XML looks like as follows. I just want to replace "oldNameSpace" with "newNameSpace" and rest of XML want as it is.. [CODE] <?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:impl="oldNameSpace" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soapenv:Body> <impl:requestData xmlns:impl="oldNameSpace"> <xmlString ChangeDate="2008-12-18T14:47:11.773+01:00" IdentificationNumber="WDDKJ5GBXAF000229" OrderNumber="08 295 …
I know there wasn't a fourm for this but everyone here seems to know so much. I got a project due tommorow and the requirement of it is that we need an XSLT style sheet with computational ability. I really don't get this whole thing and find the use of …
I'm using the Altova engine and have the following code [CODE] <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:pfp="http://www.mystuff.com/pfp"> <xsl:output method="xml" omit-xml-declaration="yes"/> <msxsl:script language="C#" implements-prefix="pfp"> <msxsl:using name="clitype:System.Text"/> <msxsl:using name="clitype:System.Xml"/> <msxsl:using name="clitype:System.Xml.XPath"/> <msxsl:using name="clitype:System.Collections.Generic"/> <msxsl:using name="clitype:System.IO"/> <![CDATA[ public string Next3() { return "<test1><test2>success!</test2></test1>"; } ]]> </msxsl:script> <xsl:template match="/"> …
Hi, I have a multiple xslt process. I would like to divide a group, for example the party that start between 00:00:00 - 10:00:00 called as "Group A" 10:00:00 - 14:00:00 will call as "Group B" or 14:00:00 - 20:00:00 will call as "Group C" and I would like to …
Hi all, I current have in place some XSL to strip html tags out. It had worked untill stuff started comming in with internal styling. I tried to introduce something to strip out the <style> tags, but it doesn't work. Here is where I have gotten so far: [CODE] <xsl:if …
Can anyone give me a solution to the following problem? [code=syntax]<root> <elem1> <titel><bold>1.<tab/>The text <italic>of the</italic> headline</bold></titel> </elem1> <par>...</par> <par/> </root> [/code] Should become the following structure (attention: double bold-element): [code=syntax]<root> <elem1> <titel> <nummer><bold>1.</bold></nummer> <text><bold>The text <italic>of the </italic> headline</bold></text> </titel> </elem1> </root> [/code] Thanks a lot!
Greetings everyone, My name is Tommy, Based on the tutorial codes written by hol.sten ([url]http://user.services.openoffice.org/en/forum/viewtopic.php?t=3490&f=45[/url]), i've tried to write similar codes for the same purposes, but with an added complexity. I encounter quite a problem when i tried to export the Ooo calc ods file. The problem lies in one …
Hi, I need some help in xslt. I am trying to develop a xslt , I have pasted the short format of all 3 files below, The Input xml file. The xslt and output xml. I will be very great full If anybody can help. I have tried everything but …
HI All, I am facing one problem that i have to do a vertical span for the table columns. But i am not getting any way to solve this problem. My input xml is as follows:- [CODE] <tabular frame="all" colsep="1" rowsep="1" orient="port" id="ctab1"> <tgroup cols="3" tgroupstyle="tabular" colsep="1" rowsep="1" align="left" charoff="50" …
I wonder (as I couldn't find [I]anything[/I] either on DaniWeb or anywhere else) why should one use XML and XSLT rather than plain XHTML? I couldn't find a rationale arguing for the use of XML and XSLT in connection with dynamic web content stored in a database. Zend does provide …
How to upload an XML file through JSP web interface and transform that XML using XSLT and return the HTML file for download.
Hi all, I have a one problem in xsl. I dont want to do further execution, when a condition reaches. I need to come out from the style sheet. Could you any one help me out on this. Thanks, Veera
I have a xml file like this [CODE] <?xml version="1.0" encoding="UTF-8" standalone="no"?> <orders> <order orderDate="1/1/2009" orderNo="1"> <customer id="nnghiem" name="nguyen nghiem"/> <item id="item-1" price="25000" quantity="0"/> <item id="item-2" price="22000" quantity="3"/> </order> <order orderDate="2/2/2009" orderNo="2"> <customer id="lp" name="lampard"/> <item id="item-1" price="25000" quantity="2"/> <item id="item-2" price="22000" quantity="8"/> </order> <order orderDate="3/3/2007" orderNo="3"> <customer id="nnghiem" name="nguyen …
I need to convert the following XML file [code=xml]<Para> <PgfTag value="Body" type="str"/> <Pgf> <PgfFont> <FFamily value="Times New Roman" type="str"/> <FWeight value="Regular" type="str"/> </PgfFont> </Pgf> <ParaLine> <String>Underlined charcter</String> </ParaLine> </Para> <Para> <PgfTag value="Body" type="str"/> <Pgf> <PgfFont> <FFamily value="Times New Roman" type="str"/> <FWeight value="Regular" type="str"/> <FAngle value="Italic" type="str"/> </PgfFont> </Pgf> <ParaLine> <String>Italic …
Hi all, I have 2 unrelated questions. I need to do a grouping of data using XSLT. I need this to function like how a nested IF within an IF would function. After which, I need to group the data so that I can split it into multiple files according …
So I created a template for a simple link builder function. Problem is, when I use it, I don't get the link, I get just the text. Could anyone help me understand what I'm doing wrong? Thanks! [CODE] <xsl:variable name="ReadMore"> <xsl:call-template name="linkBuilder" > <xsl:with-param name="linkID" select="format-number(@ID, '#,##0.#;-#,##0.#')" /> </xsl:call-template> </xsl:variable> …
I have to check value of a variable in XSLT if it is null then i have to set it to default "$" so for that i have written following XSLT code: <XSL:variable name dummy select= "ArrayOfBookMark/BookMark[ShortName='Asp-7041-EndVar1]/Value"> <XSL:choose> <XSL:when test="($dummy!='')"> <XSL:variable name="dummy1" select="$dummy"/> </when> <XSL:otherwise> <XSL:variable name="dummy1" select="'$'"/> </XSL:variable> <XSL:otherwise> …
Hi, How I could fetch first three character from a string variable. Say for I fetched a variable message="ABCtest" .... now I want to test that the first three character matches ABD or not .. How I could code to achieve in xslt? Cheers Manish
hello, can you please tell me what code must i write in my xslt file so i can convert it with xml to a windows word 2003 file (using c#)?please... Thanks
Hi Folks, I have this following xslt script: [CODE]<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.2" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ibn="http://ibn.traveltainment.de/2009/001" xmlns="http://www.opentravel.org/OTA/2003/05" xmlns:ota="http://www.opentravel.org/OTA/2003/05" xmlns:ota1="http://www.opentravel.org/OTA/2002/11" xmlns:ns3="http://www.opentravel.org/OTA/2002/11" xmlns:fo="http://www.w3.org/1999/XSL/Format" exclude-result-prefixes="SOAP-ENV ota ns3"> <xsl:output method="text" encoding="UTF-8"/> <xsl:variable name="soap" select="name(/SOAP-ENV:Envelope/SOAP-ENV:Body/ota:*)"/> <xsl:variable name="soap2" select="name(/soap:Envelope/soap:Body/ns3:*)"/> <xsl:variable name="base" select="name(/*)"/> <xsl:template match="/"> <xsl:choose> <xsl:when test="count(soap:Envelope/soap:Body) > 0"> <xsl:value-of select="$soap2"/> <xsl:value-of select="$soap"/> </xsl:when> <xsl:when …
I have this basic transformation script: [CODE]<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.2" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ibn="http://ibn.traveltainment.de/2009/001" xmlns="http://www.opentravel.org/OTA/2003/05" xmlns:ota="http://www.opentravel.org/OTA/2003/05" xmlns:ota1="http://www.opentravel.org/OTA/2002/11" exclude-result-prefixes="SOAP-ENV ota"> <xsl:output method="text" encoding="UTF-8"/> <xsl:variable name="outermostElementName" select="name(/SOAP-ENV:Envelope/SOAP-ENV:Body/ota:*)"/> <xsl:template match="/"> <xsl:choose> <xsl:when test="count(SOAP-ENV:Envelope/SOAP-ENV:Body) > 0"> <xsl:value-of select="$outermostElementName"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="/*"/> </xsl:otherwise> </xsl:choose> </xsl:template> </xsl:stylesheet>[/CODE] in which I'm trying to extract a particular …
Hello, I want to create a word 2003 type document (.doc). I have a xml file and a xslt file. The first one has the data the second has the style. Then I combine these two through my c# code and create the doc file. Can you please help me …
Hi , I am fetching a xml file having n records (destinations one detination may have m routes) as below: <destination> <filename>ABC</filename> <route>ftp://manish_test:[email protected]:21/%2F1ST-FTP_Poller/dimensionsABC/</route> <route>ftp://manish_test:[email protected]:21/%2F1ST-FTP_Poller/dimensionsBCD/</route> </destination> I have to fetch all these records based on file name (say the above destination for file staring with ABC) and so on... How I …
The requirement in simple logic is(please ignore the syntax i just want to tell u the requirement): <variable name="a" select="//SearchRequest/@Input"> <template> <when a=1> One </when> <when a=2> Two </when> <otherwise> None <otherwise> <!--here i want to create one element with above value which is condition based i.e One or Two …
hello, there is a main xslt-script with a "do_this_and_that"-template. in an from the main included script ther is such "do_this_and_that"-template too. is it possible to call the "do_this_and_that"-template from the main by this included "do_this_and_that"-template? many thanks for your answer(s)
Hello, I have 2 problems with an xml file: 1. the original xml has no structure because all the tags (except the root element) are at the same level. What I want to do is to insert a tag <toto>, whose children would be one <FM1Titre> and all the tags …
Hi! I´m a newbie trying to get the size of groups with XSLT 2.0 What I'm trying to do is get the count of different child elements of a certain node, so I'm grouping them by name. Given the following sample xml file what I want is a 2 columns …
Here is a sample of the XML that I am starting with: XML: any.xml [code] <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="any.xsl"?> <root> <device> <device_Info> <name>Name 1</name> <type>Type</type> </device_Info> <drive_Pair> <status>Ready</status> <Local> <l_name>10E5</l_name> </Local> <Remote> <l_name>0651</l_name> </Remote> </drive_Pair> #Can be 1 or many <drive_Pair>'s {<drive_Pair> ... </drive_Pair>} # Can only be …
Hello, I am currently trying to use the code below to increment the currentChild after every iteration. However, in the output shown below, it is apparent that the value is never changing. There are four children in this example, so it is printing out the statements the correct number of …
Hi I am looking for help with an xsl transform of an xml file. The problem is with <xsl:with-param>. The following is what I have: [code=xml]<xsl:param name="paramTest">$LINKNUM$</xsl:param> <key name="$LINKNUM$">SELECT count(1) from applications</key> <xsl:choose> <xsl:when test="$paramTest = '0' "> do this........ </xsl:when> <xsl:otherwise> do this......... </xsl:otherwise> </xsl:choose>[/code] This select count returns …
Hi All, I want to replace single quote and ampersand in XSLT of data view web part. I tried to use translate function. But when i do a translate of &#39; then & is also getting replaced. Could some one help me on this. Thanks, dm
Lets say i wanted to add a node [B]copyVar[/B] on the desired output then get the value of [B]ID[/B] from the target XML how can i do that in XSLT? Thanks for the help target XML: [CODE]<?xml version="1.0" encoding="UTF-8" standalone="no"?> <customer_account_create> <Customer> <Name>Bam</Name> <ID>1</ID> <Lastname>Test01</Lastname> <addr>Alabang</addr> </Customer> </customer_account_create>[/CODE] desired output …
I am very new to XML & XSL but I know there is a way to build blog aggregators. I have a XML document that pulls the blogs in with the URI: [CODE]<?xml version="1.0"?> <!DOCTYPE feeds SYSTEM "feeds.dtd"> <feeds> <feed name="Mary Rose's Blog" provider="Blogabond" spec="rss" version="2.0" uri="http://www.blogabond.com/rss/rss.aspx?UserID=7835"> <keyword name="meow"/> </feed> …
I need some help creating an XSLT to group RSS-like data by unique category (sorted alphabetically) and then sort each item by date under each sorted category. (Yes I realize this will produce a Cartesian product). Here is a trimmed down version of the XML source... [CODE]<channel> <item> <title>test1</title> <pubDate>2009-07-16</pubDate> …
Just started with XLS and I have this code, which I think suppose to copy every node to the output file. But I am really not sure... [code] <!-- Copies everything? But it doesn't?? --> <!-- Matches any element node --> <xsl:template match="*"> <xsl:copy> <!-- Matches any attribute node --> …
<div class="verticalTabContainer"> <div class="verticalTabContent"> <!-- Begin Vertical Tab Navigation --> <div class="verticalTabNavigation"> <ul> <li class="verticalTabNavigationCurrent verticalTabNavigationFirst"><a href="#vtab-overview">Overview</a></li> <li class="verticalTabNavigationPreviousCurrent"><a href="#vtab-features">Features & Benefits</a></li> <li><a href="#vtab-requirements">System Requirements</a></li> <li><a href="#vtab-demos">Demos/Tutorials</a></li> <li><a href="#vtab-awards">Awards/Certifications</a></li> <li><a href="#vtab-customer">Customer Stories</a></li> <li><a href="#vtab-news">News/Events</a></li> <li><a href="#vtab-resources">Resources</a></li> <li><a href="#vtab-community">Community</a></li> <li><a href="#vtab-support">Support</a></li> </ul> <div class="verticalTabNavigationVoid"><div class="verticalTabNavigationFill ie"></div></div> </div> <!-- End Vertical Tab …
Im trying to format my xslt form to a table that I have: Horsepower-Electric Values Revolutions Number of Disks blank num 1 num 2 num 3 rev1 hpe1 hpe2 hpe3 rev2 hpe4 hpe5 hpe6 rev3 hpe7 hpe8 hpe9 And so far, Ive gotten the xslt form to come out somewhat …
Hello everyone. I am trying to implement CDATA wrapping of values conditionally in XSLT. My requirements are: - If the value contains <, >, &, ", ' then it must be wrapped in CDATA in the transformed output. - if the value does not contain any of the above characters, …
Hello, I have XML , I am trying to create a xslt on these xml. <Qxml> <Qxml> <Net> <Property Name="DOCTOR" SName="DOC" LongDesc="YYY DOC" Code="666" STC="1"/> <Property Name="ENGINEER" SName="ENG" LongDesc="XXX ENG" Code="777" STC="2"/> <Property Name="TEACHER" SName="TEA" LongDesc="ZZZ TEA" Code="888" STC="3"/> <Property Name="CLERK" SName="CLE" LongDesc="TTT CLE" Code="999" STC="4"/> </Net> </Qxml> </Qxml> I …
i have an XML-file that i want to clean up with an XLST-file and save it as an new XML-file. I am still a beginner but like to learn more. I have used a "for-each" function but i cant find what i am doing wrong. He loops the file, but …
Hi, Its bit urgent! Can someone please show me how to use nested loop. I have following XML file. I need to print amount in minus if any of the ApplicationReply value is credit, else the Amount should be positive. <xsl:for-each select="Reply/ApplicationReplies/ApplicationReply[@Name='credit']"> <xsl:if test="position() = 1"> <xsl:value-of select="concat($sep, $sign, /Reply/Amount,$sep)"/> …
Hi all, I need some help on parsing latin character, when i am applying stylesheet(XSLT) on source xml file this will give some target xml file but when transforming file those latin characters converting into "?"(Question mark). Please help me how to solve this problem...
The End.