473,406 Members | 2,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 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 1018
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.