Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Search Forums
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Showing results 1 to 24 of 24
Search took 0.01 seconds.
Search: Posts Made By: pallone
Forum: XSLT July 12th, 2012, 05:24 PM
Replies: 4
Views: 1,208
Posted By mhkay
First write a function to compute day of week...

First write a function to compute day of week dow() for a given date: subtract a well-known Sunday from the date, divide by the duration PT1D, then take the result modulo 7.

Now subtract the two...
Forum: XSLT July 11th, 2012, 12:35 PM
Replies: 7
Views: 952
Posted By Martin Honnen
Use an XsltArgumentList:...

Use an XsltArgumentList: http://msdn.microsoft.com/en-us/library/dfktf882
Forum: XSLT July 11th, 2012, 09:30 AM
Replies: 7
Views: 952
Posted By samjudson
If you are using .Net then no, you probably...

If you are using .Net then no, you probably wouldn't use the xml-stylesheet instruction as you'd be much better controlling the stylesheet etc from in code.

Using the XslCompiledTransform Class:...
Forum: XSLT July 11th, 2012, 06:48 AM
Replies: 7
Views: 952
Posted By samjudson
You can load the lookups into global variables,...

You can load the lookups into global variables, outside of any template. Then you can use them within any template. Also it is often easier if your variable names mean something (and you need single...
Forum: Javascript How-To July 7th, 2011, 05:56 PM
Replies: 8
Views: 27,477
Posted By Imar
Many ways to Rome. If it works, it works ;-) ...

Many ways to Rome. If it works, it works ;-)

But if you're only looking for identical values, there's no need to keep track of the previous value. You can assign the first element to a variable,...
Forum: Javascript How-To July 7th, 2011, 09:55 AM
Replies: 8
Views: 27,477
Posted By Imar
You'll need to assign it an empty value. This way...

You'll need to assign it an empty value. This way there is no previous value. By renaming firstName to previous value, things may become clearer:


