|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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'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. </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.. |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > XSL/XML Preformatted Text Output |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|