XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 9th, 2003, 05:15 PM
mant mant is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 3 mant User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation XSL/XML Preformatted Text Output

I must admit being newbie to this game. I apologize in advance for my lack-of-knowledge. Thanks in advance for the help.

I'm just trying to output a block of text stored in an XML file via ASP and XSL. No matter what hoops I jump thrrough, I just can't get this working. I must be missing some fundamental understanding, as there is no way this can be this difficult.

Here's the desired output:
-----------------------------------------
I want to retain all the line breaks on output through the XSL. Whenever
I try to do this, all of the text simply comes out as one block of
text and loses it's formatting. This really is not good.

Here is some more text that I am typing just to fill space for
the purpose of this example.

The end.

Here's what I'm getting:
-----------------------------------------
Here's where I want to maintain the format of this paragraph. I want to retain all the line breaks on output through the XSL. Whenever I try to do this, all of the text simply comes out as one block of text and loses it's formatting. This really is not good. Here is some more text that I am typing just to fill space for the purpose of this example. The end.

Here's my XSL:
-----------------------------------------
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:for-each select="index/list">
<xsl:value-of select="bin[@id='urltitle']/info" disable-output-escaping="yes"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

Here's my XML:
-----------------------------------------
<?xml version="1.0"?>
<index>
<list>
<bin id="urldesc" taborder="1">
<info>
blah
</info>
</bin>
<bin id="urlpath" taborder="2">
<info>
blah
</info>
</bin>
<bin id="urltitle" taborder="3">
<info>
Here&apos;s where I want to maintain the format of this paragraph.
I want to retain all the line breaks on output through the XSL.
Whenever
I try to do this, all of the text simply comes out as one block of
text and loses it&apos;s formatting. This really is not good.
Here is some more text that I am typing just to fill space for
the purpose of this example.
The end.
</info>
</bin>
<bin id="textdesc" taborder="4">
<info>
blah blah
</info>
</bin>
<bin id="comments" taborder="5">
<info>
blah
</info>
</bin>
<bin id="email" taborder="6">
<info>
blah
</info>
</bin>
</list>
</index>

Additionally, I'm using the MSXML 3.0 parser with some ASP to load this:

set objXML = Server.CreateObject("Microsoft.XMLDOM")
objXML.preserveWhiteSpace = True

Any problem with using 'preserveWhiteSpace'?

Thanks again for the help. Sorry this was such a long post..

Reply With Quote
  #2  
Old July 9th, 2003, 10:42 PM
mant mant is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 3 mant User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Yep - read that..

I read that thread and several like it on this and other forums.

If that works, I must be doing something wrong, because it's not working for me.

Maybe it is in the ASP? Here's the function:

Function loadXMLFile(strXMLFile, strXSLFile)
Dim objXML
Dim objXSL
set objXML = Server.CreateObject("Microsoft.XMLDOM")
objXML.async = false
objXML.load(strXMLFile)
set objXSL = Server.CreateObject("Microsoft.XMLDOM")
objXSL.async = false
objXSL.load(strXSLFile)
Response.Write(objXML.transformNode(objXSL))
End Function

Reply With Quote
  #3  
Old July 15th, 2003, 05:25 PM
mant mant is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 3 mant User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Talking OK- you were right

Hey, thanks for the help. I did try that at one time, and then in my obfuscated mess, after I made changes to the code, I did not try to run the PRE tags around my text..

anyway! All is well and fixed. Many thanks.

bubye

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > XSL/XML Preformatted Text Output


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway