Posts
 
Reputation
Joined
Last Seen
Ranked #3K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
100% Quality Score
Upvotes Received
4
Posts with Upvotes
4
Upvoting Members
4
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
1 Commented Post
1 Endorsement
Ranked #858
Ranked #1K
~75.6K People Reached
Favorite Tags

128 Posted Topics

Member Avatar for himit

XSL variables are immutable. You cannot change the value of a variable once it is set. If I understand your requirements correctly you are trying to number a simple list. If this is the case, try the following. [code] <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:output method="xml" indent="yes"/> <xsl:template …

Member Avatar for Balakumar_1
1
16K
Member Avatar for rat1973

You are still thinking in terms of procedural languages such as C or Java. Here is how to do it in a declarative language such as XSL. [code] <?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="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="/"> <xsl:element name="root"> <xsl:apply-templates select="catalog/cd/artist"/> </xsl:element> </xsl:template> <xsl:template match="catalog/cd/artist"> <xsl:element …

Member Avatar for Krishna_30
0
10K
Member Avatar for wani_raj

Here is a java applet. [url]http://media.pearsoncmg.com/aw/aw_kurose_network_2/applets/csmacd/csmacd.html[/url]

Member Avatar for ryu_hemt_always
0
2K
Member Avatar for Kruddler
Member Avatar for dark3lf

Try [code] mountPoint="`df -h | grep $pth | tr -s ' ' | cut -d ' ' -f6`" [/code] BTW, you could significantly simplify things by piping df output to awk

Member Avatar for thekashyap
0
202
Member Avatar for ilyaz

Assuming the revised document looks like this [code] <?xml version="1.0"?> <root> <word id="4"> <text>Joe</text> </word> <word id="2"> <text>name</text> </word> <word id="3"> <text>is</text> </word> <word id="1"> <text>My</text> </word> </root> [/code] then [code] <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text"/> <xsl:variable name="theID" select='1' /> <xsl:key match="word" name="idkey" use="@id"/> <xsl:template match="root"> <xsl:value-of select="key('idkey',$theID)/text"/><xsl:text> …

Member Avatar for fpmurphy
0
140
Member Avatar for chou73

It is hard to help you. There is no relationship between input document and the expected output document. For example where is Button 2 in the input document?

Member Avatar for chou73
0
213
Member Avatar for programmer321

If you are using ksh93 (Korn Shell 93) , date manipulation is builtin, i.e. [code] $ printf "%(%y%m%d)T\n" yesterday 100318 $ [/code]

Member Avatar for cfajohnson
0
3K
Member Avatar for achava

You might want to also remove all the resulting whitespace by adding [code] <xsl:strip-space elements="*"/> [/code] to the stylesheet provided by iceandrews.

Member Avatar for fpmurphy
0
135
Member Avatar for glfnute

Just for completeness, here is an XSL1.0 solution. A wildcard ('*') namespace prefix is not permitted in XSLT1.0. The solution is to match using the local-name() function. [code] xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes"/> <xsl:template match="/"> <xsl:apply-templates select="*[local-name()='AccountWS_AccountQueryPage_Output']"/> </xsl:template> <xsl:template match="*[local-name()='AccountWS_AccountQueryPage_Output']"> <xsl:copy> <xsl:apply-templates select="*[local-name()='LastPage']"/> <xsl:apply-templates select="*[local-name()='ListOfAccount']"/> </xsl:copy> </xsl:template> <xsl:template match="*[local-name()='ListOfAccount']"> …

Member Avatar for fpmurphy
0
125
Member Avatar for hanuinfy

This works for XSLT1 [code] <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:template match="product"> <product> <xsl:attribute name="display"> <xsl:value-of select="display/@value"/> </xsl:attribute> <xsl:attribute name="count"> <xsl:value-of select="count/@value"/> </xsl:attribute> </product> </xsl:template> </xsl:stylesheet> [/code]

Member Avatar for fpmurphy
0
243
Member Avatar for reeves14

XSLT1.0 does not have built-in date arithmetic. Have a look at [url]http://exslt.org/date/index.html[/url] fo extension functions which handle dates. Some of the functions should enable you to do what you want to do. XSLT2.0 has the subtract-dates series of functions

