470,870 Members | 1,411 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,870 developers. It's quick & easy.

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 945
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Prashanth Ellina | last post: by
40 posts views Thread by GTi | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.