Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Search Forums
Password Reminder
Register
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 25 of 500
Search took 0.07 seconds.
Search: Posts Made By: mhkay
Forum: XSLT February 11th, 2019, 12:08 PM
Replies: 6
Views: 568
Posted By mhkay
You don't need a sort here, just do ...

You don't need a sort here, just do


<xsl:template match="Lines">
<Lines>
<xsl:apply-templates select="CreditLines"/>
<xsl:apply-templates select="DebitLines"/>
</Lines>...
Forum: XSLT February 7th, 2019, 01:57 PM
Replies: 2
Views: 384
Posted By mhkay
It's very hard to help on this sort of question...

It's very hard to help on this sort of question without seeing the source document; it also helps to show the current result you are getting and how this differs from the desired result.

You could...
Forum: XSLT December 6th, 2018, 05:08 AM
Replies: 6
Views: 567
Posted By mhkay
Go away, you scum. Find a way to promote your...

Go away, you scum. Find a way to promote your business that doesn't make your readers hate you.
Forum: XSLT December 4th, 2018, 06:52 AM
Replies: 6
Views: 567
Posted By mhkay
I'm afraid it's over 15 years since I used XSLT...

I'm afraid it's over 15 years since I used XSLT 1.0 in anger and I've forgotten most of the workarounds.

And of course, it's no fun working with old technology when you know the problem is...
Forum: XSLT December 4th, 2018, 04:38 AM
Replies: 6
Views: 567
Posted By mhkay
In XSLT 2.0, use <xsl:for-each-group...

In XSLT 2.0, use


<xsl:for-each-group select="*" group-starting-with="Item">
<Item>
... item details ...
<xsl:for-each select="current-group()[self::DeliveryInfo]">
......
Forum: XSLT August 17th, 2018, 03:17 AM
Replies: 3
Views: 800
Posted By mhkay
Please don't ask new questions on an existing...

Please don't ask new questions on an existing thread.

Despite its name, Attribute is not an attribute, it is an element. And Name is an attribute, and A-AssetFileName is a string literal.

And...
Forum: XSLT August 16th, 2018, 05:54 PM
Replies: 3
Views: 800
Posted By mhkay
The elements in your source XML are in a...

The elements in your source XML are in a namespace, but your stylesheet is matching no-namespace element names. You need


<xsl:template match="/x:Data/x:Entities/x:Entity">


with the...
Forum: XSLT June 8th, 2018, 03:50 AM
Replies: 1
Views: 673
Posted By mhkay
Despite the title of your question, you don't...

Despite the title of your question, you don't seem to be changing the "element text" at all, you are only changing the name.

Define a mapping from old names to new names like this:


<xsl:key...
Forum: XSLT June 7th, 2018, 04:34 AM
Replies: 5
Views: 566
Posted By mhkay
Sorry, this isn't a free code-writing service.

Sorry, this isn't a free code-writing service.
Forum: XSLT June 7th, 2018, 03:26 AM
Replies: 5
Views: 566
Posted By mhkay
Information on writing Java extension functions...

Information on writing Java extension functions for calling from Saxon XSLT code can be found here:

http://www.saxonica.com/documentation/index.html#!extensibility

The mechanism of "reflexive...
Forum: XSLT May 24th, 2018, 05:17 AM
Replies: 4
Views: 1,663
Posted By mhkay
Firstly, your source element is in a namespace,...

Firstly, your source element is in a namespace, but you are matching elements in no namespace. Instead of match="DocumentDestinationPartner" you need match="p:DocumentDestinationPartner" where the...
Forum: XSLT May 19th, 2018, 05:26 PM
Replies: 9
Views: 623
Posted By mhkay
To read multiple XML files in a transformation...

To read multiple XML files in a transformation you will generally want to use the document() function.

For example if your main input document contains a list of files to be processed like this:
...
Forum: XSLT May 17th, 2018, 11:52 AM
Replies: 9
Views: 623
Posted By mhkay
Start by reading my book.