Member Avatar for iceandrews
0
156
Member Avatar for techie929

Have a look at the following post: [url]http://www.daniweb.com/code/snippet217275.html[/url]

Member Avatar for fpmurphy
0
102
Member Avatar for RickW

[code] <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes"/> <xsl:template match="resultset" > <groceries xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <xsl:apply-templates select="*"/> </groceries> </xsl:template> <xsl:template match="@*|node()"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> </xsl:stylesheet> [/code] outputs the following: [code] <?xml version="1.0"?> <groceries xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <row> <sample>cereal</sample> <count>1</count> </row> <row> <sample>macaroni</sample> <count>1</count> </row> <row> <sample>cookies</sample> <count>2</count> </row> <row> <sample>rice</sample> …

Member Avatar for RickW
0
166
Member Avatar for keeda

If you are using ksh93 you can use the print %T syntax to achieve what you want to do [code] $ date="08/02/2010" $ print $date 08/02/2010 $ date=$(printf "%(%-m/%-d/%Y)T" "$date") $ print $date 8/2/2010 $ [/code]

Member Avatar for cfajohnson
0
77
Member Avatar for k.e.v

This should do what you want: [code] <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:freshness="http://freshness" xmlns:history="http:history" xmlns:wo="http:hello"> <xsl:output method="xml" indent="no"/> <xsl:template match="/|comment()|processing-instruction()"> <xsl:copy> <!-- go process children (applies to root node only) --> <xsl:apply-templates/> </xsl:copy> </xsl:template> <xsl:template match="*"> <xsl:element name="{local-name()}"> <!-- go process attributes and children --> <xsl:apply-templates select="@*|node()"/> </xsl:element> </xsl:template> …

Member Avatar for k.e.v
0
136
Member Avatar for himit
Member Avatar for fpmurphy
0
259
Member Avatar for renoua

Here is a simple example of how to do it. Suppose you have the following XML file [code] <timesheet> <date>04072010</date> </timesheet> [/code] and you apply the following stylesheet to it [code] <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" /> <xsl:template match="/"> <xsl:apply-templates /> </xsl:template> <xsl:template match="date"> <xsl:element name="date"> <xsl:call-template …

Member Avatar for awofesof
0
3K
Member Avatar for faby

I don't think you can do what you want to do. I don't know of any place where all the Festival APIs are documented other than the source code Some but not all of the APIs are documented here: [url]http://www.cstr.ed.ac.uk/projects/festival/manual/festival_28.html#SEC126[/url] Why not ask your question on the Festival mailing list. …

Member Avatar for fpmurphy
0
631
Member Avatar for sdr001
Member Avatar for khess

I totally agree with sourceview [quote] Second, I don't want Stallman to enter into my decision of what is right for me! I want the server, desktop and embedded distros that best meet my personal needs and my business needs, not the needs and desires of a socialist and/or other …

Member Avatar for sameer5151
1
4K
Member Avatar for ajwei810192
Member Avatar for ajwei810192
0
6K
Member Avatar for himit

Here is a non-recursion based solution: [code] <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:output method="xml" /> <xsl:template match="/"> <xsl:element name="X"> <xsl:attribute name="name"> <xsl:value-of select="//B[1]/C" /> </xsl:attribute> <xsl:element name="Y"> <xsl:attribute name="name"> <xsl:value-of select="//B[2]/C" /> </xsl:attribute> <xsl:element name="Z"> <xsl:attribute name="name"> <xsl:value-of select="//B[3]/C" /> </xsl:attribute> </xsl:element> </xsl:element> </xsl:element> </xsl:template> </xsl:stylesheet> [/code]

Member Avatar for fpmurphy
0
122
Member Avatar for f_atencia

If you are using XSLT1, the easiest way is to use the date:difference() in EXSLT. If you are using XSLT2 the subtraction of two dates gives a xs:dayTimeDuration which a ISO 8601 truncated format PnDTnHnMnS, where nD represents the number of days, T is the date/time separator, nH the number …

Member Avatar for fpmurphy
0
286
Member Avatar for rb3rd
Member Avatar for phingko

