473,396 Members | 1,786 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,396 software developers and data experts.

Spaces after procesed values

When I pull any given attribute out of my XML file via an XSL file, a
blank character (space) is appended after it. For example:

XSL File
----------------------
<xsl:value-of name="@path"><xsl:value-of name="@file">.doc

Result File
----------------------
C:\word_docs\ randomfilename .doc

I want to be able to pull multiple attributes and display them as one
line with no breaks/spaces; something more like this:

Result File
----------------------
C:\word_docs\randomfilename.doc

Now, I could use concat to pull them all together, or even a string
variable. But is there a way to override the behavior that adds the
space in the first place?

Thanks,

-jne

Jul 20 '05 #1
5 1624
Hi,
When I pull any given attribute out of my XML file via an XSL file, a
blank character (space) is appended after it. For example:

XSL File
----------------------
<xsl:value-of name="@path"><xsl:value-of name="@file">.doc

I assume your actual XSL looks like this:
<xsl:value-of name="@path"/>
<xsl:value-of name="@file"/>
..doc

To avoid the whitespace in text nodes of the result tree, either put evrything on one line:
<xsl:value-of name="@path"/><xsl:value-of name="@file"/>.doc

Or use the 'xsl:text' element:
<xsl:text><xsl:value-of name="@path"/></xsl:text>
<xsl:text><xsl:value-of name="@file"/></xsl:text>
<xsl:text>.doc</xsl:text>

regards,
--
Joris Gillis (http://www.ticalc.org/cgi-bin/acct-v...i?userid=38041)
"Quot capita, tot sententiae" - Terentius , Phormio 454
Jul 20 '05 #2

Joris Gillis wrote:
I assume your actual XSL looks like this:
<xsl:value-of name="@path"/>
<xsl:value-of name="@file"/>
.doc Yes, you are correct.
To avoid the whitespace in text nodes of the result tree, either put evrything on one line:
Unfortunatly, due to the structure of what I'm writing, multiple lines
are nescesary.
Or use the 'xsl:text' element:
<xsl:text><xsl:value-of name="@path"/></xsl:text>

This is the functionality that I'm looking for. However, XMLSpy and
Internet Explorer give me the following error: "Keyword xsl:text may
not contain xsl:value-of". Is there another option?

Thanks,

-James

Jul 20 '05 #3
>> Or use the 'xsl:text' element:
<xsl:text><xsl:value-of name="@path"/></xsl:text>

This is the functionality that I'm looking for. However, XMLSpy and
Internet Explorer give me the following error: "Keyword xsl:text may
not contain xsl:value-of". Is there another option?

I can hardly believe that.
The error is rather the 'name' attribute; it should be 'select'
<xsl:text><xsl:value-of select="@path"/></xsl:text>

--
Joris Gillis (http://www.ticalc.org/cgi-bin/acct-v...i?userid=38041)
"Quot capita, tot sententiae" - Terentius , Phormio 454
Jul 20 '05 #4
In article <op**************@news.pandora.be>,
Joris Gillis <ro**@pandora.be> wrote:
% >> Or use the 'xsl:text' element:
% >> <xsl:text><xsl:value-of name="@path"/></xsl:text>
% > This is the functionality that I'm looking for. However, XMLSpy and
% > Internet Explorer give me the following error: "Keyword xsl:text may
% > not contain xsl:value-of". Is there another option?
% I can hardly believe that.

Why not? xsl:text may not contain xsl:value-of. What the OP wants is
something like this:

<xsl:value-of select='@path'/>
<xsl:value-of select='@file'/>
<xsl:text>.doc</xsl:text>

The key is to represent all the literal text using <xsl:text> elements.
If you do this, whitespace will be ignored. If you have any literal
text which is not represented using xsl:text, all the whitespace will
be copied to the result tree in text nodes.
--

Patrick TJ McPhee
North York Canada
pt**@interlog.com
Jul 20 '05 #5
It worked like a charm. Thanks Patrick.

-James

Jul 20 '05 #6

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

Similar topics

1
by: Ragnorack67 | last post by:
Hi, I need some advice on what to do. I have this MySQL insert file, with about 30,000 records. One of the datafields has names in it. When this list was put together, apparently there was extra...
6
by: Ruben | last post by:
Hello. I am trying to read a small text file using the readline statement. I can only read the first 2 records from the file. It stops at the blank lines or at lines with only spaces. I have a...
4
by: Jay Chan | last post by:
I am trying to export data from a SQLServer database into a text file using a stored procedure. I want to be able to read it and debug it easily; therefore, I want all the columns to indent nicely....
7
by: PeteC | last post by:
I'm working on a web page which has some form elements in it which I need to manipulate using JavaScript. If the element is (for example, in a form called TicketForm) <INPUT...
6
by: Manan | last post by:
hello All, I have a simple question..I'm creating a tempString that contains my values then i'm adding to a ListItemCollection (). In my tempString i'm adding a spaces between each values it...
3
by: Will | last post by:
Hi In VB6 you could declare and enumeration with spaces using the type syntax I am now trying to implement an enum in VB.NET using this syntax and am having an issue Public Enum myEnu...
2
by: Chris Kratz | last post by:
We are having a weird problem that we ran into recently. If I use the following statements to create a test table and then run the select statement at the end, we get a very strange sort order. ...
9
by: King Albert | last post by:
Hi, My html page contains an array of objects: Please notice the space between Admiral and Nelson. My html page also contains a <select> with names, among them Karl Marx.
135
by: Xah Lee | last post by:
Tabs versus Spaces in Source Code Xah Lee, 2006-05-13 In coding a computer program, there's often the choices of tabs or spaces for code indentation. There is a large amount of confusion about...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.