Start by reading my book.
Forum: XSLT May 17th, 2018, 10:35 AM
Replies: 9
Views: 623
Posted By mhkay
I'm happy to help you debug your code if you're...

I'm happy to help you debug your code if you're completely stuck, but I'm not going to write the code for you. Show how far you've got, and indicate how it's failing.

Note that to post code on...
Forum: XSLT April 9th, 2018, 10:50 AM
Replies: 2
Views: 502
Posted By mhkay
It's certainly possible in XSLT, though as...

It's certainly possible in XSLT, though as there's no XML involved other rule-based languages like awk might be better.

If you're going to use XSLT, make sure it's version 2.0 or higher: you'll...
Forum: BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition ISBN: 978-0-470-19274-0 April 9th, 2018, 10:04 AM
Replies: 2
Views: 1,007
Posted By mhkay
I regret there are no current plans for a new...

I regret there are no current plans for a new edition covering XSLT 3.0. Various reasons for this, the main ones being (a) the pressure on my time, (b) not many people buy books covering a new...
Forum: XSLT March 20th, 2018, 02:07 PM
Replies: 2
Views: 569
Posted By mhkay
Sorry, Rita, I'm having trouble understanding the...

Sorry, Rita, I'm having trouble understanding the question.

Perhaps your requirement is:

For a CRCDATALINE, print (something) if (a) PDFPRINT is "Y" or absent, and (b) there is no...
Forum: XSLT February 26th, 2018, 03:39 AM
Replies: 3
Views: 605
Posted By mhkay
Your question makes no sense. Please explain more...

Your question makes no sense. Please explain more carefully what you are trying to achieve.
Forum: XSLT January 31st, 2018, 08:10 PM
Replies: 2
Views: 407
Posted By mhkay
There's lots of whitespace before and after the...

There's lots of whitespace before and after the "N", which makes the variable not equal to the simple string "N".
Forum: XSLT January 31st, 2018, 06:30 PM
Replies: 2
Views: 347
Posted By mhkay
"I have a variable that I need to set to "Y" if...

"I have a variable that I need to set to "Y" if <CRC> has a value and it's
corresponding <CRCFUNCTION> has a value of 900 in any of the associated <CRCDATALINE> for a specific <DETAILLINE>."

The...
Forum: XSLT January 10th, 2018, 04:09 AM
Replies: 4
Views: 2,937
Posted By mhkay
The question of which languages are supported...

The question of which languages are supported depends on the XSLT processor you are using.

If you're using Saxon, then it depends on which version & edition: please raise Saxon-specific questions...
Forum: XSLT December 15th, 2017, 02:07 PM
Replies: 1
Views: 492
Posted By mhkay
If you're able to use XSLT 3.0 I would do: ...

If you're able to use XSLT 3.0 I would do:


<xsl:for-each-group select="tokenize(., '\s*,\s*')"
group-starting-with=".[contains(., ' ')]">
<xsl:variable name="prefix"...
Forum: XSLT November 17th, 2017, 05:11 AM
Replies: 5
Views: 1,299
Posted By mhkay
Try posting your code. You're much more likely to...

Try posting your code. You're much more likely to find someone prepared to tell you where you code is wrong, than to write the code for you from scratch. Personally, I'm afraid I haven't coded in...
Forum: XSLT November 17th, 2017, 04:52 AM
Replies: 5
Views: 1,299
Posted By mhkay
You don't say which version of XSLT you are...

You don't say which version of XSLT you are using.

This is a standard grouping problem. As such, it is much easier to solve in XSLT 2.0 using the xsl:for-each-group instruction. (It's very similar...
Forum: XSLT November 12th, 2017, 04:12 PM
Replies: 2
Views: 551
Posted By mhkay
I think that the line <xsl:if...

I think that the line


<xsl:if test="matches(substring(., 1, 1), '[A-Z]')">


should be


<xsl:if test="not(matches(substring(., 1, 1), '[A-Z]'))">
Showing results 1 to 25 of 500

 


All times are GMT -4. The time now is 06:00 AM.


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