[code] <xsl:template match="/"> <xsl:value-of select="count(//title[@classification='computing' and following-sibling::year &gt; 2000] )" /> </xsl:template> [/code]

Member Avatar for fpmurphy
0
91
Member Avatar for veroniclake

You cannot display Japanese code points using ISO-8859-1 (Latin-1). All XML processors must support at least UTF-8 and UTF-16 but not necessarily other encodings. You need to specify a suitable encoding for the particular Japanese syllabary that you are using, i.e. Hiragana, Katakana, Kanji or Romaji

Member Avatar for fpmurphy
0
103
Member Avatar for awk
Member Avatar for IdanS

Without seeing your XML file, I cannot give a precise answer. The element you need to use is <xsd:unique> and your schema modification should look something like this: [code] <xsd:unique name= "uniqueId"> <xsd:selector xpath="./yourxpath" /> <xsd:field xpath="@Id"/> </xsd:unique> [/code]

Member Avatar for IdanS
0
108
Member Avatar for soumya_mjmder

Here is one way of doing it. [code] <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml"/> <xsl:template match="Employee"> <Employee> <xsl:apply-templates select="EmployeeDetails" /> </Employee> </xsl:template> <xsl:template match="EmployeeDetails"> <xsl:variable name="employee" select="@EmployeeName" /> <xsl:variable name="id" select="@EmployeeId" /> <xsl:element name="EmployeeDetails"> <xsl:attribute name="{$employee}"><xsl:value-of select="$id" /></xsl:attribute> <xsl:attribute name="CompanyName"><xsl:value-of select="@CompanyName" /></xsl:attribute> <xsl:attribute name="CompanyAddress"><xsl:value-of select="@CompanyAddress" /></xsl:attribute> <xsl:attribute name="ContactNo"><xsl:value-of select="@ContactNo" …

Member Avatar for fpmurphy
0
2K
Member Avatar for jeff_mallatt

You can eliminate the spurious xmlns="" by adding the namespace prefix to the NewNode element, i.e. [code] <xsl:template match="a:*[@Mark]"> <xsl:variable name="the_val" select="/a:Top/a:Wanted/@Val"/> <a:NewNode NewVal="{$the_val}" /> </xsl:template> [/code] This produces the following output [code] <Top xmlns="http://foo.bar.com/something"> <Wanted Val="get this"/> <NewNode NewVal="get this"/> </Top> [/code] BTW, if you are using a XSLT …

Member Avatar for jeff_mallatt
0
1K
Member Avatar for DigitALL
Member Avatar for sfeinst
Member Avatar for fpmurphy
0
103
Member Avatar for navneetktyagi

You cannot redirect to another stylesheet. You can, however, include or import another stylesheet using the <xsl:import> or <xsl:include> instructions.

Member Avatar for fpmurphy
0
36
Member Avatar for Patrickero

Here is a stylesheet which will do what you want to do. I have simplied it to just output the result as a text value. It uses recursion. You cannot use a for loop to do what you want to do. [code] <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:output method="text" …

Member Avatar for fpmurphy
0
104
Member Avatar for mk123

Looks like a valid XML file to me. BTW, a good site to use to check your XML for well-formedness, valid DTDs, etc is [URL="http://www.validome.org/"]http://www.validome.org/[/URL]

Member Avatar for fpmurphy
0
110
Member Avatar for hangon

[code] <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:output method="xml" indent="yes" omit-xml-declaration="yes" /> <xsl:template match="b"> <xsl:copy-of select = "."/> </xsl:template> </xsl:stylesheet> [/code]

Member Avatar for fpmurphy
0
120
Member Avatar for mvujica

This is should be close to what you want. [code] <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <xsl:output method="xml" indent="yes"/> <xsl:template match="/"> <xsl:apply-templates/> </xsl:template> <xsl:template match="*"> <xsl:variable name="name" select="name()" /> <xsl:element name="{name()}"> <xsl:attribute name="id"> <xsl:value-of select="count(preceding::*[name()=$name]) + 1" /> </xsl:attribute> <xsl:apply-templates /> </xsl:element> </xsl:template> </xsl:stylesheet> [/code]

Member Avatar for mvujica
0
101
Member Avatar for sbutt

