I have a delimited string (delimited by spaces in my example below) that I need to tokenize, sort, and then join back together and I need to do all this using XSLT 1.0. How would I do that? I know I need to use xsl:sort somehow, but everything I’ve tried so far has given me some sort of error.
For example, if I run the code at the bot...
I need to perform a find and replace using XSLT 1.0 which is really suited to regular expressions. Unfortunately these aren't available in 1.0 and I'm also unable to use any extension libraries such as EXSLT due to security settings I can't change.
The string I'm working with looks like:
19;#John Smith;#17;#Ben Reynolds;#1;#Terry Jacks...
I'm tokenising a string with XSLT 1.0 and trying to prevent empty strings from being recognised as tokens. Here's the entire function, based on XSLT Cookbook:
<xsl:template name="tokenize">
<xsl:param name="string" select="''" />
<xsl:param name="delimiters" select="';#'" />
<xsl:param name="tokensplitter" select="','" />
...
I have an xml file in which there is tag namely, <Gender/> It carries either 'M' or 'F' as data, now my work is to test the value and write <Gender_Tag>Male</Gender_Tag> or <Gender_Tag>Female</Gender_Tag> according to the values M or F respectively .. I tried this code .. It used to work in other circumstances..
<xsl:template match="roo...
Hi,
Given the following XML:
<results name="queryResults">
<int name="intfield1:[* TO 10]">11</int>
<int name="intfield2:[10 TO 20]">9</int>
<int name="intfield1:[10 TO 20]">12</int>
</results>
I would like to produce this XML:
<results>
<field name="numberfield1">
<value name="[* TO 10]">11</value>
<val...
one of the toughest challenges I have ever faced in XSLT designing ..
How to copy the unique characters in a given string ..
Test xml is:
<root>
<string>aaeerstrst11232434</string>
</root>
The output I am expecting is:
<string>aerst1234</string>
...
I am transforming XML to XML using XSLT, The objective is to read the value of tag <node1>, if it is null then it must be assigned with the value of <node2>, if incase <node2>, is also null, then default text "Default" has to be assigned .. to both tags ..
EDIT: If <node2>is null and <node1> isn't .. then the code shouldn't update <node2...
Hello everyone,
I was wondering how I can possible extend XSLT 1.0 so that I can use functions from fn function namespace at http://www.w3schools.com/Xpath/xpath_functions.asp
I was just told that the system is using MSXML XSLT processor from now on. All my stylesheets were written in 2.0 ... So now I'm stack, nothing is working and d...
EDIT: [it started with character replacement
and I ended up with discovering string
replacements with help of Dimitre
Novatchev and Roland Bouman
I think the sample codes are sufficient to explain the requirements ..
This is the sample XML:
<root>
<node1>text node</node1>
<node2>space between the text</node2>
<node3> h...
I'm having troubles to figure out a way to group items xslt 1.0.
I have a source xml similar to the one below:
<client name="client A">
<project name = "project A1"/>
<project name = "project A2"/>
<project name = "project A3"/>
<project name = "project A4"/>
</client>
<client name="client B">
<project name = "projec...
Trying to mark radio inputs as selected with XSLT 1.0 using the below xslt code but this does not produced the desired result
desrired result
<input type="radio" value="available" title="email" selected="selected" />
Actual output
<input type="radio" value="available" title="email" selected />
Anyone any ideas why not please?...
I'm stuck with recursion, was wondering if anyone can help me out with it.
I have <Receipts> and <Deposits> elements, that are not verbose, i.e. that a <Receipts> element doesn't have an attribute to show what <Deposit> it is towards. I need to figure out <Deposits> "still amount due" and when a last receipt towards it was paid if any.
...
Hello guys,
I'm having troubles with the logic and would apprecite any help/tips.
I have <Deposits> elements and <Receipts> elements. However there isn't any identification what receipt was paid toward what deposit.
I am trying to update the <Deposits> elements with the following attributes:
@DueAmont - the amount that is still due...
I'm attempting to remove Component elements from the XML below that have File children with the extension "config." I've managed to do this part, but I also need to remove the matching ComponentRef elements that have the same "Id" values as these Components.
<Fragment>
<DirectoryRef Id="MyWebsite">
<Component Id="Comp1">
<Fi...
How can I include the content of a plain text file in a result document from within an XSLT 1.0 stylesheet? I.e., just like document(), but without parsing it:
<xsl:value-of select="magic-method-to-include-plaintext(@xlink_href)" />
I am almost sure, that this doesn't work without extension, because:
there is a special XPath functio...
Hi,
I have the following xml:
<Subscriptions>
<Subscription>
<Uplink>
<Size>15</Size>
<Unit>Mbps</Unit>
</Uplink>
<Name>Class D</Name>
</Subscription>
<Subscription>
<Uplink>
<Size>10</Size>
<Unit>Mbps</Unit>
</Uplink>
<Name>Class A</Name>
</Subscription>
<Subscription>
<Downlink>
<Size>50</Size>
<U...
Using Perl's XML::LibXSLT necessitates that I use XSLT 1.0, which means that I am stuck without XSLT 2.0 features. Is there a way that I can still pad text cleanly in a plain-text output from my processing? What I want is:
<values>
<headers>
<header>Header 1</header>
<header>Header 2</header>
</headers>
<va...
I have a variable containing:
<col p1="Newman" p2="Paul"/>
...
<col p1="Newman" p2="Paolo"/>
<col p1="Newman" p2="Paul"/>
i wold in output a table with in the first column the value of p2 and in the second the number of time it appear. For each value of p2 should i have only a row.
<table>
<tr><td>p2</td><td>num</td></tr>
<tr><td>Pau...
Hello everyone,
I have the following XML (it is simplified and most attributes are omitted):
<Document>
<Transfer Name="" From="" To=""/>
<Transfer Name="" From="" To=""/>
<OtherElement/>
<OtherElement/>
<Flight AirLina="" From="" To=""/>
<Flight AirLina="" From="" To=""/>
<OtherElement/>
<Hotel Name="" Duration=""/>
...
I have been messing with xslt off and on since I became a sharepoint administrator, it uses xslt alot for displaying list data. I have recently started using it to transform database results that I have converted to xml using an extension method. I am trying to produce clean html.
My first attempt, worked fine. However I used for-eac...