var previousValue = '';
for(var i =0; i <...
Forum: Javascript How-To July 7th, 2011, 09:07 AM
Replies: 8
Views: 27,477
Posted By Imar
You need to update the previous value inside the...

You need to update the previous value inside the loop as well. E.g.:


for(var i =0; i < names.length; i++)
{
currentName = names[i].Value;
if(firstName != currentName)
{
...
Forum: XSLT August 13th, 2010, 09:32 AM
Replies: 10
Views: 1,484
Posted By mhkay
>Does the EXSL library works for both IE 6 + and...

>Does the EXSL library works for both IE 6 + and Firefox 3 + ?

Some EXSLT functions are implemented as native code for particular XSLT processors, and some are implemented as generic XSLT 1.0...
Forum: XSLT August 13th, 2010, 08:47 AM
Replies: 10
Views: 1,484
Posted By mhkay
Well, you said you wanted to add 12 months....

Well, you said you wanted to add 12 months. Adding 11 months is more difficult. Take a look at the templates in the EXSLT library for date and time arithmetic, which handle a lot of this for XSLT...
Forum: XSLT August 13th, 2010, 08:44 AM
Replies: 10
Views: 1,484
Posted By samjudson
That isn't adding 12 months - that's adding 11. ...

That isn't adding 12 months - that's adding 11.


<xsl:variable name="month" select="Schedule/AnchorDate/Month/@value"/>
<xsl:variable name="year" select="Schedule/AnchorDate/Year/@value"/>
...
Forum: XSLT June 15th, 2010, 09:35 AM
Replies: 12
Views: 1,484
Posted By Martin Honnen
Here is an XSLT 1.0 stylesheet using Muenchian...

Here is an XSLT 1.0 stylesheet using Muenchian grouping that should output what you described:

<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

...
Forum: XSLT June 15th, 2010, 09:20 AM
Replies: 12
Views: 1,484
Posted By mhkay
Your problem is essentially the same as the one...

Your problem is essentially the same as the one that is solved here:

http://www.codeproject.com/KB/XML/groupxml.aspx
Forum: XSLT June 15th, 2010, 08:45 AM
Replies: 12
Views: 1,484
Posted By mhkay
Using the x[not(.=[preceding::x])] technique...

Using the x[not(.=[preceding::x])] technique should work, but it is incredibly inefficient compared with Muenchian grouping.

It's not working for you because your two nested for loops are saying...
Forum: XSLT February 16th, 2010, 02:39 PM
Replies: 9
Views: 1,054
Posted By Martin Honnen
Here is a code sample that sorts on the 'date'...

Here is a code sample that sorts on the 'date' attribute of the first 'Issue' descendant


<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

<xsl:output...
Forum: XSLT February 16th, 2010, 01:04 PM
Replies: 9
Views: 1,054
Posted By mhkay
The document root node "/" has only one element...

The document root node "/" has only one element child, which is the Ads element. The apply-templates processes this child. Sorting a sequence containing only one element is not very useful.

It...
Forum: XSLT December 4th, 2009, 07:37 AM
Replies: 7
Views: 3,276
Posted By samjudson
1) Take the following example XML: ...

1)

Take the following example XML:

<Root>
<Y z="1">
<Y z="2">
<Y z="3">
<Y z="4">
<Y z="3">
Forum: XSLT December 4th, 2009, 07:33 AM
Replies: 7
Views: 3,276
Posted By mhkay
>I cannot *distinguish the diffence between these...

>I cannot *distinguish the diffence between these two statements*:

following-sibling::Parameter[1][someCondition]
"then you select the first following sibling 'Parameter' element* if it...
Forum: XSLT December 3rd, 2009, 08:24 AM
Replies: 7
Views: 3,276
Posted By Martin Honnen
I took the stylesheet I posted in the previous...

I took the stylesheet I posted in the previous thread and slightly adapted it:

<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

<xsl:output method="xml"...
Forum: BOOK: Beginning JavaScript and CSS Development with jQuery July 10th, 2009, 06:22 AM
Replies: 10
Views: 3,745
Posted By samjudson
well obviously this.name isn't a valid property,...

well obviously this.name isn't a valid property, so try finding the correct property and using that. I've given you all the help I think you need and I think it would help you much more if you tried...
Forum: BOOK: Beginning JavaScript and CSS Development with jQuery July 9th, 2009, 06:58 AM
Replies: 10
Views: 3,745
Posted By samjudson
Once you've loaded the XML its just like...

Once you've loaded the XML its just like navigating an HTML document. So ask yourself how would you iterate over a list of DIV elements, gets their width attribute, and then find out what children it...
Forum: Javascript How-To July 9th, 2009, 04:03 AM
Replies: 3
Views: 1,918
Posted By joefawcett
Well I'd say it's definitely doable, but firstly...

Well I'd say it's definitely doable, but firstly you'd have to define the requirements. If you sort on a column and one row doesn't have that column, because another column extends into it, what...
Forum: BOOK: Beginning JavaScript and CSS Development with jQuery July 9th, 2009, 02:42 AM
Replies: 10
Views: 3,745
Posted By samjudson
Well you didn't actually list what you where...

Well you didn't actually list what you where expecting, so there is little surprise my example didn't produce it.


$(document).ready(function() {
$.get("labels.xml", function(xml) {
...
Forum: Javascript How-To June 10th, 2009, 11:20 AM
Replies: 2
Views: 976
Posted By joefawcett
^ means "at the start" and $ means "at the end"...

^ means "at the start" and $ means "at the end" so try a regex of:
/\s/g
Forum: XSLT June 2nd, 2009, 11:46 AM
Replies: 8
Views: 1,338
Posted By samjudson
Firstly position() is, as you say, context...

Firstly position() is, as you say, context sensitive. It depends on the current position in your source document.

Unfortunately you don't show us what your source XML document looks like, so there...
Showing results 1 to 24 of 24

 


All times are GMT -4. The time now is 07:05 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.