One way would be to extract the CDATA first [code] <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text" /> <xsl:template match="ForwardRequestResponse"> <xsl:value-of select="."/> </xsl:template> <xsl:template match="/"> <xsl:apply-templates select="ForwardRequestResponse"/> </xsl:template> </xsl:stylesheet> [/code] and then process it though an XML pretty printer such as [code] <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml"/> <xsl:param name="indent-increment" select="' …

Member Avatar for vivek4075
0
137
Member Avatar for krish13

There is no simple way to do what you want using XSLT because of the multiple namespace declarations in the root element. In fact, the simpliest way is to use a stream editor such as sed. However, if you are willing to accept a slight modification of the file to …

Member Avatar for fpmurphy
0
597
Member Avatar for manowar83

one way ... [code] <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" /> <xsl:template match="/ts"> <ts> <xsl:apply-templates /> </ts> </xsl:template> <xsl:template match="uc"> <uc> </uc> </xsl:template> </xsl:stylesheet> [/code]

Member Avatar for yuvanbala
0
347
Member Avatar for dbratshpis

[code] <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text" /> <xsl:template match="CustomerRet"> customerName=<xsl:value-of select="./customerName"/> id=<xsl:value-of select="./customerId"/> customeField=<xsl:value-of select="./customField"/> </xsl:template> <xsl:template match="/"> <xsl:apply-templates /> </xsl:template> </xsl:stylesheet> [/code] Here is the output for the example xml file you supplied [code] customerName=Jack id=1 customeField=A customerName=Jack id=1 customeField= [/code]

Member Avatar for xml_looser
0
89
Member Avatar for punzo

Since nobody else has offered a solution, I will try and help you. Here is one way of generating lines 4 and 5 of the desired output. [code] <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml"/> <xsl:template match="/root"> <xsl:apply-templates /> </xsl:template> <xsl:template match="titel/bold"> <nummer><bold><xsl:value-of select="normalize-space(text()[1])"/></bold></nummer><xsl:text> </xsl:text><text><bold><xsl:copy-of select="descendant::node()[position()>2]"/></bold></text> </xsl:template> </xsl:stylesheet> [/code] The …

Member Avatar for fpmurphy
0
85
Member Avatar for isvaljek
Member Avatar for hangon

As far as I know you cannot use an XPath expression to do what you want to do. Here is how I get the result you are looking for [code] <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes" /> <xsl:template match="/" > <xsl:element name="PO"> <xsl:copy-of select="//ITEM[ID='1000']" /> </xsl:element> </xsl:template> </xsl:stylesheet> …

Member Avatar for fpmurphy
0
121
Member Avatar for sanket002

[code] <xsl:variable name="dummy" select= "/ArrayOfBookMark/BookMark[ShortName='Asp-7042-EndVar1']/Value" /> <xsl:variable name="dummy1"> <xsl:choose> <xsl:when test="$dummy != ''">$dummy</xsl:when> <xsl:otherwise>$</xsl:otherwise> </xsl:choose> </xsl:variable> [/code]

Member Avatar for fpmurphy
0
118
Member Avatar for john2029

[code] <xsl:if test="//text()[contains(., 'Sales')]"> <xsl:copy-of select="." /> </xsl:if> [/code]

Member Avatar for fpmurphy
0
77
Member Avatar for loukiachr

f you can specify the transformation you want to implement, then we can help you turn this specification into XSLT code. If you can't specify the transformation, then your problem is not an XSLT problem, and you're unlikely to get help on this forum.

Member Avatar for fpmurphy
0
81
Member Avatar for hschroeter

Please provide an example so we have a clearer understanding of your question.

Member Avatar for fpmurphy
-1
114
Member Avatar for tryhere

Here is a stylesheet which will do what you want [CODE] <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <!-- pass in as -param uid "'value'" --> <xsl:param name="uid"/> <xsl:output method="xml" indent="yes"/> <xsl:template match="/"> <xsl:element name="staff"> <xsl:apply-templates select="//user"/> </xsl:element> </xsl:template> <!-- output nodes that match --> <xsl:template match="user"> <xsl:if test="id=$uid"> <xsl:element name="user"> <xsl:element …

Member Avatar for fpmurphy
-1
125

The End.