472,961 Members | 2,233 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,961 software developers and data experts.

Modifying Source Data from XSLT

[Warning, XSLT noob.]

In the XML source I'm working with, some node values that should be
identical, vary slightly from value to value. The differences are in
whitespace (some have a carriage return mid-string).

Ideally, I'd like to normalize-space() all of the values of the
underlying data, so that I later use and reuse the cleaned data
throughout the rest of the transformation (so I could properly use
distinct-values() on that list, etc.).

Is there a way to modify the underlying data, as opposed to having to
clean it each time you come to it?

Thanks,
Jamie

Jun 8 '06 #1
2 1004
Jamie Jackson wrote:
Is there a way to modify the underlying data, as opposed to having to
clean it each time you come to it?


You can't alter the source document -- expect by taking a two-pass
approach, one pass to create the altered source and then a second pass
to style from that. The two passes can be done in a single stylesheet,
with some work, if you're either using XSLT2 or are willing to use the
EXSLT node-set() function -- build the altered tree in a variable, then
style from that -- but of course this doubles your memory use and means
touching everything twice, so it may not be a net win.
Jun 8 '06 #2

Joe Kesselman wrote:
Jamie Jackson wrote:
Is there a way to modify the underlying data, as opposed to having to
clean it each time you come to it?


You can't alter the source document -- expect by taking a two-pass
approach, one pass to create the altered source and then a second pass
to style from that. The two passes can be done in a single stylesheet,
with some work, if you're either using XSLT2 or are willing to use the
EXSLT node-set() function -- build the altered tree in a variable, then
style from that -- but of course this doubles your memory use and means
touching everything twice, so it may not be a net win.


Okay, it's probably not worth the trouble, but good to know, thanks.

I've come up with a decent, simple workaround for my current issue, so
I'm set for today.

Thanks,
Jamie

Jun 8 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Greg Jones | last post by:
Hello, This may be a simple question but difficult to search on since the keywords are so generic. Is there a way, in XSLT, to copy an embedded DTD from the source XML to the target XML?...
4
by: titanandrews | last post by:
Hi, I have ran into a situation that I think should be possible, but I am fairly new to XSLT so maybe not. Suppose I have the following document <ROOT> <FOO name="A"> <CHILD name="B"/>...
6
by: Prashanth Ellina | last post by:
Hi, I am an XSLT newbie. I need to solve something which I will express in pseudo-code. function f1() { xmltree = <emptydom> addnamevaluepair(xmltree, "size","100")...
4
by: David S. Alexander | last post by:
I am trying to transform XML to XML using an XSLT in C#, but the root node of my XML is not being matched by the XSLT if it has an xmlns attribute. Am I handling my namespaces incorrectly? My C#...
40
by: GTi | last post by:
Is there any source code documentation tools available for Visual Studio 2005 ? I have created a LIB that must be documented. Must I do it by hand or is it some kind of tools to pre document my...
11
by: cmay | last post by:
I am having this problem... Lets say that your source XML is formatted like this: <somenode> Here is some text Here is some more text </somenode> When to a <xsl:value-of select="somenode" /I...
1
by: tslettebo | last post by:
Hi all. I've read Michael Kay's "XSLT" book, and used XSLT successfully as an HTML template system at our company (using basically the "fill-in-the-blanks" pattern of XSLT use: A template...
4
by: sklett | last post by:
(I posted this in a databinding NG, but it's a VERY low traffic NG so I thought I would post here as well. I hope no one minds too much, if you do I'm sorry) I have a DGV that is bound to a...
5
by: IUnknown | last post by:
Ok, we are all aware of the situation where modifying the folder structure (adding files, folders, deleting files, etc) will result in ASP.NET triggering a recompilation/restart of the application....
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.